Nginx – disadvantage to running nginx on a VM

nginxperformancevirtual-machinesvmware-esx

I plan on using nginx to host much of my static content with some minimal php. I'm going to have 2 servers for nginx, but that may be too much hardware for what I need. I'm thinking about dividing them into a total of 4 nginx virtual machines (2 per box). This would allow me to more flexibly divide the resources between nginx and the other parts of the site (which are apache).

Most of the cpu/ram would be used to host the static files and execute system calls from php.

We would use vmware esx to make the virtual machines.

Would we take a major performance hit by running nginx on the VMs as opposed to running it natively on the hardware?

Best Answer

"Would we take a major performance hit by running nginx on the VMs as opposed to running it natively on the hardware?"

It depends on the underlying hardware and how you're allocating it. Are you going to run several other virtual machines on the same hosts? How many virtual CPU's are you going to allocate versus logical CPU's available?

There is a CPU toll when it comes to virtualisation, but it's extremely little. It can be mitigated by "pinning" the virtual CPU's to logical CPU's with careful planning.