apache问题,大家帮忙看看
liuwt123
|
1#
liuwt123 发表于 2008-06-02 15:38
apache问题,大家帮忙看看
网站的一台web,DELL2950 2g RAM OS:Centos
apache+php(apache handle) 服务器相应不是很快,而且内存占用很大,top和httpd.conf如下,大家帮忙看看到底是配置的问题,还是系统啥的,先谢谢了! top - 15:25:21 up 4 days, 58 min, 2 users, load average: 0.04, 0.04, 0.00 Tasks: 86 total, 1 running, 85 sleeping, 0 stopped, 0 zombie Cpu(s): 3.8%us, 0.3%sy, 0.0%ni, 95.7%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st Mem: 2075520k total, 1848384k used, 227136k free, 132292k buffers Swap: 2031608k total, 80k used, 2031528k free, 1253252k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 11274 daemon 18 0 330m 46m 4208 S 3 2.3 0:59.80 httpd 11164 daemon 18 0 339m 55m 4508 S 2 2.7 0:56.72 httpd 11850 daemon 18 0 328m 45m 4444 S 1 2.2 0:37.03 httpd 12220 daemon 18 0 326m 43m 4316 S 1 2.1 0:12.06 httpd 12514 wdou 15 0 2160 992 792 R 0 0.0 0:00.03 top 1 root 15 0 2036 644 552 S 0 0.0 0:00.54 init 2 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0 3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0 4 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/0 5 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1 6 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1 7 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/1 8 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/0 9 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1 10 root 10 -5 0 0 0 S 0 0.0 0:00.00 khelper 11 root 10 -5 0 0 0 S 0 0.0 0:00.00 kthread 15 root 10 -5 0 0 0 S 0 0.0 0:00.03 kblockd/0 16 root 10 -5 0 0 0 S 0 0.0 0:00.00 kblockd/1 17 root 16 -5 0 0 0 S 0 0.0 0:00.00 kacpid 109 root 16 -5 0 0 0 S 0 0.0 0:00.00 cqueue/0 110 root 16 -5 0 0 0 S 0 0.0 0:00.00 cqueue/1 113 root 10 -5 0 0 0 S 0 0.0 0:00.00 khubd 115 root 10 -5 0 0 0 S 0 0.0 0:00.01 kseriod 182 root 21 0 0 0 0 S 0 0.0 0:00.00 pdflush 183 root 15 0 0 0 0 S 0 0.0 0:00.89 pdflush 184 root 10 -5 0 0 0 S 0 0.0 0:01.85 kswapd0 185 root 19 -5 0 0 0 S 0 0.0 0:00.00 aio/0 186 root 19 -5 0 0 0 S 0 0.0 0:00.00 aio/1 343 root 11 -5 0 0 0 S 0 0.0 0:00.00 kpsmoused 382 root 17 -5 0 0 0 S 0 0.0 0:00.00 scsi_eh_0 389 root 20 -5 0 0 0 S 0 0.0 0:00.00 kmirrord 396 root 20 -5 0 0 0 S 0 0.0 0:00.00 ksnapd 399 root 10 -5 0 0 0 S 0 0.0 0:21.68 kjournald 427 root 10 -5 0 0 0 S 0 0.0 0:00.00 kauditd http.conf ServerRoot "/httpd/apache" #Listen 12.34.56.78:80 Listen 80 # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbd_module modules/mod_authn_dbd.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule cache_module modules/mod_cache.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule dbd_module modules/mod_dbd.so LoadModule dumpio_module modules/mod_dumpio.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule include_module modules/mod_include.so LoadModule filter_module modules/mod_filter.so LoadModule substitute_module modules/mod_substitute.so LoadModule deflate_module modules/mod_deflate.so LoadModule log_config_module modules/mod_log_config.so LoadModule log_forensic_module modules/mod_log_forensic.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so LoadModule ident_module modules/mod_ident.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule version_module modules/mod_version.so LoadModule ssl_module modules/mod_ssl.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule asis_module modules/mod_asis.so LoadModule info_module modules/mod_info.so LoadModule suexec_module modules/mod_suexec.so LoadModule cgid_module modules/mod_cgid.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule imagemap_module modules/mod_imagemap.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule php5_module modules/libphp5.so <IfModule !mpm_netware_module> <IfModule !mpm_winnt_module> User daemon Group daemon </IfModule> </IfModule> ServerAdmin you@example.com # ServerName localhost:80 # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/data/wwwroot" # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all </Directory> # # This should be changed to whatever you set DocumentRoot to. # <Directory "/httpd/apache/htdocs"> AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> DirectoryIndex index.html index.htm index.php default.php default.htm </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch> # ErrorLog "logs/error_log" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn <IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> #CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> # ScriptAlias /cgi-bin/ "/httpd/apache/cgi-bin/" </IfModule> <IfModule cgid_module> # # ScriptSock: On threaded servers, designate the path to the UNIX # socket used to communicate with the CGI daemon of mod_cgid. # #Scriptsock logs/cgisock </IfModule> # # "/httpd/apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/httpd/apache/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> DefaultType text/plain <IfModule mime_module> AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi # For type maps (negotiated resources): #AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # #AddType text/html .shtml #AddOutputFilter INCLUDES .shtml </IfModule> <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> |