<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] php版本 Workman4.0:>=php5.4 Workman4.1:>=php7.0 Workman4.2:>=php8.0 Workman5.0,Workman5.1:>=php8.1 GatewayWorker3.1.8: "php": ">=7.0", "workerman/workerman" : "^4.0.30" GatewayWorker4.0.0:"php": ">=7.2","workerman/workerman" : "^4.0.30 || ^5.1" ~~~ composer require workerman/gateway-worker ~~~ [點擊這里下載gateway-的demo(包含workman,gateway-worker,start_gateway.php start_business.php等啟動入口文件)](http://www.workerman.net/download/GatewayWorker.zip) 客戶端與worker進程的關系 ![](https://img.kancloud.cn/28/62/2862bcf1c29f4f2bffaf47d34bb5c93c_800x400.png) 主進程與worker子進程關系 ![](https://img.kancloud.cn/11/ab/11abf49ee9494cd99ba61cd12c0e7af0_725x672.png) ## **安裝前檢查** 檢查是否安裝了pcntl、posix擴展 如果并發連接數大于1024建議安裝event擴展 >[danger]如果業務并發連接數超過1000同時在線,請務必[優化linux內核](https://www.workerman.net/doc/workerman/appendices/kernel-optimization.html),并[安裝event擴展](https://www.workerman.net/doc/workerman/appendices/install-extension.html)。 使用workerman開發**長連接**應用,例如即時通訊、物聯網等,**長連接**應用建議直接使用GatewayWorker框架 ``` php -m ``` [打開禁用的函數](http://www.workerman.net/doc/workerman/faq/disable-function-check.html) ``` curl -Ss https://www.workerman.net/check | php ``` ``` pcntl_alarm,pcntl_wait,proc_open,shell_exec stream_socket_server stream_socket_client pcntl_signal_dispatch pcntl_signal pcntl_alarm pcntl_fork posix_getuid posix_getpwuid posix_kill posix_setsid posix_getpid posix_getpwnam posix_getgrnam posix_getgid posix_setgid posix_initgroups posix_setuid posix_isatty ``` 手動解除 1、運行`php --ini`找到php cli所使用的php.ini文件位置 2、打開php.ini,找到`disable_functions`一項解除對應函數的禁用 腳本解除 執行腳本`curl -Ss https://www.workerman.net/fix | php`以解除禁用 ## **優化linux** [優化Linux內核-workerman手冊](https://www.workerman.net/doc/workerman/appendices/kernel-optimization.html) ### **修改file-max** 查看**系統級別**能夠打開的文件句柄的數量. 這是針對整個OS而言,并不是針對用戶的 ``` cat /proc/sys/fs/file-max ``` **修改**系統級別**能夠打開的文件句柄的數量** 打開文件 /etc/sysctl.conf,增加以下設置 ~~~conf #//該參數設置系統的TIME_WAIT的數量,如果超過默認值則會被立即清除 net.ipv4.tcp_max_tw_buckets = 20000 #//定義了系統中每一個端口最大的監聽隊列的長度,這是個全局的參數 net.core.somaxconn = 65535 #//對于還未獲得對方確認的連接請求,可保存在隊列中的最大數目 net.ipv4.tcp_max_syn_backlog = 262144 #//在每個網絡接口接收數據包的速率比內核處理這些包的速率快時,允許送到隊列的數據包的最大數目 net.core.netdev_max_backlog = 30000 #//此選項會導致處于NAT網絡的客戶端超時,建議為0。Linux從4.12內核開始移除了 tcp_tw_recycle 配置,如果報錯"No such file or directory"請忽略 net.ipv4.tcp_tw_recycle = 0 #//系統所有進程一共可以打開的文件數量 fs.file-max = 6815744 #//防火墻跟蹤表的大小。注意:如果防火墻沒開則會提示error: "net.netfilter.nf_conntrack_max" is an unknown key,忽略即可 net.netfilter.nf_conntrack_max = 2621440 net.ipv4.ip_local_port_range = 10240 65000 ~~~ 運行`sysctl -p`即刻生效。 **說明:** /etc/sysctl.conf 可設置的選項很多,其它選項可以根據自己的環境需要進行設置 ### **Soft open files** **查看Soft open files** 即**進程級別**(單個進程)能夠打開的文件句柄的數量。針對當前`shell`的當前用戶及其啟動的進程的可用文件句柄控制 ``` ulimit -n ``` >[info]如果是1024,就是代表單個進程只能同時最多只能維持1024甚至更少(因為有其它文件的句柄被打開)。如果開啟4個進程維持用戶連接,那么整個應用能夠同時維持的連接數不會超過4\*1024個,也就是說最多只能支持4x1024個用戶在線可以增大這個設置以便服務能夠維持更多的TCP連接 **Soft open files 修改三種方法:** 第一種:在終端直接運行`ulimit -HSn 102400`,然后重啟workerman。 這只是在當前終端有效,退出之后,open files 又變為默認值。 第二種:在`/etc/profile`文件末尾添加一行`ulimit -HSn 102400`,這樣每次登錄終端時,都會自動執行。更改后需要重啟workerman。 第三種:令修改open files的數值永久生效,則必須修改配置文件:`/etc/security/limits.conf`. 在這個文件后加上: ~~~ * soft nofile 1024000 * hard nofile 1024000 root soft nofile 1024000 root hard nofile 1024000 ~~~ 這種方法需要重啟服務器才能生效
                  <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>

                              哎呀哎呀视频在线观看