2013-03-28 34 views
4

首先,我在服务器上安装了xCache,我的服务器上有很多xCache,但在这几天之后,除了在apache错误日志中出现此错误的空白页面, :APC和子pid XXXXX退出信号分段错误

child pid XXXXX exit signal Segmentation fault 

据我所知,这意味着某种内存损坏。

所以我从php.ini中删除了xCache并安装了APC。但现在情况更糟。一小时或更少/更多的服务器变得无响应之后。我可以清楚地看到,在我的网站的服务器状态下,W模式下有很多连接。他们没有任何共同之处。其中一些来自Joomla(第一页),一些来自vBulletin(论坛),另一些则来自其他自定义代码。 如果我让他有更多的时间,我将要在Apache的错误日志中的错误:

Server reached MaxClients setting, consider raising the MaxClients setting 

Apache是​​在mod_php,并且和mod_ruid2模式。

这里是服务器的状态结果时忌用:

Server uptime: 52 minutes 57 seconds 
Total accesses: 31025 - Total Traffic: 279.0 MB 
CPU Usage: u418.14 s64.28 cu0 cs0 - 15.2% CPU load 
9.77 requests/sec - 89.9 kB/second - 9.2 kB/request 
398 requests currently being processed, 27 idle workers 

WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WWWWWWWWWWWWWWWWWWWWWWWWW....................................... 
WW___WW_WW_W_WWW__WWWW_W_....................................... 
_W___W___WW_W_W_W_W______....................................... 

这是错误日志了XCache(很多这些行):

[Thu Mar 28 09:50:38 2013] [notice] child pid 1607 exit signal Aborted (6) 
httpd: /usr/src/xcache-2.0.0/utils.c:589: xc_sandbox_error_cb: Assertion `sandbox != ((void *)0)' failed. 
[Thu Mar 28 09:51:57 2013] [notice] child pid 1643 exit signal Aborted (6) 
httpd: /usr/src/xcache-2.0.0/utils.c:589: xc_sandbox_error_cb: Assertion `sandbox != ((void *)0)' failed. 
[Thu Mar 28 09:52:32 2013] [notice] child pid 1724 exit signal Aborted (6) 
httpd: /usr/src/xcache-2.0.0/utils.c:589: xc_sandbox_error_cb: Assertion `sandbox != ((void *)0)' failed. 
[Thu Mar 28 09:55:21 2013] [notice] child pid 1672 exit signal Aborted (6) 
httpd: /usr/src/xcache-2.0.0/utils.c:589: xc_sandbox_error_cb: Assertion `sandbox != ((void *)0)' failed. 
[Thu Mar 28 09:55:56 2013] [notice] child pid 1471 exit signal Aborted (6) 
httpd: /usr/src/xcache-2.0.0/utils.c:589: xc_sandbox_error_cb: Assertion `sandbox != ((void *)0)' failed. 
[Thu Mar 28 09:56:49 2013] [notice] child pid 1753 exit signal Aborted (6) 
[Thu Mar 28 09:58:29 2013] [notice] child pid 1810 exit signal Segmentation fault (11) 
[Thu Mar 28 09:58:29 2013] [notice] child pid 1877 exit signal Segmentation fault (11) 
httpd: /usr/src/xcache-2.0.0/utils.c:589: xc_sandbox_error_cb: Assertion `sandbox != ((void *)0)' failed. 
[Thu Mar 28 10:01:34 2013] [notice] child pid 1844 exit signal Segmentation fault (11) 
[Thu Mar 28 10:01:34 2013] [notice] child pid 1913 exit signal Aborted (6) 
[Thu Mar 28 10:01:34 2013] [notice] child pid 1941 exit signal Segmentation fault (11) 
[Thu Mar 28 10:01:36 2013] [notice] child pid 2007 exit signal Segmentation fault (11) 
[Thu Mar 28 10:01:37 2013] [notice] child pid 2035 exit signal Segmentation fault (11) 
[Thu Mar 28 10:01:37 2013] [notice] child pid 2036 exit signal Segmentation fault (11) 

错误日志中的APC达到最大客户端之前(从一个重启其他重启):

[Thu Mar 28 19:17:10 2013] [notice] Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips DAV/2 PHP/5.2.17 configured -- resuming normal operations 
[Thu Mar 28 19:21:40 2013] [notice] child pid 1356 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:41 2013] [notice] child pid 1520 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:42 2013] [notice] child pid 1330 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:42 2013] [notice] child pid 1518 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:46 2013] [notice] child pid 1967 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:46 2013] [notice] child pid 1968 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:49 2013] [notice] child pid 1939 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:50 2013] [notice] child pid 2034 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:51 2013] [notice] child pid 2062 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:57 2013] [notice] child pid 2091 exit signal Segmentation fault (11) 
[Thu Mar 28 19:22:58 2013] [notice] child pid 2090 exit signal Segmentation fault (11) 
[Thu Mar 28 19:25:34 2013] [notice] caught SIGTERM, shutting down 
[Thu Mar 28 19:25:37 2013] [notice] SSL FIPS mode disabled 
[Thu Mar 28 19:25:37 2013] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!? 
[Thu Mar 28 19:25:37 2013] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366) 
[Thu Mar 28 19:25:37 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) 
[Thu Mar 28 19:25:38 2013] [notice] SSL FIPS mode disabled 
[Thu Mar 28 19:25:38 2013] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!? 
[Thu Mar 28 19:25:38 2013] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366) 
[Thu Mar 28 19:25:38 2013] [notice] Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips DAV/2 PHP/5.2.17 configured -- resuming normal operations 

小从PHP信息:

System Linux xxx.xxxxx.com 2.6.32-358.0.1.el6.x86_64 #1 SMP Wed Feb 27 06:06:45 UTC 2013 x86_64 
Build Date Mar 17 2013 12:55:14 
Configure Command './configure' '--with-apxs2' '--with-curl=/usr/local/lib' '--with-gd' '--with-ttf' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr' '--with-pcre-regex=/usr/local' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-xsl' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-magic-quotes' '--enable-safe-mode' '--enable-soap' '--enable-sockets' '--enable-mbstring' '--enable-zip' '--enable-wddx' 
Server API Apache 2.0 Handler 
Virtual Directory Support enabled 
Configuration File (php.ini) Path /usr/local/lib 
Loaded Configuration File /usr/local/lib/php.ini 
Scan this dir for additional .ini files  (none) 
additional .ini files parsed (none) 
PHP API  20041225 
PHP Extension 20060613 
Zend Extension 220060519 
Debug Build  no 
Thread Safety enabled 
Zend Memory Manager  enabled 
IPv6 Support enabled 
Registered PHP Streams https, ftps, compress.zlib, php, file, data, http, ftp, zip 
Registered Stream Socket Transports  tcp, udp, unix, udg, ssl, sslv3, sslv2, tls 
Registered Stream Filters zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed 

APC设置:

enabled 
Version  3.1.13 
APC Debugging Disabled 
MMAP Support Enabled 
MMAP File Mask no value 
Locking type pthread read/write Locks 
Serialization Support php 
Revision $Revision: 327136 $ 
Build Date Mar 28 2013 12:40:18 

腓-v:

PHP 5.2.17 (cli) (built: Mar 17 2013 12:55:24) 
Copyright (c) 1997-2010 The PHP Group 
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies 

的httpd -V:

Server version: Apache/2.2.24 (Unix) 
Server built: Mar 10 2013 09:18:00 
Server's Module Magic Number: 20051115:31 
Server loaded: APR 1.4.6, APR-Util 1.4.1 
Compiled using: APR 1.4.6, APR-Util 1.4.1 
Architecture: 64-bit 
Server MPM:  Worker 
    threaded:  yes (fixed thread count) 
    forked:  yes (variable process count) 
Server compiled with.... 
-D APACHE_MPM_DIR="server/mpm/worker" 
-D APR_HAS_SENDFILE 
-D APR_HAS_MMAP 
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) 
-D APR_USE_SYSVSEM_SERIALIZE 
-D APR_USE_PTHREAD_SERIALIZE 
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT 
-D APR_HAS_OTHER_CHILD 
-D AP_HAVE_RELIABLE_PIPED_LOGS 
-D DYNAMIC_MODULE_LIMIT=128 
-D HTTPD_ROOT="/etc/httpd" 
-D SUEXEC_BIN="/usr/sbin/suexec" 
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status" 
-D DEFAULT_ERRORLOG="logs/error_log" 
-D AP_TYPES_CONFIG_FILE="conf/mime.types" 
-D SERVER_CONFIG_FILE="conf/httpd.conf" 

任何想法?我将奖励50 :)

+0

我没有一个确切的想法是什么导致问题,但有一些事情我会尝试。移动到快速cgi配置的PHP来隔离它从Apache(这可能意味着你需要移动到PHP 5.3.x然而)。如果你不能升级php,你可以尝试一个常规的cgi配置。 – datasage

+0

我在CGI月前。表现非常糟糕。很坏。没有办法使用操作码缓存!所以我搬到了mod_php。我不喜欢去同一个地方:),但是非常感谢。 –

+0

fcgi比mod_php和cgi都好。但它唯一的支持,无需补丁在PHP 5.3.3及以上。你仍然可以在php-fpm下找到早期版本的补丁。 – datasage

回答

3

从服务器状态页的外观来看,您尝试使用线程化Apache MPM将PHP作为mod_php运行。许多PHP扩展,可能包括APC和Xcache,都不是线程安全的。因此,它们会在负载下频繁崩溃。

您需要将Apache切换到prefork MPM,或者将PHP作为CGI或FastCGI运行。

+0

出于兴趣,是什么让你得出这个结论的线索?我甚至认为pre-fork会谈到“工作人员”...... – IMSoP

+0

如果你是对的,虽然它看起来像[它与mod_ruid2不兼容](http://docs.cpanel.net/twiki/bin/view/EasyApache3/ModRuid2) – IMSoP

+2

线索是员工在状态页面上显示的方式。 Prefork工作人员在整个页面中都显示出来,线程化的MPM只能跨过一半。 – duskwuff

相关问题