Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMySQL and Vi...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOutlineIntro...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOverviewWhyW...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioPopular solu...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioNative again...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioDevelopmentQ...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioConsideratio...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMemoryKSMHow...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMemory IIKSM...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioCPUProcessor...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioNetworkTypes...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioSecurityMasq...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Stor...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Stor...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Stor...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Stor...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOthersTransp...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioReliabilityW...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioReliability ...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioUpgradesDown...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioTestingClust...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioFault inject...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOthersJenkin...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application Conclusioperf-kvmperf...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioGDB monitorR...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioQemu Monitor...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioTracingFtrac...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioDevelopmentQ...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioDevelopment ...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioWrappersScri...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioThoughts?Que...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioAppendixBest...
Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMeRaghavendr...
Upcoming SlideShare
Loading in …5
×

MySQL-and-virtualization

1,718 views

Published on

Talk presented at PLMCE - https://www.percona.com/live/mysql-conference-2013/sessions/mysql-and-virtualization

Published in: Technology
  • Be the first to comment

MySQL-and-virtualization

  1. 1. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMySQL and VirtualizationPercona Live MySQL Conference and Expo 2013Raghavendra Prabhuraghavendra.prabhu@percona.comPercona23rd April, 2013Raghavendra Prabhu PerconaMySQL Virtualization
  2. 2. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOutlineIntroductionVirtualizationMySQLSymbiosisInstrumentation/DebuggingInstrumentation IIApplicationConclusionRaghavendra Prabhu PerconaMySQL Virtualization
  3. 3. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOverviewWhyWhy notPerformance v/s EfficiencyOvercommit!High AvailabilityTesting/InstrumentationRaghavendra Prabhu PerconaMySQL Virtualization
  4. 4. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioPopular solutionsXen, KVM, VirtualBoxWhy KVMMassive reuse of kernel and userspaceCompatibility in case of para-virtMost applies to Xen as wellImportant differenceRaghavendra Prabhu PerconaMySQL Virtualization
  5. 5. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioNative against EmulationEmulation: TCGValgrindKVMKernel moduleVT-x (Intel), AMD-VGuest - Host contextExit - Enter latencyLazy approachPara-virtualizationRaghavendra Prabhu PerconaMySQL Virtualization
  6. 6. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioDevelopmentQEMUMost activeIn-kernelNative clientMore hypervisorsKVM API - ioctl /dev/kvmRaghavendra Prabhu PerconaMySQL Virtualization
  7. 7. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioConsiderationsPerformanceScaling - Horizontal or VerticalEggs and the BasketMoore’s lawCostSaturationRaghavendra Prabhu PerconaMySQL Virtualization
  8. 8. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMemoryKSMHow it works and is usedHow it can be used: MADV_MERGEABLEMemory Ballooning: VirtioOvercommitMemory statistics: QOMCachingAffects I/OWrite{back,through}, none, directsync and unsafeSnapshot mode & commit: cache=unsafeRaghavendra Prabhu PerconaMySQL Virtualization
  9. 9. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMemory IIKSM for MySQLMultiple buffer poolsShared storage - VirtFSWith NUMAPinning + KSM = !ksmtuned and numadBallooning: In host’s shoesWhereMigration & Upgrade - Hot/ColdWith QGAFeedback from MySQL: Para-virtualized process!CacheInnoDB + cache=none = true O_DIRECT: for NFS=writethrough: app fails to grok fsync=writeback: speed and benefits of noneRaghavendra Prabhu PerconaMySQL Virtualization
  10. 10. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioCPUProcessor pinningCgroups: BetterApplies to othersDynamicHotplugOvercommitting - smpContext switchesRaghavendra Prabhu PerconaMySQL Virtualization
  11. 11. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioNetworkTypesVDETAP and BridgeOpenvswitchDumpMulticast with UDPPerformancevirtio-netPara-virtualized constructMulti-queuevhost-netZero-copy transmit: DMANo Qemu: kernel and KVMNot just networkRaghavendra Prabhu PerconaMySQL Virtualization
  12. 12. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioSecurityMasqueradingIsolationNamespacesRandom NumbersWhy?Hardware / Virtio RNGResource exhaustion: DDoSOOM: CgroupsSeccomp sandbox: Safety is only an illusion!Guest to host vulnerabilitiesEncryptionRaghavendra Prabhu PerconaMySQL Virtualization
  13. 13. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and StorageThe weakest linkVirtiovirtio-blk-pci data planeSeparate I/O threadPCI PassthroughPCI devices in generalIOMMU (AMD) & VT-d (Intel)SR-IOV: multiple devices without havingVFIO: in userspaceNo longer exclusiveMore secure: very importantInterrupts closer to guestRaghavendra Prabhu PerconaMySQL Virtualization
  14. 14. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Storage IIVirtFSFilesystem passthrough9p protocolPossibilitiesFragmentationHow: Hole punchingFallocate, pre-allocation QcowThin provisioningQcow lazy provisioningDevice mapper targetThrottling: Errant guests!block_set_io_throttleRaghavendra Prabhu PerconaMySQL Virtualization
  15. 15. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Storage IIIBackendsRawQcowBlock device attachmentPerformance close to bare metalGlusterFSSheepdogDistributed StorageiSCSINBDNetworked storageShared disk imageRaghavendra Prabhu PerconaMySQL Virtualization
  16. 16. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioI/O and Storage IVSchedulerDeadlineCFQ - quantum and sliceDiscardPass discard requests to host filesystemFully asyncAIOpthread v/s nativeSwapSwappinessLess preferred to Ballooning and KSMPoor with EPTRaghavendra Prabhu PerconaMySQL Virtualization
  17. 17. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOthersTransparent Huge PagesIssues?Possible fixes - MADV_NOHUGEPAGEHow can it helpivshmemFastest message passingRaghavendra Prabhu PerconaMySQL Virtualization
  18. 18. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioReliabilityWhat everyone wants: Uninterrupted Sleep - ‘D’ stateWhat they usually get: Nagios alertsIts like InsuranceWhat can be doneBackupsBackup the original imageBlockdev snapshotguestfs-fsfreeze-{freeze,thaw} and FTWRLRaghavendra Prabhu PerconaMySQL Virtualization
  19. 19. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioReliability IIHigh AvailabilitySystem uptime v/s Application uptimeDifferenceMigrationLive migration: RequirementOnline block streaming/commitDrive MirroringLive block copySnapshotsVM Snapshots: complete stateQcow2 snapshotsRaghavendra Prabhu PerconaMySQL Virtualization
  20. 20. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioUpgradesDowntimeBallooning the buffer poolMigrationPreserves connectionsOpenvSwitchRaghavendra Prabhu PerconaMySQL Virtualization
  21. 21. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioTestingClusterPXCTopologiesArmy of nodesForest: Cluster of clustersData centers in microcosmMemoryNUMAPage cache and Memory PressureDump guest memory: coreExamine onlineRaghavendra Prabhu PerconaMySQL Virtualization
  22. 22. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioFault injectionNMI and MCEPulling the power cord!FilesystemInteresting casesExt4XFSPCI AERRaghavendra Prabhu PerconaMySQL Virtualization
  23. 23. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioOthersJenkins and VagrantWatchdog“Houston, we have a problem”With MySQL: Turtles all the waysystemdACPI tablesRaghavendra Prabhu PerconaMySQL Virtualization
  24. 24. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application Conclusioperf-kvmperf toolsuiteStrace?CaveatsRaghavendra Prabhu PerconaMySQL Virtualization
  25. 25. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioGDB monitorRemote Target and Single SteppingKernel developmentbzImage and initrdRaghavendra Prabhu PerconaMySQL Virtualization
  26. 26. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioQemu Monitor (QMP/HMP)BallooningThrottlePCI Hot-addExamining memoryJSON APIEndless possibilities with scriptingPython scripts in repoInfo commandsRaghavendra Prabhu PerconaMySQL Virtualization
  27. 27. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioTracingFtraceLatencyVirtio I/ODtraceWith systemtapLTTngSimpleStderrDprintfRaghavendra Prabhu PerconaMySQL Virtualization
  28. 28. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioDevelopmentQCOWBacking file hierarchyblock streamAdvantagesCopy on readLazy RefcountsEncryption and CompressionRaghavendra Prabhu PerconaMySQL Virtualization
  29. 29. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioDevelopment IICaveatsRaw v/s Qcow: PerformanceRendering Qcow unusableFilesystem passthroughShare datadirCommon code-tree / development directoriesPass the entire root R/O!Lightweight SnapshotUseful to have newer FHS with /usrRaghavendra Prabhu PerconaMySQL Virtualization
  30. 30. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioWrappersScriptinglibvirtvirsh / virt-managerOpenstackProxmoxCandySpiceVNCoVirtVDSMRaghavendra Prabhu PerconaMySQL Virtualization
  31. 31. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioThoughts?QuestionsUsage and ExperienceRaghavendra Prabhu PerconaMySQL Virtualization
  32. 32. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioAppendixBest practices: http://goo.gl/LY3tfVirtio Introduction: http://goo.gl/B9bCAKVM Kernel API: http://goo.gl/5A4Malinux-kvm.org: http://goo.gl/yWPiUInternals blog: http://goo.gl/z07cyQemu wiki: http://goo.gl/IGoKaRedHat Virtualization docs: http://goo.gl/rXRKcDocs from Qemu git tree: http://goo.gl/qD7njKSM internals: http://goo.gl/ypyhkRaghavendra Prabhu PerconaMySQL Virtualization
  33. 33. Introduction Virtualization MySQL Symbiosis Instrumentation/Debugging Instrumentation II Application ConclusioMeRaghavendra Prabhuhttp://wnohang.net/aboutSoftware Engineer at Percona and Product Lead of PXChttps://launchpad.net/percona-xtradb-clusterSlides downloadable at http://goo.gl/jsultRaghavendra Prabhu PerconaMySQL Virtualization

×