Re: [squid-users] Optimising squid cache for USB flash drives

From: Eliezer Croitoru <>
Date: Sat, 21 Jul 2012 06:11:03 +0300

On 7/20/2012 5:17 PM, haggismn wrote:
> Hi all,
> I am a bit of a noob with squid, as well as USB flash storage, so please
> bear with me.
> I have squid up and running on a USB equipped dd-wrt router. I have plugged
> in a 8gb USB flash drive, of which 4gb are allocated for the squid cache.
> Currently I am using mostly default settings, ie cache_dir ufs
> /mnt/sda1/cache 4096 16 256
> I am aware that by using a USB flash drive with squid, the lifespan of the
> drive will be greatly decreased, due to the limited number of write cycles
> each block on the disk has. I was therefore wondering if it is possible to
> set up the caching so that it reduces the number of writes made onto the
> disk. I have been looking at options like minimum_object_size, which I have
> set to 8 KB, thus reducing the number of small files written. Will this help
> in any way? Are there other measure I can take which might help? I have been
> looking at using COSS storage, with a low max-stripe-waste, with the
> intention that this might reduce write frequency. As far as I can tell, this
> will write to the disk in 1MB chunks. Might this help by any chance? Are
> there any other measures that might help, for example formatting the flash
> drive in a certain way (although likely limited to FAT32).
dont think about the lifespan of the drive because if they die they die.
cache is "by all means possible write to disk what you can" excluding
the ram cache.
this is the basic idea of cache.
USB flash drives are not that fast compared to many HD but can still be
faster then the link you have.
the basic thing is to disable logging which you dont really need to
store on most of wrt devices.
the "minimum_object_size" is not important in this case (my opinion).
COSS is not being used anymore and there is a rockstore something.
anything is better then fat32 in you case of linux OS.
the reiser FS is ment for lots and lots of small files.
ext2/3/4 and reiser fs has an option of "noatime" that can reduce some
drive access but it has a risk of corruption the FS.
in you case of 4GB cache it really not suppose to be a big deal if you
will loose it unless you have more data on it.
i dont remember exactly but the size of the cache dir suppose to be in
use with your ram size and for a DD-wrt device that dosnt have much ram
4gb of cache dir will might not be a good idea.


> Any information would be greatly appreciated.
> Thanks in advance
> --
> View this message in context:
> Sent from the Squid - Users mailing list archive at

Eliezer Croitoru
IT consulting for Nonprofit organizations
eliezer <at>
Received on Sat Jul 21 2012 - 03:11:12 MDT

This archive was generated by hypermail 2.2.0 : Sat Jul 21 2012 - 12:00:03 MDT