Caching 需要帮助分析VarnishStat结果吗
我是一个新手。我已经成功地安装了它,现在它可以工作了,但是我需要更多有知识的人提供一些关于服务器如何运行的指导 我读了这篇文章,但我仍然不确定服务器性能如何Caching 需要帮助分析VarnishStat结果吗,caching,apache2,varnish,Caching,Apache2,Varnish,我是一个新手。我已经成功地安装了它,现在它可以工作了,但是我需要更多有知识的人提供一些关于服务器如何运行的指导 我读了这篇文章,但我仍然不确定服务器性能如何 Hitrate ratio: 10 100 613 Hitrate avg: 0.2703 0.3429 0.4513 239479 8.00 7.99 client_conn - Client connections accepted
Hitrate ratio: 10 100 613
Hitrate avg: 0.2703 0.3429 0.4513
239479 8.00 7.99 client_conn - Client connections accepted
541129 13.00 18.06 client_req - Client requests received
157594 1.00 5.26 cache_hit - Cache hits
3 0.00 0.00 cache_hitpass - Cache hits for pass
313499 9.00 10.46 cache_miss - Cache misses
67377 4.00 2.25 backend_conn - Backend conn. success
316739 7.00 10.57 backend_reuse - Backend conn. reuses
910 0.00 0.03 backend_toolate - Backend conn. was closed
317652 8.00 10.60 backend_recycle - Backend conn. recycles
584 0.00 0.02 backend_retry - Backend conn. retry
3 0.00 0.00 fetch_head - Fetch head
314040 9.00 10.48 fetch_length - Fetch with Length
4139 0.00 0.14 fetch_chunked - Fetch chunked
5 0.00 0.00 fetch_close - Fetch wanted close
386 . . n_sess_mem - N struct sess_mem
55 . . n_sess - N struct sess
313452 . . n_object - N struct object
313479 . . n_objectcore - N struct objectcore
38474 . . n_objecthead - N struct objecthead
368 . . n_waitinglist - N struct waitinglist
12 . . n_vbc - N struct vbc
61 . . n_wrk - N worker threads
344 0.00 0.01 n_wrk_create - N worker threads created
2935 0.00 0.10 n_wrk_queued - N queued work requests
1 . . n_backend - N backends
47 . . n_expired - N expired objects
149425 . . n_lru_moved - N LRU moved objects
1 0.00 0.00 losthdr - HTTP header overflows
461727 10.00 15.41 n_objwrite - Objects sent with write
239468 8.00 7.99 s_sess - Total Sessions
541129 13.00 18.06 s_req - Total Requests
64678 3.00 2.16 s_pipe - Total pipe
5346 0.00 0.18 s_pass - Total pass
318187 9.00 10.62 s_fetch - Total fetch
193589421 3895.84 6459.66 s_hdrbytes - Total header bytes
4931971067 14137.41 164569.09 s_bodybytes - Total body bytes
117585 3.00 3.92 sess_closed - Session Closed
2283 0.00 0.08 sess_pipeline - Session Pipeline
892 0.00 0.03 sess_readahead - Session Read Ahead
458468 10.00 15.30 sess_linger - Session Linger
414010 9.00 13.81 sess_herd - Session herd
36912073 880.96 1231.68 shm_records - SHM records
该服务器自过去9小时以来一直在运行。我知道随着时间的推移,缓存的内容会越来越多,所以缓存命中率会更好,但现在我关心的是您在服务器性能方面的中间帮助
Hitrate ratio: 10 100 613
Hitrate avg: 0.2703 0.3429 0.4513
239479 8.00 7.99 client_conn - Client connections accepted
541129 13.00 18.06 client_req - Client requests received
157594 1.00 5.26 cache_hit - Cache hits
3 0.00 0.00 cache_hitpass - Cache hits for pass
313499 9.00 10.46 cache_miss - Cache misses
67377 4.00 2.25 backend_conn - Backend conn. success
316739 7.00 10.57 backend_reuse - Backend conn. reuses
910 0.00 0.03 backend_toolate - Backend conn. was closed
317652 8.00 10.60 backend_recycle - Backend conn. recycles
584 0.00 0.02 backend_retry - Backend conn. retry
3 0.00 0.00 fetch_head - Fetch head
314040 9.00 10.48 fetch_length - Fetch with Length
4139 0.00 0.14 fetch_chunked - Fetch chunked
5 0.00 0.00 fetch_close - Fetch wanted close
386 . . n_sess_mem - N struct sess_mem
55 . . n_sess - N struct sess
313452 . . n_object - N struct object
313479 . . n_objectcore - N struct objectcore
38474 . . n_objecthead - N struct objecthead
368 . . n_waitinglist - N struct waitinglist
12 . . n_vbc - N struct vbc
61 . . n_wrk - N worker threads
344 0.00 0.01 n_wrk_create - N worker threads created
2935 0.00 0.10 n_wrk_queued - N queued work requests
1 . . n_backend - N backends
47 . . n_expired - N expired objects
149425 . . n_lru_moved - N LRU moved objects
1 0.00 0.00 losthdr - HTTP header overflows
461727 10.00 15.41 n_objwrite - Objects sent with write
239468 8.00 7.99 s_sess - Total Sessions
541129 13.00 18.06 s_req - Total Requests
64678 3.00 2.16 s_pipe - Total pipe
5346 0.00 0.18 s_pass - Total pass
318187 9.00 10.62 s_fetch - Total fetch
193589421 3895.84 6459.66 s_hdrbytes - Total header bytes
4931971067 14137.41 164569.09 s_bodybytes - Total body bytes
117585 3.00 3.92 sess_closed - Session Closed
2283 0.00 0.08 sess_pipeline - Session Pipeline
892 0.00 0.03 sess_readahead - Session Read Ahead
458468 10.00 15.30 sess_linger - Session Linger
414010 9.00 13.81 sess_herd - Session herd
36912073 880.96 1231.68 shm_records - SHM records
你在用什么?如果答案是“无”,那么你可能没有获得很好的命中率。在一个新的安装中,Varnish对于它所缓存的内容是相当保守的(这是正确的),但您可能可以通过阅读来改进问题。如果安全的话,您可以有选择地取消cookie设置,并使用VCL规范化请求,这将减少后端调用
你的网站有多少是可缓存的?对象缓存是否足够大?如果你能回答这两个问题,那么你应该能够通过Varnish获得很高的命中率。我使用VCL只缓存图像、Java脚本和css文件。由于该系统是由非常旧的ZenCart版本构建的,因此效率不高,每次请求都会发送cookie。我试图去掉cookies,并尝试缓存其他页面,但不幸的是,它产生了问题,因为ZenCart使用这些cookies做了很多事情。现在我的缓存命中率是总请求的40%。我知道这不好,但好像有东西总比没有好。在这种情况下,您可能应该看看Varnishist varnishtop和varnishlog中包含的工具,以了解什么是缓存,以及您是否可以改进任何东西。例如,
varnishtop-i RxURL
将向您显示请求的顶级URL,以下内容将为您提供所有缓存未命中的详细信息:varnishlog-o VCL_调用“^miss”-i VCL_调用,VCL_返回,ObjStatus,RxURL,Backend