as4 apache 經常導致伺服器死機
# top
top - 12:53:38 up 19:32, 6 users, load average: 0.32, 0.28, 0.14
Tasks: 84 total, 1 running, 83 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.8% us, 0.8% sy, 0.0% ni, 98.3% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 2074640k total, 2036252k used, 38388k free, 78860k buffers
Swap: 4192956k total, 0k used, 4192956k free, 1110120k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21542 root 16 0 2804 964 764 R 1 0.0 0:08.83 top
26624 apache 25 0 573m 35m 4356 S 1 1.7 0:04.15 httpd
27156 apache 16 0 573m 35m 4352 S 1 1.7 0:04.08 httpd
26779 apache 16 0 576m 35m 4104 S 0 1.7 0:03.96 httpd
27158 apache 16 0 573m 34m 3972 S 0 1.7 0:04.19 httpd
27217 apache 20 0 573m 35m 4348 S 0 1.7 0:04.13 httpd
27235 apache 20 0 573m 34m 4112 S 0 1.7 0:04.12 httpd
27618 apache 16 0 573m 34m 4104 S 0 1.7 0:04.12 httpd
27620 apache 16 0 573m 34m 3968 S 0 1.7 0:03.85 httpd
27622 apache 16 0 574m 35m 4508 S 0 1.7 0:04.21 httpd
27641 apache 17 0 575m 35m 4112 S 0 1.7 0:04.12 httpd
27671 apache 17 0 574m 35m 4344 S 0 1.7 0:04.17 httpd
1 root 16 0 3004 552 472 S 0 0.0 0:00.75 init
2 root RT 0 0 0 0 S 0 0.0 0:00.01 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:05.33 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.01 ksoftirqd/1
6 root 5 -10 0 0 0 S 0 0.0 0:00.00 events/0
7 root 5 -10 0 0 0 S 0 0.0 0:00.00 events/1
8 root 5 -10 0 0 0 S 0 0.0 0:00.00 khelper
9 root 15 -10 0 0 0 S 0 0.0 0:00.00 kacpid
61 root 5 -10 0 0 0 S 0 0.0 0:00.00 kblockd/0
62 root 5 -10 0 0 0 S 0 0.0 0:00.00 kblockd/1
63 root 15 0 0 0 0 S 0 0.0 0:00.00 khubd
80 root 20 0 0 0 0 S 0 0.0 0:00.00 pdflush
81 root 15 0 0 0 0 S 0 0.0 0:00.03 pdflush
83 root 6 -10 0 0 0 S 0 0.0 0:00.00 aio/0
84 root 5 -10 0 0 0 S 0 0.0 0:00.00 aio/1
82 root 15 0 0 0 0 S 0 0.0 0:00.04 kswapd0
228 root 25 0 0 0 0 S 0 0.0 0:00.00 kseriod
337 root 22 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_0
356 root 15 0 0 0 0 S 0 0.0 0:00.11 kjournald
1576 root 6 -10 3300 460 380 S 0 0.0 0:00.00 udevd
1933 root 6 -10 0 0 0 S 0 0.0 0:00.00 kauditd
2051 root 8 -10 0 0 0 S 0 0.0 0:00.00 kmirrord
2070 root 21 0 0 0 0 S 0 0.0 0:00.00 kjournald
2071 root 15 0 0 0 0 S 0 0.0 0:00.32 kjournald
#
#
# netstat -an | grep -i ":80" | awk '{print $6}' | sort | uniq -c | sort -n
3 LISTEN
9 LAST_ACK
23 CLOSE_WAIT
35 FIN_WAIT1
253 FIN_WAIT2
907 TIME_WAIT
1022 SYN_RECV
2009 ESTABLISHED
請高手幫忙分析一下!每天服務回死幾次機.
《解決方案》
請大家談談高訪問量下的操作系統優化和apache優化如何配置?
《解決方案》
請高手幫忙分析一下啊!我的主要是PHP頁面,加上MYSQL分析來源IP好做統計的;
硬體配置:
DELL 1950:
至強(R)5110雙核處理器1.60GHzX1 2GB內存 73GB硬碟X2
System Linux 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
Build Date Oct 26 2007 17:06:43
Configure Command './configure' '--with-mysql' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-gd' '--with-mysqli' '--with-curl' '--with-curlwrappers'
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
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 php, file, data, http, ftp, gopher, telnet, dict, ldap, https, ftps
Registered Stream Socket Transports tcp, udp, unix, udg
Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*
Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
allow_url_include Off Off
always_populate_raw_post_data On On
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 6135 6135
expose_php On On
extension_dir ./ ./
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/local/lib/php .:/usr/local/lib/php
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value no value
max_execution_time 30 30
max_input_nesting_level 64 64
max_input_time 60 60
memory_limit 128M 128M
open_basedir no value no value
output_buffering 1 1
output_handler no value no value
post_max_size 8M 8M
precision 12 12
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv On On
register_globals On On
register_long_arrays On On
report_memleaks On On
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 5M 5M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.ze1_compatibility_mode Off Off
apache2handler
Apache Version Apache/2.2.6 (Unix) PHP/5.2.4
Apache API Version 20051115
Server Administrator ctest@gmail.com
Hostname:Port test.com:0
User/Group apache(48)/48
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 300 - Keep-Alive: 5
Virtual Server Yes
Server Root /usr/local/apache
Loaded Modules core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_log_config mod_env mod_setenvif worker http_core mod_mime mod_status mod_autoindex mod_asis mod_cgid mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_so mod_php5 mod_bw mod_limitipconn
Directive Local Value Master Value
engine 1 1
last_modified 0 0
xbithack 0 0
Apache Environment
Variable Value
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
HTTP_ACCEPT_LANGUAGE zh-cn
HTTP_UA_CPU x86
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Avant Browser; .NET CLR 1.1.4322)
HTTP_HOST 9.4.12.73
HTTP_CONNECTION Keep-Alive
PATH /usr/bin:/bin
SERVER_SIGNATURE no value
SERVER_SOFTWARE Apache/2.2.6 (Unix) PHP/5.2.4
SERVER_NAME 9.4.12.73
SERVER_ADDR 9.4.12.73
SERVER_PORT 80
REMOTE_ADDR 9.4.12.2
DOCUMENT_ROOT /usr/local/apache/htdocs/web
SERVER_ADMIN ctest@gmail.com
SCRIPT_FILENAME /usr/local/apache/htdocs/web/free.php
REMOTE_PORT 2243
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /free.php
SCRIPT_NAME /free.php
HTTP Headers Information
HTTP Request Headers
HTTP Request GET /free.php HTTP/1.1
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language zh-cn
UA-CPU x86
Accept-Encoding gzip, deflate
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Avant Browser; .NET CLR 1.1.4322)
Host 9.4.12.73
Connection Keep-Alive
HTTP Response Headers
X-Powered-By PHP/5.2.4
ctype
ctype functions enabled
curl
cURL support enabled
cURL Information libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.3 libidn/0.5.6
date
date/time support enabled
"Olson" Timezone Database Version 2007.6
Timezone Database internal
Default timezone Asia/Hong_Kong
Directive Local Value Master Value
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.583333 90.583333
date.sunset_zenith 90.583333 90.583333
date.timezone no value no value
dom
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.16
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
filter
Input Validation and Filtering enabled
Revision $Revision: 1.52.2.39 $
Directive Local Value Master Value
filter.default unsafe_raw unsafe_raw
filter.default_flags no value no value
gd
GD Support enabled
GD Version bundled (2.0.34 compatible)
GIF Read Support enabled
GIF Create Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
hash
hash support enabled
Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
iconv
iconv support enabled
iconv implementation glibc
iconv library version 2.3.4
Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1
json
json support enabled
json version 1.2.1
libxml
libXML support active
libXML Version 2.6.16
libXML streams enabled
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.1.20
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient_r
Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off
mysqli
MysqlI Support enabled
Client API library version 4.1.20
Client API header version 4.1.20
MYSQLI_SOCKET /var/lib/mysql/mysql.sock
Directive Local Value Master Value
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket no value no value
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.reconnect Off Off
pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 7.2 2007-06-19
Directive Local Value Master Value
pcre.backtrack_limit 100000 100000
pcre.recursion_limit 100000 100000
PDO
PDO support enabled
PDO drivers sqlite2, sqlite
pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.2 2007/03/23 14:30:00 wez Exp $
SQLite Library 3.3.17
posix
Revision $Revision: 1.70.2.3.2.16 $
Reflection
Reflection enabled
Version $Id: php_reflection.c,v 1.164.2.33.2.45 2007/08/20 17:01:22 sebastian Exp $
session
Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter no value no value
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 1 1
SimpleXML
Simplexml support enabled
Revision $Revision: 1.151.2.22.2.35 $
Schema support enabled
SPL
SPL support enabled
Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException
SQLite
SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c,v 1.166.2.13.2.9 2007/05/19 17:58:22 iliaa Exp $
SQLite Library 2.8.17
SQLite Encoding iso8859
Directive Local Value Master Value
sqlite.assoc_case 0 0
standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i
Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset= a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent no value no value
tokenizer
Tokenizer Support enabled
xml
XML Support active
XML Namespace Support active
libxml2 Version 2.6.16
xmlreader
XMLReader enabled
xmlwriter
XMLWriter enabled
Additional Modules
Module Name
Environment
Variable Value
SHELL /bin/sh
USER root
LD_LIBRARY_PATH /usr/local/apache/lib:
PATH /usr/bin:/bin
PWD /root
SHLVL 3
HOME /root
LOGNAME root
_ /usr/local/apache/bin/httpd
PHP Variables
Variable Value
PHP_SELF /free.php
_SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
_SERVER["HTTP_ACCEPT_LANGUAGE"] zh-cn
_SERVER["HTTP_UA_CPU"] x86
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Avant Browser; .NET CLR 1.1.4322)
_SERVER["HTTP_HOST"] 9.4.12.73
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["PATH"] /usr/bin:/bin
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"] Apache/2.2.6 (Unix) PHP/5.2.4
_SERVER["SERVER_NAME"] 9.4.12.73
_SERVER["SERVER_ADDR"] 9.4.12.73
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 9.4.12.2
_SERVER["DOCUMENT_ROOT"] /usr/local/apache/htdocs/web
_SERVER["SERVER_ADMIN"] ctest@gmail.com
_SERVER["SCRIPT_FILENAME"] /usr/local/apache/htdocs/web/free.php
_SERVER["REMOTE_PORT"] 2243
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /free.php
_SERVER["SCRIPT_NAME"] /free.php
_SERVER["PHP_SELF"] /free.php
_SERVER["REQUEST_TIME"] 1206420810
_SERVER["argv"] Array
(
)
_SERVER["argc"] 0
_ENV["SHELL"] /bin/sh
_ENV["USER"] root
_ENV["LD_LIBRARY_PATH"] /usr/local/apache/lib:
_ENV["PATH"] /usr/bin:/bin
_ENV["PWD"] /root
_ENV["SHLVL"] 3
_ENV["HOME"] /root
_ENV["LOGNAME"] root
_ENV["_"] /usr/local/apache/bin/httpd
[ 本帖最後由 myfreeke 於 2008-3-25 13:03 編輯 ]