varnish tuning

Performance – Varnish

-p thread_pool_min=200 (default: 5)
-p thread_pool_max=4000 (default 1000)
-p thread_pool_add_delay=2 (default: 20ms, default in master: 2ms)
-p session_linger=100 OR MORE (default: 0ms in <= 2.0.4 and 50ms in > 2.0.4)
-s malloc,(YOURMEMORY-20%)G

4.1.1のデフォルト
thread_pool_min            100 [threads] (default)
thread_pool_max            5000 [threads] (default)
thread_pool_add_delay      0.000 [seconds] (default)

thread_pools * thread_pool_max < kern.threads.max_threads_per_proc

kern.ipc.nmbclusters=65536 (126184)
kern.ipc.somaxconn=16384 (128 kern.ipc.soacceptqueue)
kern.maxfiles=131072 (261364)
kern.maxfilesperproc=104856 (235224)
kern.threads.max_threads_per_proc=4096 (1500)

kern.ipc.maxsockets="131072" (261365)
kern.ipc.maxpipekva="104857600" (133816320)

括弧内はFreeBSD10.1のデフォルト値(環境によって異なる)

https://github.com/kurita0/varnish4-freebsd/blob/master/sysctl.conf