VPS侦探论坛

 找回密码
 注册
查看: 6906|回复: 13

总是502 真不知道肿么搞了 有php-fpm日志

[复制链接]
发表于 2015-8-25 14:32:37 | 显示全部楼层 |阅读模式

Aug 25 13:49:29.217972 [NOTICE] fpm_children_make(), line 352: child 1667 (pool default) started
Aug 25 13:49:29.218003 [NOTICE] fpm_event_loop(), line 107: libevent: entering main loop
Aug 25 13:48:28.609035 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Aug 25 13:49:29.174775 [NOTICE] fpm_unix_init_main(), line 284: getrlimit(nofile): max:4096, cur:1024
Aug 25 13:49:29.211723 [NOTICE] fpm_event_init_main(), line 88: libevent: using epoll
Aug 25 13:49:29.211784 [NOTICE] fpm_init(), line 52: fpm is running, pid 1643
Aug 25 13:48:28.609007 [WARNING] fpm_children_bury(), line 215: child 25115 (pool default) exited on signal 15 SIGTERM after 0.008293 seconds from start
Aug 25 13:48:28.608610 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 25115 (pool default)
Aug 25 13:48:28.608616 [NOTICE] fpm_pctl_kill_all(), line 181: 20 children are still alive
Aug 25 13:48:28.608626 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Aug 25 13:48:28.608599 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 25116 (pool default)
Aug 25 13:48:28.607260 [WARNING] fpm_children_bury(), line 215: child 24038 (pool default) exited on signal 15 SIGTERM after 107.758168 seconds from start
Aug 25 13:48:28.607487 [NOTICE] fpm_children_make(), line 352: child 25139 (pool default) started
Aug 25 13:48:28.607498 [NOTICE] fpm_got_signal(), line 56: received SIGTERM
Aug 25 13:48:28.607503 [NOTICE] fpm_pctl(), line 256: switching to 'terminating' state
Aug 25 13:46:40.849106 [NOTICE] fpm_children_make(), line 352: child 24038 (pool default) started
Aug 25 13:46:40.849120 [NOTICE] fpm_event_loop(), line 107: libevent: entering main loop
Aug 25 13:48:28.599742 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Aug 25 13:46:39.794182 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Aug 25 13:46:39.794236 [WARNING] fpm_children_bury(), line 215: child 20344 (pool default) exited on signal 15 SIGTERM after 497.424662 seconds from start
Aug 25 13:46:39.794245 [NOTICE] fpm_pctl_exit(), line 81: exiting, bye-bye!
Aug 25 13:46:40.844240 [NOTICE] fpm_unix_init_main(), line 284: getrlimit(nofile): max:65535, cur:65535
Aug 25 13:46:40.844368 [NOTICE] fpm_event_init_main(), line 88: libevent: using epoll
Aug 25 13:46:40.844394 [NOTICE] fpm_init(), line 52: fpm is running, pid 24018
Aug 25 13:46:39.788148 [WARNING] fpm_children_bury(), line 215: child 20361 (pool default) exited on signal 15 SIGTERM after 497.414494 seconds from start
Aug 25 13:22:35.037027 [WARNING] fpm_stdio_child_said(), line 167: child 13138 (pool default) said into stderr: "Not a JPEG file: starts with 0x47 0x49"


不知道 什么问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-8-25 16:54:25 | 显示全部楼层


按这个日志有经常运行时间很长的程序,可以开慢日志看看是哪个程序文件
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-12-4 11:36:59 | 显示全部楼层

回复 2# 的帖子


军哥我遇到的问题跟他一样,总是502  最后我把php-fpm的设置为static,然后重新设置了
pm = static
pm.max_requests = 500
pm.max_children = 100
pm.start_servers = 90
pm.min_spare_servers = 30
pm.max_spare_servers = 150
rlimit_files = 65535

502倒是不会出现了,但是php-fpm占用的cup很大,请问是怎么回事:机器是8核8G10M带宽,


网站访问量如下
        浏览次数(PV)         独立访客(UV)         IP         新独立访客         访问次数
今日         9003         2608         2733         633         5138
昨日         40069         7728         8765         3986         23226

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-4 21:40:13 | 显示全部楼层

回复 3# 的帖子




用static肯定占用资源要多

看日志都是到/home/wwwroot/www.xxxxx.com/ThinkPHP/Common/runtime.php:237
[0x00007fbe0c6e28a8] +++ dump failed
这个地方可能与这个相关的有关
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-12-10 12:33:40 | 显示全部楼层

回复 4# 的帖子


恩恩谢谢军哥,我还想问一下服务器现在是4核32G100M带宽,在韩国那边,目标用户群主要在国内(额,服务器在韩国其中原因我也不想说了)。核心业务逻辑就是一些数据计算的东西,每天的pv大概在4万。有些客户反应说有时候快的像飞一样,有时候慢的像蜗牛一样,如果排除用户那边网络的原因还有什么其他可能吗?

我从top里看到php-fpm占用的cpu时不时的就飙到100%   我安装了phptrace 查看占用内存多进程号得到下面的结果。
[root@localhost cmdtool]# ./phptrace -p 54691 -s
Memory
usage: 50307224
peak_usage: 89485344
real_usage: 89653248
real_peak_usage: 90439680

Request
method: POST
request_uri: /index.php
request_query: s=/User/Sale/upSave/args/sale_up[7]
request_script: /home/wwwroot/ywlnew.xxxx.com/index.php
request_time: 1449631497.445349

Stack

#1    {eval}() at [/home/wwwroot/ywlnew.xxxx.com/function.php:345]
#2    transform("U[xe6x98x9fxe7xbaxa7xe7xbaxa7xe5x88xab]>=20", array(0), array(2)) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/user.class.php:613]
#3    user->allusers("xe6x8exa8xe8x8dx90", "U[xe6x98x9fxe7xbaxa7xe7xbaxa7xe5x88xab]>=20", ">=2", ">=1") at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/levels.class.php:210]
#4    levels->all("all,xe6x8exa8xe8x8dx90,U[xe6x98x9fxe7xbaxa7xe7xbaxa7xe5x88xab]>=20,>"...) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/levels.class.php:142]
#5    levels->uplv() at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/sale.class.php:112]
#6    sale->runconfirm(array(149), array(27), NULL) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/sale_up.class.php:201]
#7    sale_up->upSave(array(3)) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/Action/User/SaleAction.class.php:491]

#8    SaleAction->upSave() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/App.class.php:132]
#9    call_user_func(array(2)) at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/App.class.php:132]
#10   App::exec() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/App.class.php:159]
#11   App::run() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/Think.class.php:48]
#12   Think::Start() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Common/runtime.php:237]
#13   require"/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Common/runtime.php" at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/ThinkPHP.php:36]
#14   require"/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/ThinkPHP.php" at [/home/wwwroot/ywlnew.xxxx.com/index.php:17]


[root@localhost cmdtool]# ./phptrace -p 60885 -s
Memory
usage: 49960632
peak_usage: 89151576
real_usage: 89391104
real_peak_usage: 90177536

Request
method: POST
request_uri: /index.php
request_query: s=/User/Sale/upSave/args/sale_up[7]
request_script: /home/wwwroot/ywlnew.xxxx.com/index.php
request_time: 1449631777.221308

Stack
#1    transform("U[xe6x98x9fxe7xbaxa7xe7xbaxa7xe5x88xab]>=10", array(0), array(2)) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/user.class.php:613]
#2    user->allusers("xe6x8exa8xe8x8dx90", "U[xe6x98x9fxe7xbaxa7xe7xbaxa7xe5x88xab]>=10", ">=2", ">=1") at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/levels.class.php:210]
#3    levels->all("all,xe6x8exa8xe8x8dx90,U[xe6x98x9fxe7xbaxa7xe7xbaxa7xe5x88xab]>=10,>"...) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/levels.class.php:142]
#4    levels->uplv() at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/sale.class.php:112]
#5    sale->runconfirm(array(149), array(27), NULL) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/DMS/sale_up.class.php:201]
#6    sale_up->upSave(array(3)) at [/home/wwwroot/ywlnew.xxxx.com/DmsAdmin/Lib/Action/User/SaleAction.class.php:491]
#7    SaleAction->upSave() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/App.class.php:132]
#8    call_user_func(array(2)) at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/App.class.php:132]
#9    App::exec() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/App.class.php:159]
#10   App::run() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Lib/Core/Think.class.php:48]
#11   Think::Start() at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Common/runtime.php:237]
#12   require"/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/Common/runtime.php" at [/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/ThinkPHP.php:36]
#13   require"/home/wwwroot/ywlnew.xxxx.com/ThinkPHP/ThinkPHP.php" at [/home/wwwroot/ywlnew.xxxx.com/index.php:17]

有一个朋友建议说是让安装一个xcache,因为现在用的人挺多的,我还没有敢试,请问有什么大的提升作用吗?或者针对我这样时快时慢的问题您有没有什么解决的方法?

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

发表于 2015-12-10 13:24:59 | 显示全部楼层

cpu几个核心都100%的话即使带宽充足也会影响访问

xcache会进行缓存,应该能起到一些作用
发表于 2015-12-10 18:26:54 | 显示全部楼层

回复 6# 的帖子


恩恩好的哥  我夜里给他装上xcache试试,这个安装xcache了之后使用php -v就会报502您那边有什么解决方法吗?附件里是我的cpu使用情况,有时候正常有时候就很高,配置还是之前的那个
pm = static
pm.max_requests = 500
pm.max_children = 100
pm.start_servers = 90
pm.min_spare_servers = 30
pm.max_spare_servers = 150
rlimit_files = 65535
我看其他地方介绍的是如果内存足够大的话pm使用static的,您说我有必要换成静态的吗?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-10 21:42:15 | 显示全部楼层

php -v后502好像是xcache与php 5.4版本的兼容性问题
static要好些吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-12-11 09:33:04 | 显示全部楼层

回复 8# 的帖子


军哥你好,我安装了xcache速度提升了一些,但是诊断的时候出现了
“PHP 编译时错误         警告         至少在编译一个或多个您的 PHP 代码时发生编译错误         编译失败的 PHP 代码是无法缓存的. 这通常意味着您的 PHP 代码有语法错误. 请启用 error_log 调查具体错误原因并修复您的代码. 重启 PHP 前这个警告不会消失”

我在php.ini里配置了
log_errors = On
error_log = "/usr/local/php/var/log/php-error.log"  配置之后php-error.log 里啥也没有记进去     service php-fpm reload重新载入了的,请问这个怎么回事

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

发表于 2015-12-11 13:02:33 | 显示全部楼层

回复 9# 的帖子




按他这里面的提示可能是php代码语法错误
发表于 2015-12-11 13:32:54 | 显示全部楼层

回复 10# 的帖子


恩恩对  是语法错误  编译的有问题  但是我开启了php的错误日志怎么什么也没有记录进去呢?之前代码也不是我写的 所以还是比较困惑 不知道从哪里找问题
发表于 2015-12-11 14:04:43 | 显示全部楼层

回复 11# 的帖子


这个错误日志需要在php-fpm.conf里设置,加上catch_workers_output = yes,错误信息就会记录到php-fpm里error_log设置的文件里

或php-fpm.conf里加上
php_admin_value[error_log] = /usr/local/php/var/log/php-error.log
php_admin_flag[log_errors] = on

上述两种方法都行,重启php-fpm生效
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-12-12 02:12:05 | 显示全部楼层

回复 12# 的帖子

恩恩好的  我试试  谢谢军哥
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-14 19:14:19 | 显示全部楼层

回复 12# 的帖子

军哥我们的问题还是没有解决,网站有时候打开很快,有时候打开很慢,我们能不能找您有偿的解决一下,今天客户那边刚开完会,明天说是访问量会更大,您看看能行吗?我的qq是983735268

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 12:48 , Processed in 0.031289 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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