日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

nginx php value,PHP+NGINX参数优化

發布時間:2024/9/27 php 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx php value,PHP+NGINX参数优化 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Failed requests: 0

Write errors: 0

Requests per second: 3712.72 [#/sec] (mean)

Time per request: 134.672 [ms] (mean)

Time per request: 0.269 [ms] (mean, across all concurrent requests)

Transfer rate: 732.37 [Kbytes/sec] received

1000并發:

Concurrency Level: 1000

Time taken for tests: 28.385349 seconds

Complete requests: 100000

Failed requests: 0

Write errors: 0

Requests per second: 3522.94 [#/sec] (mean)

Time per request: 283.853 [ms] (mean)

Time per request: 0.284 [ms] (mean, across all concurrent requests)

Transfer rate: 694.94 [Kbytes/sec] received

與1)比較,有大約10%的性能下降

調整fpm的max_request參數為1000,并發1000報錯返回降到200個以下,

Transfer rate在800左右

3. nginx下關于PHP-FPM在高負載下的優化配置

When you running a highload website with PHP-FPM via FastCGI, the following tips may be useful to you : )

1、Compile PHP’s modules as less as possible, the simple the best (fast);

2、Increas PHP FastCGI child number to 100 and even more. Sometime, 200 is OK! ( On 4GB memory server);

3、Using SOCKET PHP FastCGI, and put into /dev/shm on Linux;

注:在php-fpm.cnf里設置/tmp/nginx.socket就可以通過socket連接 FastCGI了,/dev/shm是內存文件系統,放在內存中肯定會快了

4、Increase Linux “max open files”, using the following command (must be root):

# echo ‘ulimit -HSn 65536′ >> /etc/profile

# echo ‘ulimit -HSn 65536 >> /etc/rc.local

# source /etc/profile

注:我是修改/etc/rc.local,加入ulimit -SHn 51200的

5、Increase PHP-FPM open file description rlimit:

# vi /path/to/php-fpm.conf

Find “1024”

Change 1024 to 4096 or higher number.

Restart PHP-FPM.

6、Using PHP code accelerator, e.g eAccelerator, XCache. And set “cache_dir” to /dev/shm on Linux.

本文由51ste.com網友編輯,未經授權,不得轉載使用上述作品盈利;個人轉載,需標明作者及出處。

總結

以上是生活随笔為你收集整理的nginx php value,PHP+NGINX参数优化的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。