久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      nginx與php的兩種通信方式是什么

      nginx與php的兩種通信方式是什么

      Nginx與PHP的兩種通信方式:unix socket和tcp socket

      (推薦教程:nginx教程)

      1、兩者Nginx配置

      unix socket

      需要在nginx配置文件中填寫php-fpm運行的pid文件地址。

      location ~ .php$ {     include fastcgi_params;     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;;     fastcgi_pass unix:/var/run/php5-fpm.sock;     fastcgi_index index.php; }

      tcp socket

      需要在nginx配置文件中填寫php-fpm運行的ip地址和端口號。

      location ~ .php$ {     include fastcgi_params;     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;;     fastcgi_pass 127.0.0.1:9000;     fastcgi_index index.php; }

      2、比較

      unix socket減少了不必要的tcp開銷,而tcp需要經(jīng)過loopback,還要申請臨時端口和tcp相關(guān)資源。但是,unix socket高并發(fā)時候不穩(wěn)定,連接數(shù)爆發(fā)時,會產(chǎn)生大量的長時緩存,在沒有面向連接協(xié)議的支撐下,大數(shù)據(jù)包可能會直接出錯不返回異常。

      tcp這樣的面向連接的協(xié)議,多少可以保證通信的正確性和完整性。

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號