VPS侦探论坛

 找回密码
 注册
查看: 6157|回复: 6

请教下lnmp1.1的问题

[复制链接]
发表于 2014-11-20 20:40:38 | 显示全部楼层 |阅读模式

刚刚换上新服务器,一直使用的lnmp,换了新服务器后,装的是lnmp1.1,网站发布文章有种奇特的现象,发布不带图片纯文字文章一发就上,带图片的好慢,如果是带一张图片文章,会卡能发上,带两张的能将就,如果是三张那就一定发不上了,而且发布完成后会出现502错误,好像连接被重置了,然后到文章管理里一看,
就会刚刚发表的文章,只是会出现两篇同样题目的文章,我网站使用了360网站卫士的,不知道是因为Lnmp哪边优化没搞好,还是跟360有关系,原来用老机时是正常的,
那时环境 用的是lnmp1.0
请求军哥的帮忙。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-11-21 21:27:44 | 显示全部楼层


lnmp 1.0和1.1是一样的

最好是发一下php-fpm的日志看看有没有有用的信息
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-11-22 17:18:11 | 显示全部楼层

回复 1# 的帖子


[13-Nov-2014 16:10:40] NOTICE: fpm is running, pid 17420
[13-Nov-2014 16:10:40] NOTICE: ready to handle connections
[13-Nov-2014 16:32:36] NOTICE: Finishing ...
[13-Nov-2014 16:32:36] NOTICE: exiting, bye-bye!
[13-Nov-2014 16:32:41] NOTICE: fpm is running, pid 17530
[13-Nov-2014 16:32:41] NOTICE: ready to handle connections
[13-Nov-2014 17:44:45] NOTICE: Finishing ...
[13-Nov-2014 17:44:45] NOTICE: exiting, bye-bye!
[13-Nov-2014 17:44:46] NOTICE: fpm is running, pid 18866
[13-Nov-2014 17:44:46] NOTICE: ready to handle connections
[14-Nov-2014 13:03:23] NOTICE: Finishing ...
[14-Nov-2014 13:03:23] NOTICE: exiting, bye-bye!
[14-Nov-2014 13:03:24] NOTICE: fpm is running, pid 21921
[14-Nov-2014 13:03:24] NOTICE: ready to handle connections
[14-Nov-2014 13:04:22] NOTICE: Finishing ...
[14-Nov-2014 13:04:22] NOTICE: exiting, bye-bye!
[14-Nov-2014 13:04:23] NOTICE: fpm is running, pid 21962
[14-Nov-2014 13:04:23] NOTICE: ready to handle connections
[14-Nov-2014 13:29:06] NOTICE: Finishing ...
[14-Nov-2014 13:29:06] NOTICE: exiting, bye-bye!
[14-Nov-2014 13:29:07] NOTICE: fpm is running, pid 22163
[14-Nov-2014 13:29:07] NOTICE: ready to handle connections
[14-Nov-2014 13:49:45] NOTICE: Finishing ...
[14-Nov-2014 13:49:45] NOTICE: exiting, bye-bye!
[14-Nov-2014 13:49:46] NOTICE: fpm is running, pid 22432
[14-Nov-2014 13:49:46] NOTICE: ready to handle connections
[14-Nov-2014 13:56:28] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[14-Nov-2014 14:38:48] NOTICE: Finishing ...
[14-Nov-2014 14:38:48] NOTICE: exiting, bye-bye!
[14-Nov-2014 14:38:49] NOTICE: fpm is running, pid 33354
[14-Nov-2014 14:38:49] NOTICE: ready to handle connections
[14-Nov-2014 17:01:54] NOTICE: Finishing ...
[14-Nov-2014 17:01:54] NOTICE: exiting, bye-bye!
[14-Nov-2014 17:01:55] NOTICE: fpm is running, pid 37109
[14-Nov-2014 17:01:55] NOTICE: ready to handle connections
[14-Nov-2014 18:32:41] NOTICE: Finishing ...
[14-Nov-2014 18:32:41] NOTICE: exiting, bye-bye!
[14-Nov-2014 18:32:42] NOTICE: fpm is running, pid 41969
[14-Nov-2014 18:32:42] NOTICE: ready to handle connections
[14-Nov-2014 20:15:40] NOTICE: Finishing ...
[14-Nov-2014 20:15:40] NOTICE: exiting, bye-bye!
[14-Nov-2014 20:15:41] NOTICE: fpm is running, pid 43957
[14-Nov-2014 20:15:41] NOTICE: ready to handle connections
[15-Nov-2014 18:58:16] NOTICE: Finishing ...
[15-Nov-2014 18:58:16] NOTICE: exiting, bye-bye!
[15-Nov-2014 18:58:18] NOTICE: fpm is running, pid 47038
[15-Nov-2014 18:58:18] NOTICE: ready to handle connections
[22-Nov-2014 17:03:33] NOTICE: Finishing ...
[22-Nov-2014 17:03:33] NOTICE: exiting, bye-bye!
[22-Nov-2014 17:03:34] NOTICE: fpm is running, pid 4178
[22-Nov-2014 17:03:34] NOTICE: ready to handle connections
[22-Nov-2014 17:05:08] NOTICE: Finishing ...
[22-Nov-2014 17:05:08] NOTICE: exiting, bye-bye!
[22-Nov-2014 17:05:09] NOTICE: fpm is running, pid 4369
[22-Nov-2014 17:05:09] NOTICE: ready to handle connections
[22-Nov-2014 17:05:57] NOTICE: Finishing ...
[22-Nov-2014 17:05:57] NOTICE: exiting, bye-bye!
[22-Nov-2014 17:05:58] NOTICE: fpm is running, pid 4555
[22-Nov-2014 17:05:58] NOTICE: ready to handle connections
[22-Nov-2014 17:07:00] NOTICE: Finishing ...
[22-Nov-2014 17:07:01] NOTICE: exiting, bye-bye!
[22-Nov-2014 17:07:02] NOTICE: fpm is running, pid 4746
[22-Nov-2014 17:07:02] NOTICE: ready to handle connections


日志里好像没什么有用的信息。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2014-11-22 17:22:55 | 显示全部楼层

回复 1# 的帖子




user  www www;

worker_processes auto;

error_log  /home/wwwlogs/nginx_error.log  crit;

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_type  application/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_length  2k;
                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 [1-6].";

                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_format  access  '$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_pass  unix:/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.log  access;
        }
include vhost/*.conf;
}



这是修改后的nginx配置文件,机器 配置是2TB SAS硬盘,内存为16GB,
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2014-11-23 08:55:50 | 显示全部楼层

没有有用的信息,开慢日志看看,置顶帖有说明

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2014-11-23 14:24:53 | 显示全部楼层

回复 1# 的帖子


嗯,我去把慢日志开了,试试,看下有没什么信息提示
 楼主| 发表于 2014-11-24 18:10:46 | 显示全部楼层

回复 1# 的帖子


会不会是数据库的原因,我安装的是mariadb,以前lnmp1.0时使用的是mysql,下面是php-fpm.log和slow.log部分错误信息
php-fpm.log部分数据
[24-Nov-2014 17:17:07] WARNING: [pool www] child 31261, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (23.613593 sec), logging
[24-Nov-2014 17:17:07] NOTICE: child 31261 stopped for tracing
[24-Nov-2014 17:17:07] NOTICE: about to trace 31261
[24-Nov-2014 17:17:07] ERROR: failed to ptrace(PEEKDATA) pid 31261: Input/output error (5)
[24-Nov-2014 17:17:07] NOTICE: finished trace of 31261
[24-Nov-2014 17:19:01] WARNING: [pool www] child 31318, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (24.066801 sec), logging
[24-Nov-2014 17:19:01] NOTICE: child 31318 stopped for tracing
[24-Nov-2014 17:19:01] NOTICE: about to trace 31318
[24-Nov-2014 17:19:01] ERROR: failed to ptrace(PEEKDATA) pid 31318: Input/output error (5)
[24-Nov-2014 17:19:01] NOTICE: finished trace of 31318
[24-Nov-2014 17:20:07] WARNING: [pool www] child 31481, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (22.685276 sec), logging
[24-Nov-2014 17:20:07] NOTICE: child 31481 stopped for tracing
[24-Nov-2014 17:20:07] NOTICE: about to trace 31481
[24-Nov-2014 17:20:07] ERROR: failed to ptrace(PEEKDATA) pid 31481: Input/output error (5)
[24-Nov-2014 17:20:07] NOTICE: finished trace of 31481
[24-Nov-2014 17:20:41] WARNING: [pool www] child 31379, script '/home/wwwroot/mysite/member/post.php' (request: "POST /member/post.php") executing too slow (25.220769 sec), logging
[24-Nov-2014 17:20:41] NOTICE: child 31379 stopped for tracing
[24-Nov-2014 17:20:41] NOTICE: about to trace 31379
[24-Nov-2014 17:20:41] ERROR: failed to ptrace(PEEKDATA) pid 31379: Input/output error (5)
[24-Nov-2014 17:20:41] NOTICE: finished trace of 31379


下面是slow.log部分错误数据
[24-Nov-2014 17:14:41]  [pool www] pid 31444
script_filename = /home/wwwroot/mysite/member/post.php
[0x00000000018e3fc0] copy() /home/wwwroot/mysite/include/myartic_function.php:951
[0x00000000018da648] get_outpic() /home/wwwroot/mysite/include/mycheck.postarticle.php:92
[0x00000000018d57a0] +++ dump failed

[24-Nov-2014 17:17:07]  [pool www] pid 31261
script_filename = /home/wwwroot/mysite/member/post.php
[0x0000000001d864b0] copy() /home/wwwroot/mysite/include/myartic_function.php:951
[0x0000000001d7cb38] get_outpic() /home/wwwroot/mysite/include/mycheck.postarticle.php:92
[0x0000000001d77c90] +++ dump failed

[24-Nov-2014 17:19:01]  [pool www] pid 31318
script_filename = /home/wwwroot/mysite/member/post.php
[0x0000000001cbd710] copy() /home/wwwroot/mysite/include/myartic_function.php:951
[0x0000000001cb3d98] get_outpic() /home/wwwroot/mysite/include/mycheck.postarticle.php:92
[0x0000000001caeef0] +++ dump failed
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-4-26 09:12 , Processed in 0.027662 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表