日期:2014-05-16  浏览次数:20879 次

Apache调优及配置

KeepAliveTimeout?5
持续作用中服务器在两次请求之间等待的时间数
MaxKeepAliveRequests?3000
一个长连接中允许的最高请求数量
MinSpareServers?5
自己翻译:充许最小的空闲进程
MaxSpareServers?10
自己翻译:充许最大的空闲进程
StartServers?5
自己翻译:HTTP服务启动时创建的http进程数量
MaxClients?150
自己翻译:充许为向应客户端请求时,创建进程的最高数量
MaxRequestsPerChild?0

?

?

1 apache端需要配置的核心参数:apache/conf/httpd.conf

?? Timeout 10
?? KeepAlive On
?? MaxKeepAliveRequests 5
?? KeepAliveTimeout 5

?

?

<VirtualHost *>
??? SetOutputFilter DEFLATE
??? DeflateBufferSize 512096
??? AddOutputFilterByType DEFLATE text/html
??? AddOutputFilterByType DEFLATE text/css
??? AddOutputFilterByType DEFLATE application/x-javascript
??? BrowserMatch ^Mozilla/4\.0[678] no-gzip
??? SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
??? SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|mp3|wma|MP3|WMA)$ no-gzip dont-vary
??? SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

???

??? DocumentRoot /data/update/
??? ServerName twin0504.sandai.net
??? AddDefaultCharset UTF8
??? ErrorLog logs/error_log_81

?

??? <Directory />
???????? Options Includes FollowSymLinks
???????? AllowOverride None
??? </Directory>
</VirtualHost>

?

?

?

linux下apache压力测试:

1.用自带的ab?:? ab -n1000 -c10 url

?

?

?

?http://www.chinaunix.net/jh/13/503707.html

?http://callan.iteye.com/blog/510565

?

?

?

?