Virtualization has been one of the pre-dominant topics in the past couple of years. Not going to the cloud is considered to be uncool - at minimum it feels like being stake in the stone age of computing.
Table of Contents
First of all it means "virtualization". If you google it you can find many definitions. A suitable definition is: Virtualization is the process of creating a virtual (rather than actual) version of something, such as a virtual server, virtual storage device, virtual network, or even a virtual operating system. In the context of computing, virtualization refers to the creation of a virtual (rather than physical) version of a computing resource, such as a server, storage device, network, or operating system. Virtualization allows multiple virtual instances of resources to run on a single physical machine, enabling better resource utilization, improved scalability, flexibility, and cost savings.
This is cool from many points of view but what does it mean for performance? Virtualization usually does not good, this was clear from the start.
The impact can actually be quite shocking as the following profiling output of a PostgreSQL instance shows (we used XEN for virtualization):
1 2 3 4 5 6 7 8 9 10 11 |
samples pcnt function DSO _______ _____ _____________________________ __________________________________________________ 21026.00 51.1% hypercall_page [kernel.kallsyms] 1577.00 3.8% heap_hot_search_buffer /home/hs/bin/postgres 886.00 2.2% AllocSetAlloc /home/hs/bin/postgres 741.00 1.8% SearchCatCache /home/hs/bin/postgres 608.00 1.5% LWLockAcquire /home/hs/bin/postgres 586.00 1.4% copy_user_generic_string [kernel.kallsyms] 543.00 1.3% xen_local_clock [kernel.kallsyms] 506.00 1.2% system_call [kernel.kallsyms] 502.00 1.2% base_yyparse /home/hs/bin/postgres |
What you can see is that basically half of the time is spent is burned by virtualization - not PostgreSQL. Similar results can be observed when comparing virtualized results with non-virtualized ones. On an 8-core AMD box PostgreSQL managed to provide us with 4.500 TPS (pgbench scale factor 10 with 10 concurrent users). Doing the same thing inside a KVM virtual machine made PostgreSQL achieve something in the area of 1.600 TPS.
It is especially important to mention that PostgreSQL was running with "synchronous_commit = off" to reduce fsync-related contentions.
For small scale applications virtualization is definitely an advantage because more stuff can be put on the same hardware. For large scale PostgreSQL databases, however, it might turn out to be a foot gun.
In order to receive regular updates on important changes in PostgreSQL, subscribe to our newsletter, or follow us on Facebook or LinkedIn.
+43 (0) 2622 93022-0
office@cybertec.at
You are currently viewing a placeholder content from Facebook. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.
More InformationYou are currently viewing a placeholder content from X. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.
More Information