请教下lnmp1.1的问题
刚刚换上新服务器,一直使用的lnmp,换了新服务器后,装的是lnmp1.1,网站发布文章有种奇特的现象,发布不带图片纯文字文章一发就上,带图片的好慢,如果是带一张图片文章,会卡能发上,带两张的能将就,如果是三张那就一定发不上了,而且发布完成后会出现502错误,好像连接被重置了,然后到文章管理里一看,就会刚刚发表的文章,只是会出现两篇同样题目的文章,我网站使用了360网站卫士的,不知道是因为Lnmp哪边优化没搞好,还是跟360有关系,原来用老机时是正常的,
那时环境 用的是lnmp1.0
请求军哥的帮忙。 lnmp 1.0和1.1是一样的
最好是发一下php-fpm的日志看看有没有有用的信息
回复 1# 的帖子
NOTICE: fpm is running, pid 17420NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 17530
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 18866
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 21921
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 21962
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 22163
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 22432
NOTICE: ready to handle connections
WARNING: server reached pm.max_children setting (10), consider raising it
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 33354
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 37109
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 41969
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 43957
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 47038
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 4178
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 4369
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 4555
NOTICE: ready to handle connections
NOTICE: Finishing ...
NOTICE: exiting, bye-bye!
NOTICE: fpm is running, pid 4746
NOTICE: ready to handle connections
日志里好像没什么有用的信息。
回复 1# 的帖子
userwww www;worker_processes auto;
error_log/home/wwwlogs/nginx_error.logcrit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
include mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 20;
client_header_timeout 20;
client_body_timeout 20;
reset_timedout_connection on;
send_timeout 20;
limit_conn_zone $binary_remote_addr zone=addr:5m;
limit_conn addr 100;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length2k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 5;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE .";
open_file_cache max=51200 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
#log format
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80 default;
#listen [::]:80 default ipv6only=on;
return 500;
#error_page 404 /404.html;
location ~ [^/].php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location /nginx_status {
stub_status on;
access_log off;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 12h;
}
access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
}
这是修改后的nginx配置文件,机器 配置是2TB SAS硬盘,内存为16GB, 没有有用的信息,开慢日志看看,置顶帖有说明
回复 1# 的帖子
嗯,我去把慢日志开了,试试,看下有没什么信息提示回复 1# 的帖子
会不会是数据库的原因,我安装的是mariadb,以前lnmp1.0时使用的是mysql,下面是php-fpm.log和slow.log部分错误信息php-fpm.log部分数据
WARNING: child 31261, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (23.613593 sec), logging
NOTICE: child 31261 stopped for tracing
NOTICE: about to trace 31261
ERROR: failed to ptrace(PEEKDATA) pid 31261: Input/output error (5)
NOTICE: finished trace of 31261
WARNING: child 31318, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (24.066801 sec), logging
NOTICE: child 31318 stopped for tracing
NOTICE: about to trace 31318
ERROR: failed to ptrace(PEEKDATA) pid 31318: Input/output error (5)
NOTICE: finished trace of 31318
WARNING: child 31481, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (22.685276 sec), logging
NOTICE: child 31481 stopped for tracing
NOTICE: about to trace 31481
ERROR: failed to ptrace(PEEKDATA) pid 31481: Input/output error (5)
NOTICE: finished trace of 31481
WARNING: child 31379, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (25.220769 sec), logging
NOTICE: child 31379 stopped for tracing
NOTICE: about to trace 31379
ERROR: failed to ptrace(PEEKDATA) pid 31379: Input/output error (5)
NOTICE: finished trace of 31379
下面是slow.log部分错误数据
pid 31444
script_filename = /home/wwwroot/mysite/member/post.php
copy() /home/wwwroot/mysite/include/myartic_function.php:951
get_outpic() /home/wwwroot/mysite/include/mycheck.postarticle.php:92
+++ dump failed
pid 31261
script_filename = /home/wwwroot/mysite/member/post.php
copy() /home/wwwroot/mysite/include/myartic_function.php:951
get_outpic() /home/wwwroot/mysite/include/mycheck.postarticle.php:92
+++ dump failed
pid 31318
script_filename = /home/wwwroot/mysite/member/post.php
copy() /home/wwwroot/mysite/include/myartic_function.php:951
get_outpic() /home/wwwroot/mysite/include/mycheck.postarticle.php:92
+++ dump failed
页:
[1]