VPS侦探论坛

 找回密码
 注册
查看: 7791|回复: 7

军哥,麻烦看看这个问题咋解决。

[复制链接]
发表于 2014-6-1 23:25:34 | 显示全部楼层 |阅读模式

网站打开正常,ocp.php看了也正常,有击中,这个问题跟opcache有关的。看了 php-fpm.log 日志。而且是刚刚重启好 php-fpm ,日志提示准备握手马上就会出下面的这些警告。

[01-Jun-2014 22:55:22] NOTICE: using inherited socket fd=8, "/tmp/php-cgi.sock"
[01-Jun-2014 22:55:22] NOTICE: fpm is running, pid 3452
[01-Jun-2014 22:55:22] NOTICE: ready to handle connections
[01-Jun-2014 22:55:23] WARNING: [pool www] child 3453 exited on signal 11 (SIGSEGV) after 1.013509 seconds from start
[01-Jun-2014 22:55:23] NOTICE: [pool www] child 3454 started
[01-Jun-2014 22:55:24] WARNING: [pool www] child 3454 exited on signal 11 (SIGSEGV) after 1.005096 seconds from start
[01-Jun-2014 22:55:24] NOTICE: [pool www] child 3455 started
[01-Jun-2014 22:55:25] WARNING: [pool www] child 3455 exited on signal 11 (SIGSEGV) after 1.004855 seconds from start
……
中间略去一万个字……
……

[01-Jun-2014 23:16:00] NOTICE: [pool www] child 4358 started
[01-Jun-2014 23:16:03] WARNING: [pool www] child 4358 exited on signal 6 (SIGABRT) after 3.010518 seconds from start
[01-Jun-2014 23:16:03] NOTICE: [pool www] child 4359 started
[01-Jun-2014 23:16:06] WARNING: [pool www] child 4359 exited on signal 6 (SIGABRT) after 3.352217 seconds from start
[01-Jun-2014 23:16:06] NOTICE: [pool www] child 4360 started
[01-Jun-2014 23:16:09] WARNING: [pool www] child 4360 exited on signal 6 (SIGABRT) after 3.008839 seconds from start
[01-Jun-2014 23:16:09] NOTICE: [pool www] child 4361 started
……
未完待续,略NNNNN个字……


全是这样的,不断的在刷新。然后我如果在 php.ini 里面将 opcache 关闭,重启php后,就不会有上面的这些错误了。确定是因opcache引发的问题。

首先我查了slow.log,无内容。
然后我将 php-fpm 工作进程设置成一个。
执行
kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
ps -aux | grep php-fpm

获得进程数时,

strace -p 4250 当时因为php-fpm工作进程在开启,进程数都不断的在刷新。获得下面数据,麻烦军哥看看到底哪里出问题了。


Process 4250 attached - interrupt to quit
restart_syscall(<... resuming interrupted call ...>) = 0
open("/proc/stat", O_RDONLY)            = 5
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(5, "cpu  5394 0 2157 1556612 602 1 5"..., 8192) = 388
read(5, "", 8192)                       = 0
read(5, "", 8192)                       = 0
close(5)                                = 0
open("/proc/cpuinfo", O_RDONLY)         = 5
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(5, "processor\t: 0\nvendor_id\t: Genuin"..., 8192) = 1486
read(5, "", 8192)                       = 0
read(5, "", 8192)                       = 0
close(5)                                = 0
open("/proc/uptime", O_RDONLY)          = 5
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(5, "7839.33 15593.73\n", 8192)     = 17
read(5, "", 8192)                       = 0
read(5, "", 8192)                       = 0
close(5)                                = 0
open("/proc/meminfo", O_RDONLY)         = 5
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(5, "MemTotal:        2040896 kB\nMemF"..., 8192) = 1014
read(5, "", 8192)                       = 0
read(5, "", 8192)                       = 0
close(5)                                = 0
open("/proc/loadavg", O_RDONLY)         = 5
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(5, "0.00 0.01 0.05 1/108 4251\n", 8192) = 26
read(5, "", 8192)                       = 0
read(5, "", 8192)                       = 0
close(5)                                = 0
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
writev(2, [{"*** glibc detected *** ", 23}, {"php-fpm: pool www", 17}, {": ", 2}, {"free(): invalid pointer", 23}, {": 0x", 4}, {"00007f39add26848", 16}, {" ***\n", 5}], 7) = 90
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39add46000
open("/etc/ld.so.cache", O_RDONLY)      = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=30530, ...}) = 0
mmap(NULL, 30530, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7f39adb95000
close(5)                                = 0
open("/lib64/libgcc_s.so.1", O_RDONLY)  = 5
read(5, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20)\0\0\0\0\0\0"..., 832) = 832
fstat(5, {st_mode=S_IFREG|0755, st_size=90880, ...}) = 0
mmap(NULL, 2186584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0x7f399912e000
mprotect(0x7f3999144000, 2093056, PROT_NONE) = 0
mmap(0x7f3999343000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x15000) = 0x7f3999343000
close(5)                                = 0
munmap(0x7f39adb95000, 30530)           = 0
futex(0x7f39ab617620, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f3999343af0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2, "======= Backtrace: =========\n", 29) = 29
writev(2, [{"/lib64/libc.so.6", 16}, {"(", 1}, {"+0x", 3}, {"76166", 5}, {")", 1}, {"[0x", 3}, {"7f39ab2fb166", 12}, {"]\n", 2}], 8) = 43
writev(2, [{"php-fpm: pool www", 17}, {"(", 1}, {"zend_hash_destroy", 17}, {"+0x", 3}, {"20", 2}, {")", 1}, {"[0x", 3}, {"7e2410", 6}, {"]\n", 2}], 9) = 52
writev(2, [{"php-fpm: pool www", 17}, {"(", 1}, {"_zval_dtor_func", 15}, {"+0x", 3}, {"8b", 2}, {")", 1}, {"[0x", 3}, {"7d40bb", 6}, {"]\n", 2}], 9) = 50
writev(2, [{"php-fpm: pool www", 17}, {"[0x", 3}, {"803c6a", 6}, {"]\n", 2}], 4) = 28
writev(2, [{"php-fpm: pool www", 17}, {"(", 1}, {"execute_ex", 10}, {"+0x", 3}, {"40", 2}, {")", 1}, {"[0x", 3}, {"848660", 6}, {"]\n", 2}], 9) = 45
writev(2, [{"php-fpm: pool www", 17}, {"(", 1}, {"zend_execute_scripts", 20}, {"+0x", 3}, {"199", 3}, {")", 1}, {"[0x", 3}, {"7d43e9", 6}, {"]\n", 2}], 9) = 56
writev(2, [{"php-fpm: pool www", 17}, {"(", 1}, {"php_execute_script", 18}, {"+0x", 3}, {"1a9", 3}, {")", 1}, {"[0x", 3}, {"7760d9", 6}, {"]\n", 2}], 9) = 54
writev(2, [{"php-fpm: pool www", 17}, {"[0x", 3}, {"88d5e2", 6}, {"]\n", 2}], 4) = 28
writev(2, [{"/lib64/libc.so.6", 16}, {"(", 1}, {"__libc_start_main", 17}, {"+0x", 3}, {"fd", 2}, {")", 1}, {"[0x", 3}, {"7f39ab2a3d1d", 12}, {"]\n", 2}], 9) = 57
writev(2, [{"php-fpm: pool www", 17}, {"[0x", 3}, {"42e9b9", 6}, {"]\n", 2}], 4) = 28
write(2, "======= Memory map: ========\n", 29) = 29
open("/proc/self/maps", O_RDONLY)       = 5
read(5, "00400000-00b02000 r-xp 00000000 "..., 1024) = 1024
write(2, "00400000-00b02000 r-xp 00000000 "..., 1024) = 1024
read(5, "9a1548000-7f39a1549000 r--p 0000"..., 1024) = 1024
write(2, "9a1548000-7f39a1549000 r--p 0000"..., 1024) = 1024
read(5, "000000 ca:00 24743              "..., 1024) = 1024
write(2, "000000 ca:00 24743              "..., 1024) = 1024
read(5, "rw-p 00016000 ca:00 573962      "..., 1024) = 1024
write(2, "rw-p 00016000 ca:00 573962      "..., 1024) = 1024
read(5, "000 ca:00 24758                 "..., 1024) = 1024
write(2, "000 ca:00 24758                 "..., 1024) = 1024
read(5, "c000-7f39a89ab000 ---p 00019000 "..., 1024) = 1024
write(2, "c000-7f39a89ab000 ---p 00019000 "..., 1024) = 1024
read(5, "9a8de4000 rw-p 00000000 00:00 0 "..., 1024) = 1024
write(2, "9a8de4000 rw-p 00000000 00:00 0 "..., 1024) = 1024
read(5, "r--p 00002000 ca:00 24749       "..., 1024) = 1024
write(2, "r--p 00002000 ca:00 24749       "..., 1024) = 1024
read(5, "a:00 806                        "..., 1024) = 1024
write(2, "a:00 806                        "..., 1024) = 1024
read(5, "                     /lib64/libc"..., 1024) = 1024
write(2, "                     /lib64/libc"..., 1024) = 1024
read(5, "                  /lib64/libgssa"..., 1024) = 1024
write(2, "                  /lib64/libgssa"..., 1024) = 1024
read(5, "/lib64/libidn.so.11.6.1\n7f39aabd"..., 1024) = 1024
write(2, "/lib64/libidn.so.11.6.1\n7f39aabd"..., 1024) = 1024
read(5, "0016000 ca:00 24653             "..., 1024) = 1024
write(2, "0016000 ca:00 24653             "..., 1024) = 1024
read(5, "cal/lib/libiconv.so.2.5.1\n7f39ab"..., 1024) = 1024
write(2, "cal/lib/libiconv.so.2.5.1\n7f39ab"..., 1024) = 1024
read(5, "7f39ac1df000 r--p 00061000 ca:00"..., 1024) = 1024
write(2, "7f39ac1df000 r--p 00061000 ca:00"..., 1024) = 1024
read(5, "                   /lib64/libdl-"..., 1024) = 1024
write(2, "                   /lib64/libdl-"..., 1024) = 1024
read(5, "-xp 00000000 ca:00 163880       "..., 1024) = 1024
write(2, "-xp 00000000 ca:00 163880       "..., 1024) = 1024
read(5, "ad4dd000 r-xp 00000000 ca:00 246"..., 1024) = 1024
write(2, "ad4dd000 r-xp 00000000 ca:00 246"..., 1024) = 1024
read(5, "o\n7f39adafc000-7f39adafd000 rw-p"..., 1024) = 1024
write(2, "o\n7f39adafc000-7f39adafd000 rw-p"..., 1024) = 1024
read(5, "             [vsyscall]\n", 1024) = 24
write(2, "             [vsyscall]\n", 24) = 24
read(5, "", 1024)                       = 0
close(5)                                = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(4250, 4250, SIGABRT)             = 0
--- SIGABRT (Aborted) @ 0 (0) ---
Process 4250 detached

[ 本帖最后由 ldlbf 于 2014-6-1 23:31 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2014-6-2 00:26:12 | 显示全部楼层


军哥,SORRY,我错了,我开了N个窗口,其中有一个探针的窗口忘记关了,开太多了,看不到了,也不记得了。探针一直在刷新,所以一直都出现上述错误,晕死了。现在回过头来看 strace 才明白过来。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-6-2 00:45:09 | 显示全部楼层

晕死,现在 vi 用多了,在论坛进到页面里来想退到外面去,都不用鼠标了,习惯性的  :q
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-6-2 10:25:59 | 显示全部楼层



slowlog是设置的php-fpm.log里面的那个after后的时间吗
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-6-2 10:30:36 | 显示全部楼层

原帖由 licess 于 2014-6-2 10:25 发表
slowlog是设置的php-fpm.log里面的那个after后的时间吗

嗯。我的slow.log设置的是1s,不是默认的10s,也没有记录。
因为设置10s,slow.log 里面无记录,所以设置成1s想看看slow.log里面有没有东西,也都是啥都没有。

[ 本帖最后由 ldlbf 于 2014-6-2 15:28 编辑 ]

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

发表于 2014-6-2 21:08:19 | 显示全部楼层

php-fpm.log里面有而slow.log里面没有可以看一下slow.log的权限
 楼主| 发表于 2014-6-2 22:36:59 | 显示全部楼层

原帖由 licess 于 2014-6-2 21:08 发表
php-fpm.log里面有而slow.log里面没有可以看一下slow.log的权限

有的呀。和 php-fpm.log 一样的呢。

-rw------- 1 root root  115 Jun  2 00:41 php-fpm.log
-rw------- 1 root root    0 Jun  2 00:16 slow.log


难不成要改成 666 ?我之前也是担心没权限,还将 slow.log 和 php-fpm.log 都删除了。然后重启 php 后,两个文件都是可以自动创建,但仅仅php-fpm.log会马上记录,slow.php 里无记录。按道理来说,只要开启了 slow ,php-fpm.log 有记录的话,slow.log 应该有东西才是。而且我已经设的1s了。
开虚拟主机下面的网站就正常,php-fpm.log 里无记录,开探针就报这些错误,php-fpm.log里有记录,slow.log 里无记录。关了 opcache ,重启 php 开探针 php-fpm.log 里无记录,slow.log 里无记录。

[ 本帖最后由 ldlbf 于 2014-6-2 23:03 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-6-3 15:10:29 | 显示全部楼层

哪应该就与opcache有关,就先别用这个了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-30 15:44 , Processed in 0.028315 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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