How to increase the limit of the varnish log

loggingvarnish

i want to increase the log limit of the varnish cache server , as i see when i write the log to a file it only give me about 13k of requests , i want to increase it to something like 1 million for a high traffic site , so i can save the log every 10 mins .

i know varnish can run as Demon and write the logs on run time , but i don't need this

so is there anyway to increase the varnish log limit to a higher value ?

Best Answer

You can set the size of Varnish shared memory log buffer with the -l shmlogsize parameter:

-l shmlogsize Specify size of shmlog file. Scaling suffixes like 'k', 'm' can be used up to (e)tabytes. Default is 80 Megabytes. Specifying less than 8 Megabytes is unwise.

You can read about Varnish startup parameters in the official varnishd documentation. Depending on your OS or Linux distribution you will either have to edit the /etc/init.d/varnish script or distribution specific config files (e.g. /etc/default/varnish on Debian).

Bear in mind that writing varnish logs to disk on a high traffic site will eventually produce a large amount of disk I/O, even if you write a huge log buffer every couple of minutes, this will produce load too. If you do not need full logging you can use a daemonized varnishlog process with a filter that selects only the requests you are interested in, thus reducing the need file I/O.

Related Topic