| Subcribe via RSS

Apache 防盗链

9月 12th, 2008 | 1 Comment | Posted in Apache < by ready >

临时要求在apache中加防盗链。网上搜集了一些资料整理一下发在这里,方便以后翻阅。
关于mod_authz_host模块参看:http://doc.linuxpk.com/doc/apache/mod/mod_authz_host.html
1。通过User-Agent浏览器类型限制

SetEnvIf User-Agent ^blueapple go_out
<Directory /home/domain>
Order Allow,Deny
Allow  from all
Deny from env=go_out
</Directory>

2。通过Referer限制

SetEnvIf Referfer ^$ go_out
SetEnvIf Referfer ^http:\/\/baidu.com(\/|$)”  go_out
<Directory /home/domain>
Order Allow,Deny
Allow  from all
Deny from env=go_out
</Directory>

referer为空禁止访问。
referer为http://baidu.com限制访问。

阅读内文

负载均衡环境中和如何设置Expires和Etag

8月 8th, 2008 | 2 Comments | Posted in Apache, Squid < by Martian Guo >

在负载均衡环境中(LVS, LoadBalance)为了减少浏览器数据的重复请求操作,一般需要设置 Http Header 的 Etage 和 Expires 告诉浏览器请求数据是否已过期。以下内容主要考虑Apache+squid 环境

ETag Header是文件修改时间、文件大小和inode号生成的校验(checksum),在多台服务器的负载均衡环境下会因部署内容的inode节点差异造成 ETag 的不同,在多台WEB前端做负载均衡的情况下,会因为请求同一个数据但不同机器的 ETag 而影响了响应. 具体表现为用户在第一次请求某一内容时下载而再次时浏览器会发现ETag不同而再次请求下载.。(再次刷新时查看是否响应码为:304)
对于Apache 可以使用 FileEtag 选项配置
Apache 的默认ETag的值总是由文件的索引节点(Inode)、大小(Size)、最后修改时间(MTime)决定
这里我们只需要去掉Inode即可
FileETag MTime Size
具体关于 FileETag 详细内容可以查看Apache官方文档

Expires用于控制请求文件的有效时间,当请求数据在有效期内时客户端浏览器从缓存请求数据而不是服务器端. 当缓存中数据失效或过期,才决定从服务器更新数据。
可以使用Apache的mod_expires 模块来设置,这包括控制应答时的Expires头内容和Cache-Control头的max-age指令

ExpiresActive On
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/html "access plus 30 minutes"
ExpiresByType text/css  "access plus 30 minutes"
ExpiresByType text/js   "access plus 30 minutes"
ExpiresByType application/x-javascript   "access plus 30 minutes"
ExpiresByType application/x-shockwave-flash     "access plus 30 minutes"

以上设置为 图片文件的有效期为从请求文件开始1个月,html,css,js,flash文件的有效期为从请求文件开始30分钟
这里只是一个常规设置,Apache官方文档 对此设置有详细介绍
当设置了expires后,会自动输出Cache-Control 的max-age 信息,这个数值是expires有效期内的秒数,(一个月的数值为2592000) 在这个时间段里,该文件的请求都将直接通过缓存服务器获取,当然如果需要忽略浏览器的刷新请求(F5),缓存服务器squid还需要使用refresh_pattern 选项来忽略该请求

refresh_pattern -i .jpg  1440 50% 10080 reload-into-ims ignore-reload ignore-no-cache ignore-private

以下为实际输出的HTTP Header信息

Date Thu, 07 Aug 2008 07:27:57 GMT
Server Apache
Last-Modified Fri, 27 Jun 2008 07:18:52 GMT
Etag "df6-b8c8cf00"
Accept-Ranges bytes
Content-Length 3574
Cache-Control max-age=2592000
Expires Sat, 06 Sep 2008 07:27:57 GMT
Content-Type image/jpeg
Age 34241
X-Cache HIT from s1.ihompy.com
Connection keep-alive

对于动态页面的缓存如果不是频繁更新的页面数据,可以在squid缓存,只需要注意两点
1. session : 对于需要缓存的数据,一定要关闭session防止在http header 中包括session id 字段
2. Last-Modified 和 Expires 标记: 一般般纯静态页面本身都会有Last-Modified信息,这是由WEB服务器获取文件的最后修改时间生成的,而动态页面需要默认的输出内容是

Date Thu, 07 Aug 2008 16:58:37 GMT
Expires Thu, 19 Nov 1981 08:52:00 GMT
Last-Modified Thu, 07 Aug 2008 16:58:37 GMT

这里的 Last-Modified 时间和请求文件的时间相同,也就是说该文件总是声明为最新的
在程序中需要输出Last-Modifed 和 Expires信息,比如php

header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
header('Expires: ' . gmdate ("D, d M Y H:i:s", time() + 3600*24). " GMT");

以上信息设置php文件的过期时间为请求该文件的时间后的24小时(3600*24)


补充 ,以下内容来自 : 扶凯的blog
http://www.php-oa.com/2008/09/05/squidmaxageexpires.html


Squid和Apache中的max-age与Expires的分别

主要重点在于我们要明白一个相对(Expires)一个绝对(max-age).

分别

max-age
max-age是HTTP/1.1中,他是指我们的web中的文件被用户访问(请求)后的存活时间,是个相对的值,相对Request_time(请求时间).
例如:A.html 用户请求时间是18:00,max-age设置的是600的话,相当18:00+600秒过期,也就是相对18:00的时间后面600秒后过期.默认的max-age是由Expires算出来的.

Expires
Expires是HTTP/1.0中的,它比max-age要麻烦点.Expires指定的时间分下面二种,这个主要考虑到apache中设置是A还是M.

1.相对文件的最后访问时间(Atime)
当Apache使用A时间来做Expires时.这样设置时.他就和max-age的值相等,因为max-age是相对文件的请求时间(Atime).

例如:ExpiresByType text/html A600

由上面我们得知,Apache设置Atime时,过期为600秒时.
Expires=18:00+600=18:10
max-age=18:00+600=18:10
得出:Expires=max-age

2.绝对修改时间(MTime)
这又分二种情况,我们来拿A.htm来讲
假设文件的建立时间为18:00.

当用户Request请求为18:00时,过期为600秒
Expires=18:00+600=18:10
max-age=18:00+600=18:10
得出:Expires等于max-age

当用户Request请求为18:20时,过期为600秒

Expires=18:00+600=18:10(因为设置成Mtime时,时间由文件建立时间来决定)
max-age=18:20+600=18:30
得出:Expires不等于max-age

另外要注意,象上面这种清况时,max-age优化,所以过期时间为18:30.

在squid,如果没有指明expires和max-age这二个的截止时间,那它就会使用发式截止时间,如参考 Last-Modified.
其实上面的max-age=18:20+600=18:30,这样算max-age不对,真实环境要这样算,max-age过期为http头中的Age=600过期.
注:Age域值是缓存服务器估计从响应产生或被原始服务器重新证实以来的总时间.age的值是缓存服务器算出来的,原始服务器是没有的.

阅读内文 Tags: , , , , , ,

IT流言终结者2续篇 :Nginx vs Lighthttpd vs Apache

6月 12th, 2008 | No Comments | Posted in Apache, LightHttpd, Nginx < by Johnny Woo >

上篇中我们使用系统的默认配置对nginx,lighthttpd,apache进行测试
在并发量1000时,lighthttpd以及nginx都发生了大量的无法正常抓取页面的错误
在对HTTPD服务器环境加上优化之后

ulimit -SHn 51200

nginx和lighthttpd的限制被解除
经过优化之后
测试结果如下
1. Nginx
1000并发数

1000 fetches, 1000 max parallel, 2.23782e+08 bytes, in 21.3699 seconds
223782 mean bytes/connection
46.7947 fetches/sec, 1.04718e+07 bytes/sec
msecs/connect: 1321.52 mean, 21002.3 max, 0.215 min
msecs/first-response: 438.404 mean, 2718.81 max, 0.471 min
HTTP response codes:
 
code 200 -- 1000

2.Lighthttpd

1000 fetches, 1000 max parallel, 2.23782e+08 bytes, in 22.0106 seconds
223782 mean bytes/connection
45.4327 fetches/sec, 1.0167e+07 bytes/sec
msecs/connect: 1888.67 mean, 21028.2 max, 0.206 min
msecs/first-response: 386.335 mean, 2322.46 max, 0.678 min
HTTP response codes:
 
code 200 -- 1000

3.Apache 1.x

1000 fetches, 1000 max parallel, 2.15278e+08 bytes, in 21.0746 seconds
215278 mean bytes/connection
47.4505 fetches/sec, 1.02151e+07 bytes/sec
msecs/connect: 1110.12 mean, 3367.64 max, 0.271 min
msecs/first-response: 7236.8 mean, 18910.1 max, 1.419 min
38 bad byte counts
HTTP response codes:
 
code 200 -- 962

4.Apache 2.x

1000 fetches, 999 max parallel, 2.23782e+08 bytes, in 24.6054 seconds
223782 mean bytes/connection
40.6415 fetches/sec, 9.09484e+06 bytes/sec
msecs/connect: 3291.74 mean, 9352.51 max, 0.201 min
msecs/first-response: 5074 mean, 15275.8 max, 1.493 min
HTTP response codes:
 
code 200 -- 1000

提高了系统处理能力之后
Nginx以及Lighthttpd的表现有着翻天覆地的变化
不论是请求的处理能力还是出错率
都较Apache有很大的提升
看来Nginx以及Lighthttpd在负载量提高的时候
能够用尽系统所有的能力
例如文件的并行处理能力
而Apache这时候反而由于同时处理量变大而不堪压力

结论
1.系统优化与否对于Nginx以及Lighthttpd有着至关重要的影响.只适用系统默认状态是无法适应Nginx以及Lighthttpd的要求的.

阅读内文

IT流言终结者2:Nginx vs Lighthttpd vs Apache

6月 12th, 2008 | No Comments | Posted in Apache, LightHttpd, Nginx < by Johnny Woo >

和以往一样,本次测试均使用默认配置
不对内核以及应用程序做任何优化
配置文件优先采用程序自带的默认配置,
在没有默认配置的前提下,使用最简化的配置文件

平台
WEB:
CentOS 5.1 最小化安装
浪潮NF180
Xeon 2.8
1G RAM
73G SCSI

Nginx 0.6.31
Apache 1.3.41
Apache 2.2.8
Lighthttpd 1.4.19

CLIENT:
CentOS 5.1 最小化安装
浪潮NF260
Xeon 2.4
512M RAM
36G SCSI

http_load-12mar2006

SWITCH:
DLINK DES 1024R+

1.Nginx 0.6.31
编译参数

<?php
./
configure --prefix=/usr/local/nginx

配置文件

worker_processes  10;
events {
    
worker_connections  1024;
}
http {
    
include       mime.types;
    
default_type  application/octet-stream;
    
sendfile        on;
    
keepalive_timeout  65;
    
server {
        
listen       80;
        
server_name  localhost;
        
location / {
            
root   html;
            
index  index.html index.htm;
        
}
        
error_page   500 502 503 504  /50x.html;
        
location = /50x.html {
            
root   html;
        
}
    
}
}

2.Lighthttpd 1.4.19
编译参数

<?php
./
configure --prefix=/usr/local/lighthttpd

配置文件

server.modules              = (
                                
"mod_accesslog" )
 
server.document-root        = "/var/www/html/"
 
server.errorlog             = "/var/log/lighttpd/error.log"
 
index-file.names            = ( "index.php", "index.html",
                                
"index.htm", "default.htm" )
 
mimetype.assign             = (
 
".pdf"          =>      "application/pdf",
 
".sig"          =>      "application/pgp-signature",
 
".spl"          =>      "application/futuresplash",
 
".class"        =>      "application/octet-stream",
 
".ps"           =>      "application/postscript",
 
".torrent"      =>      "application/x-bittorrent",
 
".dvi"          =>      "application/x-dvi",
 
".gz"           =>      "application/x-gzip",
 
".pac"          =>      "application/x-ns-proxy-autoconfig",
 
".swf"          =>      "application/x-shockwave-flash",
 
".tar.gz"       =>      "application/x-tgz",
 
".tgz"          =>      "application/x-tgz",
 
".tar"          =>      "application/x-tar",
 
".zip"          =>      "application/zip",
 
".mp3"          =>      "audio/mpeg",
 
".m3u"          =>      "audio/x-mpegurl",
 
".wma"          =>      "audio/x-ms-wma",
 
".wax"          =>      "audio/x-ms-wax",
 
".ogg"          =>      "application/ogg",
 
".wav"          =>      "audio/x-wav",
 
".gif"          =>      "image/gif",
 
".jar"          =>      "application/x-java-archive",
 
".jpg"          =>      "image/jpeg",
 
".jpeg"         =>      "image/jpeg",
 
".png"          =>      "image/png",
 
".xbm"          =>      "image/x-xbitmap",
 
".xpm"          =>      "image/x-xpixmap",
 
".xwd"          =>      "image/x-xwindowdump",
 
".css"          =>      "text/css",
 
".html"         =>      "text/html",
 
".htm"          =>      "text/html",
 
".js"           =>      "text/javascript",
 
".asc"          =>      "text/plain",
 
".c"            =>      "text/plain",
 
".cpp"          =>      "text/plain",
 
".log"          =>      "text/plain",
 
".conf"         =>      "text/plain",
 
".text"         =>      "text/plain",
 
".txt"          =>      "text/plain",
 
".dtd"          =>      "text/xml",
 
".xml"          =>      "text/xml",
 
".mpeg"         =>      "video/mpeg",
 
".mpg"          =>      "video/mpeg",
 
".mov"          =>      "video/quicktime",
 
".qt"           =>      "video/quicktime",
 
".avi"          =>      "video/x-msvideo",
 
".asf"          =>      "video/x-ms-asf",
 
".asx"          =>      "video/x-ms-asf",
 
".wmv"          =>      "video/x-ms-wmv",
 
".bz2"          =>      "application/x-bzip",
 
".tbz"          =>      "application/x-bzip-compressed-tar",
 
".tar.bz2"      =>      "application/x-bzip-compressed-tar",
 
# default mime type
 
""              =>      "application/octet-stream",
 
)
 
accesslog.filename          = "/var/log/lighttpd/access.log"
 
url.access-deny             = ( "~", ".inc" )
 
$HTTP["url"] =~ "\.pdf$" {
 
server.range-requests = "disable"
}
 
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

3.Apache 1.3.41
编译参数

<?php
./
configure --prefix=/usr/local/apache1.3.41

配置文件

ServerType standalone
ServerRoot "/usr/local/apache1.3.41"
PidFile /usr/local/apache1.3.41/logs/httpd.pid
ScoreBoardFile /usr/local/apache1.3.41/logs/httpd.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
Port 80
User nobody
Group nobody
ServerAdmin root@test1.hiadmin.com
DocumentRoot "/var/www/html"
<
Directory />
    
Options FollowSymLinks
    
AllowOverride None
</
Directory>
<
Directory "/var/www/html">
 
    
Options Indexes FollowSymLinks MultiViews
 
    
AllowOverride None
 
    
Order allow,deny
    
Allow from all
</
Directory>
 
<
IfModule mod_userdir.c>
    
UserDir public_html
</
IfModule>
 
<
IfModule mod_dir.c>
    
DirectoryIndex index.html
</
IfModule>
 
AccessFileName .htaccess
 
<
Files ~ "^\.ht">
    
Order allow,deny
    
Deny from all
    
Satisfy All
</
Files>
 
UseCanonicalName On
 
<
IfModule mod_mime.c>
    
TypesConfig /usr/local/apache1.3.41/conf/mime.types
</
IfModule>
 
DefaultType text/plain
 
<
IfModule mod_mime_magic.c>
    
MIMEMagicFile /usr/local/apache1.3.41/conf/magic
</
IfModule>
 
HostnameLookups Off
 
ErrorLog /usr/local/apache1.3.41/logs/error_log
 
LogLevel warn
 
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
 
CustomLog /usr/local/apache1.3.41/logs/access_log common
 
ServerSignature On
 
<
IfModule mod_alias.c>
 
    
Alias /icons/ "/usr/local/apache1.3.41/icons/"
 
    <
Directory "/usr/local/apache1.3.41/icons">
        
Options Indexes MultiViews
        
AllowOverride None
        
Order allow,deny
        
Allow from all
    </
Directory>
 
    
Alias /manual/ "/usr/local/apache1.3.41/htdocs/manual/"
 
    <
Directory "/usr/local/apache1.3.41/htdocs/manual">
        
Options Indexes FollowSymlinks MultiViews
        
AllowOverride None
        
Order allow,deny
        
Allow from all
    </
Directory>
 
    
ScriptAlias /cgi-bin/ "/usr/local/apache1.3.41/cgi-bin/"
 
    <
Directory "/usr/local/apache1.3.41/cgi-bin">
        
AllowOverride None
        
Options None
        
Order allow,deny
        
Allow from all
    </
Directory>
 
</
IfModule>
<
IfModule mod_autoindex.c>
 
    
IndexOptions FancyIndexing
 
    
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
 
    
AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*
 
    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core
 
    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
 
    DefaultIcon /icons/unknown.gif
 
    ReadmeName README.html
    HeaderName HEADER.html
 
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
 
</IfModule>
<IfModule mod_mime.c>
 
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage he .he
    AddCharset ISO-8859-8 .iso8859-8
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage kr .kr
    AddCharset ISO-2022-KR .iso-kr
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .sv
    AddLanguage cs .cz .cs
    AddLanguage ru .ru
    AddLanguage zh-TW .zh-tw
    AddCharset Big5         .Big5    .big5
    AddCharset WINDOWS-1251 .cp-1251
    AddCharset CP866        .cp866
    AddCharset ISO-8859-5   .iso-ru
    AddCharset KOI8-R       .koi8-r
    AddCharset UCS-2        .ucs2
    AddCharset UCS-4        .ucs4
    AddCharset UTF-8        .utf8
 
    <IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
    </IfModule>
 
    AddType application/x-tar .tgz
 
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
 
</IfModule>
 
<IfModule mod_setenvif.c>
 
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
 
</IfModule>
?>

4.Apache 2.2.8
编译参数

<?php
./
configure --prefix=/usr/local/apache2.2.8

配置文件

ServerRoot "/usr/local/apache2.2.8"
Listen 80
 
<
IfModule !mpm_netware_module>
<
IfModule !mpm_winnt_module>
User nobody
Group nobody
 
</
IfModule>
</
IfModule>
 
ServerAdmin you@example.com
 
DocumentRoot "/var/www/html"
 
<
Directory />
    
Options FollowSymLinks
    
AllowOverride None
    
Order deny,allow
    
Deny from all
</
Directory>
 
<
Directory "/var/www/html">
    
Options Indexes FollowSymLinks
    
AllowOverride None
    
Order allow,deny
    
Allow from all
 
</
Directory>
 
<
IfModule dir_module>
    
DirectoryIndex index.html
</
IfModule>
 
<
FilesMatch "^\.ht">
    
Order allow,deny
    
Deny from all
    
Satisfy All
</
FilesMatch>
 
ErrorLog "logs/error_log"
 
LogLevel warn
 
<
IfModule log_config_module>
    
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>
      
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </
IfModule>
 
    
CustomLog "logs/access_log" common
</
IfModule>
 
<
IfModule alias_module>
    
ScriptAlias /cgi-bin/ "/usr/local/apache2.2.8/cgi-bin/"
</
IfModule>
 
<
IfModule cgid_module>
</
IfModule>
 
<
Directory "/var/www/html">
    
AllowOverride None
    
Options None
    
Order allow,deny
    
Allow from all
</
Directory>
 
DefaultType text/plain
 
<
IfModule mime_module>
    
TypesConfig conf/mime.types
 
    
AddType application/x-compress .Z
    
AddType application/x-gzip .gz .tgz
 
</
IfModule>
 
<
IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</
IfModule>

测试结果
1.Nginx 0.6.31
200并发

<?php
./
http_load -parallel 200 -fetches 1000 urls
1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 19.0757 seconds
223782 mean bytes/connection
52.4228 fetches/sec, 1.17313e+07 bytes/sec
msecs/connect: 318.028 mean, 9293.85 max, 0.183 min
msecs/first-response: 278.832 mean, 2858.73 max, 0.489 min
HTTP response codes:
 
code 200 -- 1000

500并发

<?php
./
http_load -parallel 500 -fetches 1000 urls
1000 fetches, 500 max parallel, 2.23782e+08 bytes, in 19.0797 seconds
223782 mean bytes/connection
52.4119 fetches/sec, 1.17288e+07 bytes/sec
msecs/connect: 243.77 mean, 9104.99 max, 0.194 min
msecs/first-response: 307.939 mean, 2279.38 max, 0.514 min
HTTP response codes:
 
code 200 -- 1000

1000并发

<?php
./
http_load -parallel 1000 -fetches 1000 urls
1000 fetches, 1000 max parallel, 1.41278e+08 bytes, in 12.0671 seconds
141278 mean bytes/connection
82.8699 fetches/sec, 1.17077e+07 bytes/sec
msecs/connect: 692.526 mean, 3251.55 max, 0.265 min
msecs/first-response: 356.194 mean, 2131.45 max, 0.465 min
631 bad byte counts
HTTP response codes:
 
code 200 -- 631
 
code 500 -- 369

2.Lighthttpd 1.4.19
200并发

<?php
./
http_load -parallel 200 -fetches 1000 urls
1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 19.0897 seconds
223782 mean bytes/connection
52.3842 fetches/sec, 1.17226e+07 bytes/sec
msecs/connect: 354.108 mean, 3638.78 max, 0.143 min
msecs/first-response: 235.485 mean, 3029.56 max, 1.997 min
HTTP response codes:
 
code 200 -- 1000

500并发

<?php
./
http_load -parallel 500 -fetches 1000 urls
1000 fetches, 500 max parallel, 2.23782e+08 bytes, in 19.0725 seconds
223782 mean bytes/connection
52.4315 fetches/sec, 1.17332e+07 bytes/sec
msecs/connect: 287.275 mean, 9455.62 max, 0.224 min
msecs/first-response: 257.751 mean, 2249.71 max, 0.97 min
HTTP response codes:
 
code 200 -- 1000

1000并发

<?php
./