Maybe you are still in the dynamic content to get 7336.76 reqs/s throughput is excited, and so on, there is a gap between the ideal and the reality, you have to endure the cruelty of reality, don't forget, we stress test dynamic content is in full cache, that is, each request is hit cache, This is often impossible in reality.
First of all, the size of the buffer space is limited, and our site may have a large amount of content to be cached, unlike the previous stress test only one content. Once the buffer is filled, the cache manager eliminates some of the cached content that it deems no longer needed, such as by LRU (the least recent algorithm) to eliminate the cached content that is less frequently used, but it is not strict to judge the "infrequently used" criteria. Maybe the content of the elimination is the next thing you will visit, which affects the hit rate.
Second, the cache expiration time also affects its hit rate, if the validity period is very short, for 10 seconds, then at least 10 seconds will be unable to hit.
Also, some content may not be cached by the proxy server at all, such as the content contains Set-cookie HTTP header information, etc., causing the reverse proxy to not cache them, and will not go to the buffer when the browser requests them. This is an important factor affecting the hit rate, but it is often overlooked by us.
Fortunately, we can easily solve these problems, provided that we need to understand the real-time working state of the reverse proxy cache, such as varnish provides a command line State monitoring Program Varnishstat, we open it, we see the current moment of the state, as follows:
Client_conn 9908723 94.05 Client Connections Accepted
Client_drop 0 0.00 Connection dropped, no sess/wrk
Client_req 16433490 155.99 Client requests received
Cache_hit 8751732 83.07 Cache Hits
Cache_hitpass 42592 0.40 Cache hits for pass
Cache_miss 7573389 71.89 Cache misses
Backend_conn 3889845 36.92 Backend Conn. Success
Backend_unhealthy 0.00 Backend Conn. Not attempted
Backend_busy 0 0.00 Backend Conn. Too many
Backend_fail 4536 0.04 Backend Conn. Failures
Backend_reuse 3780212 35.88 Backend Conn. reuses
Backend_toolate 3866687 36.70 Backend Conn. was closed
Backend_recycle 7646677 72.58 Backend Conn. Recycles
Backend_unused 0 0.00 Backend Conn. Unused
Fetch_head 0.00 Fetch Head
Fetch_length 155097 1.47 Fetch with length
fetch_chunked 7508522 71.27 Fetch chunked
Fetch_eof 0 0.00 Fetch EOF
Fetch_bad 0 0.00 Fetch had bad headers
Fetch_close 3982 0.04 Fetch wanted close
Fetch_oldhttp 0 0.00 Fetch Pre http/1.1 closed
Fetch_zero 0 0.00 Fetch Zero len
Fetch_failed 0 0.00 Fetch Failed
N_sess_mem 1033. N struct SESS_MEM
N_sess 633. N struct Sess
N_object 1016443. N struct Object
N_vampireobject 0. N unresurrected Objects
N_objectcore 1017564. N struct Objectcore
N_objecthead 982903. N struct Objecthead
N_SMF 2647421. N struct SMF
N_smf_frag 622470. N Small Free SMF
N_smf_large 3. N Large Free SMF
N_vbe_conn 12. N struct Vbe_conn
N_wrk 8000. N worker Threads
N_wrk_create 8000 0.08 N worker threads created
N_wrk_failed 0 0.00 N worker Threads not created
N_wrk_max 11021 0.10 N worker Threads Limited
N_wrk_queue 0 0.00 N Queued Work requests
N_wrk_overflow 2441 0.02 N overflowed work requests
N_wrk_drop 0 0.00 N dropped work requests
N_backend 4. N backends
N_expired 6344546. N Expired Objects
N_lru_nuked 183957. N LRU nuked objects
N_lru_saved 0. N LRU saved objects
N_lru_moved 3692170. N LRU moved Objects
N_deathrow 0. N objects on Deathrow
LOSTHDR 0.00 HTTP Header Overflows
N_objsendfile 0 0.00 Objects sent with Sendfile
N_objwrite 15466812 146.81 Objects sent with write
N_objoverflow 0 0.00 Objects Overflowing workspace
S_sess 9906155 94.03 Total Sessions
S_req 16433490 155.99 Total Requests
S_pipe Notoginseng 0.00 Total Pipe
S_pass 108252 1.03 Total Pass
S_fetch 7667658 72.78 Total Fetch
S_hdrbytes 7187255662 68221.35 Total Header bytes
S_bodybytes 111592032839 1059230.32 Total Body bytes
Sess_closed 1905544 18.09 Session closed
Sess_pipeline 0 0.00 Session Pipeline
Sess_readahead 0 0.00 Session Read ahead
Sess_linger 15277717 145.02 Session Linger
Sess_herd 13547370 128.59 Session Herd
Shm_records 1028855796 9765.89 SHM Records
Shm_writes 77957008 739.97 SHM writes
Shm_flushes 131005 1.24 SHM flushes due to overflow
Shm_cont 144281 1.37 SHM MTX contention
Shm_cycles 427 0.00 SHM Cycles through buffer
Sm_nreq 15306717 145.29 Allocator Requests
Sm_nobj 2024948. Outstanding Allocations
Sm_balloc 13595295744. Bytes Allocated
Sm_bfree 40091795456. Bytes free
Sma_nreq 0 0.00 SMA Allocator Requests
Sma_nobj 0. SMA Outstanding Allocations
Sma_nbytes 0. SMA Outstanding bytes
Sma_balloc 0. SMA bytes Allocated
Sma_bfree 0. SMA bytes Free
Sms_nreq 14062 0.13 SMS Allocator requests
Sms_nobj 0. SMS Outstanding Allocations
Sms_nbytes 487. SMS Outstanding bytes
Sms_balloc 6844837. SMS bytes Allocated
Sms_bfree 6846298. SMS bytes Freed
Backend_req 7668789 72.79 Backend requests made
N_VCL 1 0.00 N VCL Total
N_vcl_avail 1 0.00 N VCL Available
N_vcl_discard 0 0.00 N VCL Discarded