Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sometimes on a busy Pressflow site I notice a timeout for unauthenticated users while the server's port is far from being saturated, there is plenty of unused memory and the server load is very low.

In addition to that, the bandwidth usage of the site has dropped by about %30 since I moved to the new Varnish-powered server with new configurations. Hence I doubt the drop might be because of Varnish's mal-configurations.

Here are some relevant parameters:

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"

# And here is the latest output of 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

So here are my question: How should I know whether Varnish threads have been saturated? How should I manipulate the parameters to increase the throughput? Thanks

share|improve this question

1 Answer 1

I mostly recommand tuning thread_pool_min and thread_pool_max, the other values do not help too much. -p thread_pools=2 \ -p thread_pool_min=500 \ -p thread_pool_max=5000 \

Specifically setting thread_pools to the numbers of CPUs does not help at all and might slow down your machine. It's just a guess, but maybe that already fixes your issue! :)

You will find very good explanations here: https://www.varnish-software.com/static/book/Tuning.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.