调整nginx worker_process以获得每分钟100k点击次数

我们有一台服务器正在提供一个html文件。

现在服务器有2个CPU和2GB的内存。 从blitz.io,我们得到每分钟12k的连接,从那60秒中的200个超时,每秒250并发连接。

worker_processes 2; events { worker_connections 1024; } 

如果我增加超时,响应时间开始爬超过一秒钟。

我还能做些什么来挤出更多的汁液呢?

configuration文件:

 worker_processes 4; # 2 * Number of CPUs events { worker_connections 19000; # It's the key to high performance - have a lot of connections available } worker_rlimit_nofile 20000; # Each connection needs a filehandle (or 2 if you are proxying) # Total amount of users you can serve = worker_processes * worker_connections 

更多信息: http : //blog.martinfjordvald.com/2011/04/optimizing-nginx-for-high-traffic-loads/