LNMP可负载20万IP配置
LNMP可负载20万IP配置,自己的服务器配置,当时服务器最高达到了负载20万IP,60W的PV,服务器配置及详细的配置文件 发出来给需要的朋友
服务器配置:4GCPU + 4G内存 +20G SSD + 7M的带宽 (图片不多,一个页面就1、2张图片)
PHP配置:
- [www]
- listen = /tmp/php-cgi.sock
- listen.backlog = -1
- listen.allowed_clients = 127.0.0.1
- listen.owner = www
- listen.group = www
- listen.mode = 0666
- user = www
- group = www
- pm = static
- pm.max_requests = 5000
- pm.max_children = 20
- pm.start_servers = 10
- pm.min_spare_servers = 10
- pm.max_spare_servers = 20
- request_terminate_timeout = 100
- request_slowlog_timeout = 0
- slowlog = var/log/slow.log
MYSQL配置:
- [mysqld]
- port = 3306
- socket = /tmp/mysql.sock
- skip-external-locking
- log-error=/alidata/log/mysql/error.log
- key_buffer_size = 32M
- max_allowed_packet = 2M
- table_open_cache = 64
- sort_buffer_size = 8M
- net_buffer_length = 8K
- read_buffer_size = 2M
- read_rnd_buffer_size = 4M
- myisam_sort_buffer_size = 8M
- query_cache_size=64M
- query_cache_type=1
- max_connections=1024
NGNIX配置:
- server
- {
- listen 80;
- #listen [::]:80;
- server_name www.xxx.com xxx.com;
- if ($host = 'xxx.com' ) {
- rewrite ^/(.*)$ http://www.xxx.com/$1 permanent;
- }
- index index.html index.htm index.php default.html default.htm default.php;
- root /alidata/www/xxx;
- include wordpress.conf;
- #error_page 404 /404.html;
- location ~ [^/]\.php(/|$)
- {
- # comment try_files $uri =404; to enable pathinfo
- try_files $uri =404;
- fastcgi_pass unix:/tmp/php-cgi.sock;
- fastcgi_index index.php;
- include fastcgi.conf;
- #include pathinfo.conf;
- }
- location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
- {
- expires 30d;
- access_log off;
- }
- location ~ .*\.(js|css)?$
- {
- expires 12h;
- access_log off;
- }
- access_log off;
- access_log /alidata/server/nginx-1.4.7/logs/access.log;
附件打包下载:20WIPLNMP配置
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · centos安装node18
- · nginx日志按天分割
- · 解决Linux实例磁盘空间满问题
- · centos yum安装Python3.8(史上最简单)
- · linux查看端口占用 netstat -tln|grep 8080
- · 解决jenkins git@github.com: Permission denied (publickey)
- · centos安装chrome+chromedriver
- · 修改FRP默认的http404页面后自行编译
- · k8s查看pod实时日志
- · docker nginx
- · VM VirtualBox 给centos安装增强功能
- · reboot 后 Docker服务及容器自动启动设置