zoukankan      html  css  js  c++  java
  • Nginx配置两份日志记录

    nginx配置
    版本-1.4.4

    access_log  /alidata/log/nginx/access/wordpress1.log  ;
    access_log  /alidata/log/nginx/access/wordpress2.log  ;
    

    压力测试,使用webbench测试


    Benchmarking: GET http://blog.miaojunrs.com/
    50 clients, running 1200 sec.

    Speed=94 pages/min, 62367 bytes/sec.
    Requests: 1895 susceed, 0 failed.


    watch观察结果


    watch wc -l wordpress1.log wordpress2.log  #观察日志条数
    root@iZ285ma471jZ:/alidata/log/nginx/access# diff wordpress1.log wordpress2.log#diff确认日志无差异
    root@iZ285ma471jZ:/alidata/log/nginx/access#
    

    Every 2.0s: wc -l wordpress1.log wordpress2.log Fri Jul 8 17:29:21 2016

    1945 wordpress1.log
    1945 wordpress2.log
    3890 total

    测试是可以双写的

    使用新nginx验证
    nginx version: nginx/1.5.13

    ab 压力测试
    [root@iZ285ma471jZ exception]# ab -n200000 -c2000 http://blog.miaojunrs.com/
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking blog.miaojunrs.com (be patient)
    Completed 20000 requests
    Completed 40000 requests
    Completed 60000 requests
    Completed 80000 requests
    Completed 100000 requests
    Completed 120000 requests
    Completed 140000 requests
    Completed 160000 requests
    Completed 180000 requests
    Completed 200000 requests
    Finished 200000 requests
    
    
    Server Software:
    Server Hostname:        blog.miaojunrs.com
    Server Port:            80
    
    Document Path:          /
    Document Length:        0 bytes
    
    Concurrency Level:      2000
    Time taken for tests:   17.949 seconds
    Complete requests:      200000
    Failed requests:        200276
       (Connect: 0, Receive: 0, Length: 187797, Exceptions: 12479)
    Write errors:           0
    Non-2xx responses:      188237
    Total transferred:      59859366 bytes
    HTML transferred:       30494394 bytes
    Requests per second:    11142.99 [#/sec] (mean)
    Time per request:       179.485 [ms] (mean)
    Time per request:       0.090 [ms] (mean, across all concurrent requests)
    Transfer rate:          3256.90 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:       13   90  78.3     88    1106
    Processing:    18   89  23.9     92     166
    Waiting:        0   64  24.9     69     135
    Total:         42  178  84.2    180    1231
    
    Percentage of the requests served within a certain time (ms)
      50%    180
      66%    192
      75%    200
      80%    204
      90%    214
      95%    223
      98%    236
      99%    245
     100%   1231 (longest request)
    [root@iZ285ma471jZ exception]#
    

    diff测试日志无差异

    [root@iZ285ma471jZ exception]# diff /tmp/1.log /tmp/2.log
    [root@iZ285ma471jZ exception]# wc -l /tmp/1.log  /tmp/2.log
      190238 /tmp/1.log
      190238 /tmp/2.log
      380476 总用量
    

    image

  • 相关阅读:
    [Algorithm] Universal Value Tree Problem
    [HTML5] Using the focus event to improve navigation accessibility (nextElementSibling)
    [Javascript] Coding interview problem: Scheduler functional way
    [Algorithm] Tree: Lowest Common Ancestor
    [NPM] Execute Code from a Remote GitHub Branch with npx
    hdu 4740
    通过网页实现软件的布局
    STL 统计vector容器中指定对象元素出现的次数:count()与count_if()算法
    善待自己生存的空间
    青春散场
  • 原文地址:https://www.cnblogs.com/junmo/p/5668022.html
Copyright © 2011-2022 走看看