<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                **一.Nginx進程與線程模式:** 1.進程線程模式:主進程->多Worker工作進程(Cpu核數)->單線程(默認) 2.內存消耗極低 &emsp; **二.Linux下高并發打開文件數:** 1.查看 ``` ulimit -n 1024 ``` 2.設置 ``` vi /etc/security/limits.conf * soft nofile 65535 * hard nofile 65535 ``` 3.重啟生效 ``` init 6 ``` &emsp; **三.Nginx配置參考:** 1.worker_processes 2; nginx運行工作進程個數,一般設置cpu的核心, ``` 如:worker_processes 2。 cat /proc/cpuinfo |grep processor命令可查看核數 ``` &emsp; 2.worker_cpu_affinity 0001 0010; 運行CPU親和力,與worker_processes對應,如:```worker_cpu_affinity 0001 0010```。 &emsp; 3.worker_rlimit_nofile 65535; Nginx最多可以打開文件數,與ulimit -n保持一致,如:```worker_rlimit_nofile 65535```。 &emsp; 4.events 事件處理模型。 &emsp; 5.use epoll; epoll是linux2.6內核的一個新的系統調用,epoll在設計之初,就是為了替代select, poll線性復雜度的模型,nginx采用邊沿觸發。 &emsp; 6.worker_connections 65535; 是單個worker進程允許客戶端最大連接數,這個數值一般根據服務器性能和內存來制定,實際最大值就是worker進程數乘以work_connections,實際我們填入一個65535,足夠了。 &emsp; 7.keepalived_timeout 60; 客戶端連接保持會話超時時間,超過這個時間,服務器斷開這個鏈接。 &emsp; 8.keepalive_requests 10240; 參數限制了一個HTTP長連接最多可以處理完成的最大請求數, 默認是100。當連接處理完成的請求數達到最大請求數后,將關閉連接。 &emsp; **四.Stub_status測試** 1.開啟Stub_status模塊: ``` /usr/local/nginx/sbin/nginx -V ``` 有```--with-http_stub_status_module```說明已經開啟該模塊 &emsp; 2.Stub_status模塊使用: ``` location /status { stub_status; } ``` &emsp; 3.結果分析: 1).Active connections: 2 ``` The current number of active client connections including Waiting connections. ``` 當前活躍連接數。 2)server accepts handled requests 131 131 397 ``` accepts(The total number of accepted client connections) ``` 接受的客戶端連接的總數。 ``` handled(The total number of handled connections) ``` 處理的連接總數。 ``` requests(The total number of client requests) ``` 客戶端請求的總數。 &emsp; 4.Reading: 0 Writing: 1 Waiting: 1 ``` Reading:The current number of connections where nginx is reading the request header. ``` nginx正在讀取請求頭的當前連接數。 ``` Writing:The current number of connections where nginx is writing the response back to the client. ``` nginx將響應寫回客戶端的當前連接數。 ``` Waiting:The current number of idle client connections waiting for a request. ``` 等待請求的當前空閑客戶端連接數。 &emsp; 4.ab壓力測試 ``` #cmder,ab在win下上限是20000 ab -n10 -c10 http://bbs.linux.com/index.html ab -n1000 -c1000 http://bbs.linux.com/index.html ab -n10000 -c10000 http://bbs.linux.com/index.html ``` &emsp; ### **系統的學習PHP** 關注:PHP自學中心,回復相應的關鍵詞,領取以下視頻教程 **PHP高級實戰教程全集** 公眾號里回復:20190625 &emsp; #### **還有其他的教程的關鍵詞,請關注公眾號查看每天分享的文章教程的頭部** ![](https://img.kancloud.cn/96/af/96af322d2cdc53d3fbbe981affa60c7f_150x150.jpg)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看