Mysql – Heavy production MySQL/Percona Database in openvz container

MySQLopenvzperconaperformanceproxmox

So I'm currently running a MySQL 5.1 database, with the following specs:

  • Proc: Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz
  • RAM: 64 Go
  • disks: 2x 100 Go SSD (RaidSoft)

I'm planning to migrate my physical server as well as my mysql server to a percona server 5.6.

I'm using a Proxmox cluster for the rest of my infrastructure therefore I'd like to put my new MySQL server in a dedicated openvz container (only one on the host).

I already successeed to setup this and it seems to work well, however I'm still wondering if it is a good idea.

Any feedbacks?

Best Answer

Be careful about using OpenVZ (Proxmox or otherwise) for any operations where there could be a lot of disk I/O. I can tell you from experience that it is very, very slow - about half the speed of native hardware in some cases. It's especially bad with writes, and it gets worse the more containers are on the server doing reads and writes (thought the latter part of that doesn't apply in your case).

Also, keep in mind that MySQL is very resource hungry and may easily either get OOM killed or otherwise hit a container limit if you haven't set them properly. Again, from experience, this can be hard to do. There is also the fact that certain things to help MySQL perform better, such as hugepages, cannot be set from within the container, so you may end up switching back and forth from host to guest.

About the only things you're going to get out of putting MySQL into a container are process isolation (but not really), some mild assurances that the container won't take down the node (but no guarantees), a pretty interface to control your server with (not unique to OpenVZ containers), and a lot of headaches until you get it configured right. I would avoid OpenVZ for this particular use.

If you're dead-set on using Proxmox, I'd suggest using KVM for this purpose instead of an OpenVZ container. You'll have fewer headaches, trust me.

Related Topic