测试环境
CPU AMD4000+ 2.11GHZ
内存1G
显卡8500 NVDIA 256M
硬盘日立160G 8M
系统UBUNTU8.04
ADSL 2M
apache 2.0 squid 3.0
测试没有使用虚拟机
单机进行测试
(SQUID配置):
http_port 3129
cache_mem 100m
maximem_object_size 4096kb
cache_dir ufs /var/spool/squid 100 16 256
acl a src 0.0.0.0/0.0.0.0
http_access allow a
其他配置是默认
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.00678 0.00919
Cache Misses: 0.05951 0.01745
Cache Hits: 0.00678 0.00865
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
----以上是ab -n 30000 -c 100 测试的
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.00678 0.00919
Cache Misses: 0.05951 0.01745
Cache Hits: 0.00678 0.00865
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
------以上是 -n 30000 -c 500 测试的
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01035 0.01035
Cache Misses: 0.17711 0.01745
Cache Hits: 0.01035 0.00919
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.05078 0.05078
ICP Queries: 0.00000 0.00000
------以上是 -n 30000 -c 1000 测试的
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01035 0.01035
Cache Misses: 0.17711 0.01745
Cache Hits: 0.01035 0.00919
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.05078 0.05078
ICP Queries: 0.00000 0.00000
------以上是 -n 30000 -c 3000 测试的
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01235 0.01235
Cache Misses: 0.17711 0.01745
Cache Hits: 0.01235 0.01035
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.05078 0.05078
ICP Queries: 0.00000 0.00000
------以上是 -n 30000 -c 5000 测试的
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01387 0.01309
Cache Misses: 0.17711 0.01745
Cache Hits: 0.01387 0.01235
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.05078 0.05078
ICP Queries: 0.00000 0.00000
------以上是 -n 30000 -c 10000 测试的
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01648 0.01469
Cache Misses: 0.17711 0.01745
Cache Hits: 0.01648 0.01235
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.05078 0.05078
ICP Queries: 0.00000 0.00000
------以上是 -n 30000 -c 20000 测试的
ab: Invalid Concurrency [Range 0..20000]
无法进行30000的测试
-------------------------
机器配置APACHE配置一样 修改SQUID配置
maximem_object_size 20000KB
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01469 0.01469
Cache Misses: 0.07409 0.07409
Cache Hits: 0.01469 0.01469
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
---- -n 30000 -c 100测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.03622 0.03622
Cache Misses: 0.16775 0.16775
Cache Hits: 0.03622 0.03622
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
---- -n 30000 -c 500测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.03241 0.03241
Cache Misses: 0.15048 0.15048
Cache Hits: 0.03241 0.03241
Near Hits: 0.04519 0.04519
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01535 0.01535
ICP Queries: 0.00000 0.00000
---- -n 30000 -c 1000测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.03241 0.03241
Cache Misses: 0.15048 0.15048
Cache Hits: 0.03241 0.03241
Near Hits: 0.04519 0.04519
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01535 0.01535
ICP Queries: 0.00000 0.00000
---- -n 30000 -c 3000测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.16775 0.16775
Cache Hits: 0.01745 0.01745
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.16304 0.16304
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 10000 测试
maximem_object_size 20kb
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.00102 0.00102
Cache Hits: 0.01745 0.01745
Near Hits: 0.03241 0.03241
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01210 0.01210
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 100 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.06640 0.06640
Cache Hits: 0.01745 0.01745
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01210 0.01210
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 500 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.02069 0.02069
Cache Misses: 0.15888 0.15888
Cache Hits: 0.01955 0.01955
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 1000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.04047 0.02592
Cache Misses: 0.15888 0.15888
Cache Hits: 0.03829 0.02317
Near Hits: 0.11465 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.02231 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 3000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.06640 0.06640
Cache Hits: 0.01745 0.01745
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01210 0.01210
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 10000 测试
以上测试证明maximem_object_size的值 对SQUID的性能是有影响的
值小 性能越好 值大反之
----------------------------------------------------------
memory_replacement_policy 有3种模式
heap GDSF : Greedy-Dual Size Frequency
heap LFUDA: Least Frequently Used with Dynamic Aging
heap LRU : LRU policy implemented using a heap
现在测试的是lru
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01648 0.01648
Cache Misses: 0.19742 0.19742
Cache Hits: 0.01648 0.01648
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 100 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01469 0.01469
Cache Misses: 0.17711 0.17711
Cache Hits: 0.01469 0.01469
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.02447 0.02447
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 500 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.17711 0.17711
Cache Hits: 0.01745 0.01745
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.02447 0.02447
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 1000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.17711 0.17711
Cache Hits: 0.01745 0.01745
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.02447 0.02447
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 5000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.02317 0.02317
Cache Misses: 0.17711 0.17711
Cache Hits: 0.02190 0.02190
Near Hits: 0.08729 0.08729
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.02447 0.02447
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 10000 测试
现在测试的是lfuda
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01648 0.01648
Cache Misses: 0.08729 0.08729
Cache Hits: 0.01648 0.01648
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.98804 4.98804
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 100 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01648 0.01648
Cache Misses: 0.11465 0.11465
Cache Hits: 0.01648 0.01648
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 500 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.11465 0.11465
Cache Hits: 0.01745 0.01745
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 1000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01847 0.01847
Cache Misses: 0.11465 0.11465
Cache Hits: 0.01847 0.01847
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 5000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01847 0.01847
Cache Misses: 0.11465 0.11465
Cache Hits: 0.01847 0.01847
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 4.77162 4.77162
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 10000 测试
现在测试的是gdsf
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.16775 0.16775
Cache Hits: 0.01745 0.01745
Near Hits: 0.10281 0.10281
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 100 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01745 0.01745
Cache Misses: 0.16775 0.16775
Cache Hits: 0.01745 0.01745
Near Hits: 0.10281 0.10281
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 500 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01847 0.01847
Cache Misses: 0.15888 0.15888
Cache Hits: 0.01847 0.01847
Near Hits: 0.10281 0.10281
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 1000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.02451 0.02451
Cache Misses: 0.16775 0.16775
Cache Hits: 0.02451 0.02451
Near Hits: 0.10281 0.10281
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 5000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.03427 0.03427
Cache Misses: 0.15888 0.15888
Cache Hits: 0.03241 0.03241
Near Hits: 0.10281 0.10281
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01331 0.01331
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 10000 测试
结论分析
相对LRU 来说LFUDA和GDSF 的命中率都要比他高
GDSF的测试还要略微高点
而且配置文档解释
用LFUDA的话 如果将maximem_object_size设置高点的话
效率会相对提高(本人尚未测试,如有需要再做)
证明默认的LRU对SQUID的CACHE命中率 的效率是比较低下的
--------------------------------------------------------------
现在测试pipeline_prefetch
默认是OFF的 现在开启
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.00975 0.00975
Cache Misses: 0.10281 0.10281
Cache Hits: 0.00919 0.00919
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.00997 0.00997
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 100 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01164 0.01164
Cache Misses: 0.37825 0.37825
Cache Hits: 0.01164 0.01164
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01046 0.01046
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 500 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01387 0.01387
Cache Misses: 0.37825 0.37825
Cache Hits: 0.01387 0.01387
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01046 0.01046
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 1000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01847 0.01847
Cache Misses: 0.39928 0.39928
Cache Hits: 0.01847 0.01847
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01046 0.01046
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 5000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.02317 0.02317
Cache Misses: 0.37825 0.37825
Cache Hits: 0.02317 0.02317
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01046 0.01046
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 10000 测试
测试证明开启该属性令的CACHE命中提高~
-------------------------------------------
现在测试fqdncache_size
默认是1024
现在改为4096
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.00919 0.00919
Cache Misses: 0.08265 0.08265
Cache Hits: 0.00919 0.00919
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01098 0.01098
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 100 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01164 0.01164
Cache Misses: 0.07014 0.07014
Cache Hits: 0.01164 0.01164
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01098 0.01098
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 500 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01309 0.01309
Cache Misses: 0.07014 0.07014
Cache Hits: 0.01309 0.01309
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01098 0.01098
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 1000 测试
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.01309 0.01309
Cache Misses: 0.07014 0.07014
Cache Hits: 0.01309 0.01309
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01098 0.01098
ICP Queries: 0.00000 0.00000
----- -n 30000 -c 5000 测试
经过测试 CACHE比默认的CACHE命中高一点
提高该值对提高性能有一定的可行性
阅读(3947) | 评论(0) | 转发(0) |