0

I have Varnish 5.1.1 on Centos 6.5 and want to Use a fresh SSD for file storage, (my RAM 64GB get full quickly as I have a lot of objects to cache)

As said in Varnish Doc I have mounted a tmpfs partition for the working directory :

"The shmlog usually is located in /var/lib/varnish and you can feel free to remove any data found in this directory if needed. Varnish suggests make sure this location is mounted on tmpfs by using /etc/fstab to make sure this gets mounted on server reboot / start."

I have a dedicated 256 GB SSD drive for cache storage. Do I have to mount it as tmpf with noatime like working dir ? I did not find any suggestion on how to configure SSD for Varnish needs.

kollo
  • 1,285
  • 3
  • 20
  • 33

2 Answers2

0

No, you do not have to mount anything special if you're just going to use your SSD. tempfs is specific for a RAM drive only, and if you're not going to take advantage of the superior speed of RAM over SSD, then leaving /var/lib/varnish as is on the default install is good enough.

Ray
  • 82
  • 7
  • I have seen somewhere that it is better to mount ext4 or non-journaled partition to avoid too much writes on disk while reading because it would reduce SSD lifetime. https://superuser.com/questions/228657/which-linux-filesystem-works-best-with-ssd/ . So I don't think it is a good idea to not digg into this. – kollo Mar 30 '17 at 09:01
0

/var/lib/varnish is used for logging, and Varnish logs a lot of data. Since it uses a circular buffer, size isn't an issue, however the I/O will wear your disks down.

TL;DR: always mount the work directory as tmpfs.