LNMP 服务器调整日志-2

1.修改 PHP FPM

listen = /run/shm/php-fcgi.socket

pm = static

pm.max_children = 1024

pm.start_servers = 30

pm.min_spare_servers = 25

pm.max_spare_servers = 35

pm.max_requests = 1024

2.Nginx

fastcgi_pass unix:/run/shm/php-fcgi.socket;

3.修改 php.ini

session.save_handler = memcache

session.save_path = “tcp://127.0.0.1:11211”

session.use_cookies = 1

session.use_only_cookies = 0

LNMP 服务器调整日志-1

1.修改打开文件描述符的限制数量

系统:

ulimit -SHn 65535

2.修改 PHP FPM

listen = 127.0.0.1:9000

pm = dynamic

pm.max_children = 1024

pm.start_servers = 30

pm.min_spare_servers = 25

pm.max_spare_servers = 35

pm.max_requests = 1024

3.记录 mysql 的慢查询

long_query_time = 2

4.关闭 x-powered-by 信息

expose_php = Off

5.Nginx

fastcgi_pass 127.0.0.1:9000

 

6. PHP SESSION 相关修改

session.cookie_lifetime = 604800

session.gc_probability = 1

session.gc_divisor = 1000

session.gc_maxlifetime = 604800