Resources usage with nginx (RAM/CPU)


#1

Hello,

I’m setting up a server to host busy websites. The best and cheaper option I found is a single processor (4 cores/8 threads) server with 64GB RAM. Of courses this is not very proportional. The services which this server will run will mainly be three: nginx, MySQL and PHP.

However, I found out there’s too much RAM for not enough CPU. I would like some advice. Does nginx consumes a lot of CPU? I know I can tweak PHP and MySQL with accelerators/cache to take more of RAM while saving CPU. But regarding nginx, what’s a good solution?

Thanks.


#2

First 4-cores/8-thread CPU and 64GB RAM is good for handling high traffic websites

Also nginx is not used much cpu like php and mysql still we need to adjust some of nginx settings to match with current server configuration like worker_processes and worker_connections etc


#3

Mitesh,

Great to receive a reply from you. :slight_smile:

I have only had experience with VPS’s, and I know you are totally right when you say nginx is not much CPU-consumer as PHP and MySQL. However, I’ve noticed that php-fpm always uses a lot of CPU. Really A LOT. And also a lot of RAM (but as I have 64GB RAM won’t be an issue). That’s why I am so worried about CPU usage. In an old DigitalOcean’s droplet (4GB/2 cores) I’ve reached 98% of CPU when using 3GB of RAM. But I’m not sure if CPU usage in a VPS is a value we should consider (they use KVM, which shared the CPU, right?).


#4

Hope following guide helps you: https://github.com/rtCamp/easyengine/wiki/Prevent-MySQL-crashing


#5