码迷,mamicode.com
首页 > 其他好文 > 详细

nginx statistics in multi-workers

时间:2015-02-27 15:12:27      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:

1.      从网上下载多进程统计补丁。https://github.com/arut/nginx-patches

2.      Copy补丁文件per-worker-listenernginx代码目录下。如\nginx-1.7.2

3.      打补丁:patch -p1 < per-worker-listener

4.      make &make install

5.      修改配置文件:

daemon on;
master_process on;
worker_processes 5;

 

events{
    worker_connections 1024;
    accept_mutex off;
}

 

#HTTP
http{
    
   upstream redis_pool {
        server localhost:6379;
        keepalive 1024 single;
    }

    server {
        listen 8080;
        listen 10000 per_worker;//第一个worker从10000开始

    }

}

6.     运行Nginx,并测试

http://localhost:10000/stat

http://localhost:10001/stat

http://localhost:10002/stat

http://localhost:10003/stat

http://localhost:10004/stat

  

nginx statistics in multi-workers

标签:

原文地址:http://blog.csdn.net/wutong_login/article/details/43967913

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!