[squid-users] Is it safe to resize a rock storage file?

Alex Rousskov rousskov at measurement-factory.com
Mon Oct 16 14:59:23 UTC 2017


On 10/16/2017 06:26 AM, duanyao wrote:

> Is it safe to resize a rock storage file as follow (while squid is not
> running)?
> 
> 1) Increase a rock storage file by increasing the size specified in the
> configuration file;

I would recommend running truncate after this as well because that is
what Squid does when it initializes the database (squid -z).


> 2) Decrease a rock storage file by decreasing the size specified in the
> configuration file and run `truncate --size <new size> rock_file`;
> 
> By "safe" I mean no rubbish data will ever be delivered to clients after
> resizing, while loss of some cached data is OK.

I have not tested this, but I believe the above operations are safe to
perform while Squid is not running. The second operation may generate
many warnings during Squid startup as Squid discovers and complains
about corrupted entries.

Alex.


More information about the squid-users mailing list