2

How important is PE Size for KVM virtualization ? Some people say that is useless to follow SolusVM instructions for KVM by setting PE Size from default 4M to 32M.

mario
  • 21
  • 2

1 Answers1

2

The kernel uses a small amount of memory for each physical extent that exists in mounted LVM volumes. So setting a larger PE size can save memory if you are severely memory constrained. For a server intended for virtualization, you should not be memory constrained.

Also, tools which manage LVM may have to traverse the list of physical extents, and if there are more of them, then the tools will work more slowly. This doesn't affect regular day-to-day I/O, just using management tools.

However, setting the PE size very large can result in wasted space, up to slightly less than the size of a PE per physical disk. With today's multi-terabyte drives, losing up to 31.9MB (32MB PE size) is really minor, but in the past when drives were only multi-gigabyte this was a serious consideration.

The PE size, of course, also affects how you can size your LVs, since the size of an LV must be a multiple of the PE size. So setting the PE size higher than 1GB or so is probably not useful.

In the end, the 32MB PE size seems perfectly reasonable for a virtualization server. You may even want to increase it further. For the smaller volumes created within the virtual machines, you probably want to use the system defaults, or 4MB, for much the same reasons.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thank you. I have several nodes with OpenVZ virtualizations and today I added new node for KVM Virtualizations, I finished the install letting PE Size 4MB. Now I can't change it anymore as KVM VPS's already created. SolusVM advices for PE Size 32MB but today I opened a ticket and they told me its not mandatory anymore because there is no technical reason to use a larger PE size, as LVM2 has no longer a limitation of 65534 extents in a volume group (which would limit a VG to 256G with4MB PE size). I just hope I will have no problems with the new node.. – mario Apr 02 '14 at 17:31
  • Right, you can only change the PE size by destroying and recreating the entire VG. – Michael Hampton Apr 02 '14 at 17:33