Search squid archive

Re: Enable caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Alex,

Thank you for the explanations.

Could you tell me if there is a way to view the objects (URLs) and their statuses stored in the rock file?
I tried unsuccessfully to find this information using squidclient in mgr:menu.

You gave me a very useful link: https://wiki.squid-cache.org/Features/LargeRockStore
Maybe there is a more detailed description of the internal rock data structures?
I could try to write a script that reads the necessary information from the cache_dir file.

Kind regards,
     Ankor.


ср, 5 апр. 2023 г. в 16:27, Alex Rousskov <rousskov@xxxxxxxxxxxxxxxxxxxxxxx>:
On 4/5/23 06:07, Andrey K wrote:

> Previously, caching was disabled on our proxy servers. Now we need to
> cache some content (files about 10 MB in size).
> So we changed the squid.conf:

> cache_dir ufs /data/squid/cache 32000 16 256 max-size=12000000
>
> We have 24 workers on each proxy.

UFS-based cache_dirs are not supported in multi-worker configurations
and, in most cases, should not be used in such configurations. The
combination will violate basic HTTP caching rules and may crash Squid
and/or corrupt responses.


> We saw that some requests were taken from the cache, and some were not.
> The documentation says:
> "In SMP configurations, cache_dir must not precede the workers option
> and should use configuration macros or conditionals to give each worker
> interested in disk caching a dedicated cache directory."

The official documentation quoted above is stale and very misleading in
modern Squids. Ignore it. I will try to find the time to post a PR to
fix this.


> So we switched to a rock cache_dir:
> cache_dir rock /data/squid/cache 32000 max-size=12000000
>
> Now everything seems to be working fine in the test environment, but I
> found limitations on the RockStore
> (https://wiki.squid-cache.org/Features/RockStore:
> "Objects larger than 32,000 bytes cannot be cached when cache_dirs are
> shared among workers."

The Feature/RockStore page is stale and can easily mislead. In general,
Feature/Foo wiki pages are often development-focused and get stale with
time. They cannot be reliably used as a Squid feature documentation.


> Does this mean that RockStore is not suitable for caching large files?

No, it does not. Rock storage has evolved since that Feature page was
written. You can see the following wiki page discussing evolved rock
storage design, but that page probably has some stale info as well:
https://wiki.squid-cache.org/Features/LargeRockStore


> Should I switch back to the UFS and configure 24 cache_dirs

If everything is "working fine", then you should not. Otherwise, I
recommend discussing specific problems before switching to that
unsupported and dangerous hack.


HTH,

Alex.

_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users
_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux