alf*_*ish 5 performance varnish
有时在繁忙的 Pressflow 站点上,我注意到未经身份验证的用户超时,而服务器的端口远未饱和,有大量未使用的内存并且服务器负载非常低。
除此之外,自从我迁移到具有新配置的新 Varnish 服务器后,站点的带宽使用量下降了大约 30%。因此我怀疑下降可能是因为 Varnish 的错误配置。
以下是一些相关参数:
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-b localhost:8080 \
-u varnish -g varnish \
-S /etc/varnish/secret \
-p thread_pools=14 \
-p thread_pool_min=200 \
-p thread_pool_max=5000 \
-p listen_depth=128 \
-p thread_pool_add_delay=2\
-p lru_interval=20 \
-h classic,72227 \
-p session_linger=120 \
-p sess_workspace=32768 \
-p connect_timeout=600 \
-s malloc,15G"
Run Code Online (Sandbox Code Playgroud)
# 这是 varnishstat 的最新输出:
1+21:07:54
Hitrate ratio: 10 13 13
Hitrate avg: 0.8405 0.8408 0.8408
21003013 158.92 129.32 Client connections accepted
35390015 283.85 217.91 Client requests received
4696051 26.99 28.92 Cache hits
79 0.00 0.00 Cache hits for pass
939223 4.00 5.78 Cache misses
10041628 89.95 61.83 Backend conn. success
108 0.00 0.00 Backend conn. failures
20651750 162.92 127.16 Backend conn. reuses
3202624 22.99 19.72 Backend conn. was closed
23854404 187.90 146.88 Backend conn. recycles
17397 0.00 0.11 Fetch head
20499527 189.90 126.22 Fetch with Length
6536900 37.98 40.25 Fetch chunked
2410249 15.99 14.84 Fetch wanted close
4 0.00 0.00 Fetch failed
2261 . . N struct sess_mem
1728 . . N struct sess
263703 . . N struct object
264848 . . N struct objectcore
138282 . . N struct objecthead
116 . . N struct vbe_conn
2800 . . N worker threads
2801 0.00 0.02 N worker threads created
2889 0.00 0.02 N worker threads limited
832 0.00 0.01 N overflowed work requests
1 . . N backends
658946 . . N expired objects
6948 . . N LRU nuked objects
3425448 . . N LRU moved objects
31922006 257.87 196.56 Objects sent with write
21002526 160.92 129.32 Total Sessions
35390015 283.85 217.91 Total Requests
750 0.00 0.00 Total pipe
29752808 252.87 183.20 Total pass
Run Code Online (Sandbox Code Playgroud)
所以这是我的问题:我怎么知道清漆线是否已经饱和?我应该如何操纵参数以增加吞吐量?谢谢
我主要建议调整 thread_pool_min 和 thread_pool_max,其他值没有太大帮助。-p thread_pools=2 \ -p thread_pool_min=500 \ -p thread_pool_max=5000 \
专门将 thread_pools 设置为 CPU 的数量根本没有帮助,并且可能会减慢您的机器速度。这只是一个猜测,但也许这已经解决了您的问题!:)
你会在这里找到很好的解释:http : //book.varnish-software.com/4.0/chapters/Tuning.html
| 归档时间: |
|
| 查看次数: |
11521 次 |
| 最近记录: |