nginx与php-fpm服务器配置,实现高并发

说明:高性能服务器通过配置nginx和php-fpm,代替docker容器技术,实现请求服务高并发处理。

主要说明配置主要参数,以及想过解释。

nginx主要配置

通过nginx实现php-fpm服务器负载,用户访问服务时,将请求分配给不同的php-fpm服务器。

# nginx启动worker进程数
worker_processes auto;

#Changes the limit on the maximum number of open files (RLIMIT_NOFILE) for worker processes.定义进程可以打开的最大文件数,与linux内核相同即可
worker_rlimit_nofile 65535;
# 定义worker进程的优先级,数字越小优先级越高 [-20,19]
worker_priority -20;

events{
    # The maximum number of connections that each worker process can handle simultaneously.每个进程同时处理的连接数
    worker_connections 10240;
    # If multi_accept is disabled, a worker process will accept one new connection at a time. Otherwise, a worker process will accept all new connections at a time.
    multi_accept on;
}

http{
    access_log /var/log/nginx/access.log main buffer=32k;
    
    # Nginx将使用sendfile内核来调用处理文件传递
  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值