久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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如何進(jìn)行通信的

      nginx和php如何進(jìn)行通信的

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

      1、兩者Nginx配置 (推薦學(xué)習(xí):nginx教程)

      unix socket

      需要在nginx配置文件中填寫php-fpm運(yùn)行的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運(yùn)行的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、兩者比較

      nginx和php如何進(jìn)行通信的

      從上面的圖片可以看,unix socket減少了不必要的tcp開銷,而tcp需要經(jīng)過loopback,還要申請臨時(shí)端口和tcp相關(guān)資源。

      但是,unix socket高并發(fā)時(shí)候不穩(wěn)定,連接數(shù)爆發(fā)時(shí),會(huì)產(chǎn)生大量的長時(shí)緩存,在沒有面向連接協(xié)議的支撐下,大數(shù)據(jù)包可能會(huì)直接出錯(cuò)不返回異常。tcp這樣的面向連接的協(xié)議,多少可以保證通信的正確性和完整性。

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