Tuning nginx worker_process to obtain 100k hits per min

后端 未结 1 1050
春和景丽
春和景丽 2020-11-27 09:04

We have a server that is serving one html file.

Right now the server has 2 CPUs and 2GB of ram. From blitz.io, we are getting about 12k connections per minute and an

相关标签:
1条回答
  • 2020-11-27 09:42

    Config file:

    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
    

    more info: Optimizing nginx for high traffic loads

    0 讨论(0)
提交回复
热议问题