SMP-Workers + Rock Cache not caching as much as SMP-Workers + AUFS

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SMP-Workers + Rock Cache not caching as much as SMP-Workers + AUFS

Lucolo
Hi everybody

I'm having some problems trying to best tune efficient web caching with
Squid.

After several configurations I realized that in my case SMP-Workers + AUFS
is more efficiente than SMP-Workers + Rock Cache.

I tried to use the same parameters and options in both cases, just to make
sure no options was different, apart from Rock or AUFS.

These are my files:
Workers + AUFS:
squid_SMP_Workers_AUFS.conf
<http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/squid_SMP_Workers_AUFS.conf>  

Workers + Rock Cache:
squid_CARP_SMP_Workers_Rock.conf
<http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/squid_CARP_SMP_Workers_Rock.conf>  
frontend.conf
<http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/frontend.conf>  
backend.conf
<http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/backend.conf>  

For example, my outputs:

Cache information for squid SMP-Workers + AUFS:
        Hits as % of all requests:      5min: 19.3%, 60min: 24.6%
        Hits as % of bytes sent:        5min: 8.6%, 60min: 13.3%
        Memory hits as % of hit requests:       5min: 0.0%, 60min: 0.0%
        Disk hits as % of hit requests: 5min: 65.1%, 60min: 66.4%
Files: Number of file desc currently in use: 6971

Cache information for squid SMP-Workers + Rock Cache:
        Hits as % of all requests:      5min: 4.6%, 60min: 5.3%
        Hits as % of bytes sent:        5min: 0.8%, 60min: 0.6%
        Memory hits as % of hit requests:       5min: 12.2%, 60min: 11.7%
        Disk hits as % of hit requests: 5min: 22.7%, 60min: 21.7%
Files: Number of file desc currently in use: 7366

The question is, is there any plus config or option I have to configure in
rock cache to force more web caching, at least the same as AUFS
configuration?

I actualy have 2 proxy servers, one configuration each. The two of them have
same hardware:
- centos-release-7-6.1810.2.el7.centos.x86_64
- 32 GB RAM
- 4 disk, 2 TB each, 8 TB in total
- Squid compilation info
configure options:  '--build=x86_64-redhat-linux-gnu'
'--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib64' '--libexecdir=/usr/libexec'
'--sharedstatedir=/var/lib' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--exec_prefix=/usr'
'--libexecdir=/usr/lib64/squid' '--localstatedir=/var'
'--datadir=/usr/share/squid' '--sysconfdir=/etc/squid'
'--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid'
'--disable-dependency-tracking' '--enable-follow-x-forwarded-for'
'--enable-auth'
'--enable-auth-basic=DB,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB,getpwnam,fake'
'--enable-auth-ntlm=fake' '--enable-auth-digest=file,LDAP,eDirectory'
'--enable-auth-negotiate=kerberos,wrapper'
'--enable-external-acl-helpers=wbinfo_group,kerberos_ldap_group,LDAP_group,delayer,file_userip,SQL_session,unix_group,session,time_quota'
'--enable-cache-digests' '--enable-cachemgr-hostname=localhost'
'--enable-delay-pools' '--enable-epoll' '--enable-icap-client'
'--enable-ident-lookups' '--enable-linux-netfilter'
'--enable-removal-policies=heap,lru' '--enable-snmp'
'--enable-storeio=aufs,diskd,ufs,rock' '--enable-wccpv2' '--enable-esi'
'--enable-security-cert-generators' '--enable-security-cert-validators'
'--enable-icmp' '--with-aio' '--with-default-user=squid'
'--with-filedescriptors=16384' '--with-dl' '--with-openssl'
'--enable-ssl-crtd' '--with-pthreads' '--with-included-ltdl'
'--disable-arch-native' '--without-nettle'
'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu'
'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  
-m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro ' 'CXXFLAGS=-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -fPIC'
'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
--enable-ltdl-convenience

Thanks in advance.





--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: SMP-Workers + Rock Cache not caching as much as SMP-Workers + AUFS

Amos Jeffries
Administrator
On 6/02/19 11:14 pm, Lucolo wrote:
> Hi everybody
>
> I'm having some problems trying to best tune efficient web caching with
> Squid.
>
> After several configurations I realized that in my case SMP-Workers + AUFS
> is more efficiente than SMP-Workers + Rock Cache.

Do you understand why that is?


>
> I tried to use the same parameters and options in both cases, just to make
> sure no options was different, apart from Rock or AUFS.
>
> These are my files:
> Workers + AUFS:
> squid_SMP_Workers_AUFS.conf
> <http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/squid_SMP_Workers_AUFS.conf>  
>
> Workers + Rock Cache:
> squid_CARP_SMP_Workers_Rock.conf
> <http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/squid_CARP_SMP_Workers_Rock.conf>  
> frontend.conf
> <http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/frontend.conf>  
> backend.conf
> <http://squid-web-proxy-cache.1019090.n4.nabble.com/file/t377658/backend.conf>  
>

Er, those are vastly different configurations. The cache_dir parameters
may be the same, but the traffic flowing through has major differences.

The AUFS setup:
 - 4 workers operating independent of each other in full parallel.
 - any sized object allowed to cache.
 - TCP connection based load balancing by the OS.

The Rock setup:
 - all traffic funneled through one worker
 - 4 workers operating with shared caches.
 - objects larger than 131072 bytes not permitted to cache.
 - CARP load balancing selectively channels objects by URL to particular
worker.



> For example, my outputs:
>
> Cache information for squid SMP-Workers + AUFS:
>         Hits as % of all requests:      5min: 19.3%, 60min: 24.6%
>         Hits as % of bytes sent:        5min: 8.6%, 60min: 13.3%
>         Memory hits as % of hit requests:       5min: 0.0%, 60min: 0.0%
>         Disk hits as % of hit requests: 5min: 65.1%, 60min: 66.4%
> Files: Number of file desc currently in use: 6971
>
> Cache information for squid SMP-Workers + Rock Cache:
>         Hits as % of all requests:      5min: 4.6%, 60min: 5.3%
>         Hits as % of bytes sent:        5min: 0.8%, 60min: 0.6%
>         Memory hits as % of hit requests:       5min: 12.2%, 60min: 11.7%
>         Disk hits as % of hit requests: 5min: 22.7%, 60min: 21.7%
> Files: Number of file desc currently in use: 7366

Those numbers need to be placed in context of how much traffic is going
through each proxy.

For some reason you are not getting any memory hits in the AUFS setup.
Whereas >10% of the traffic in the rock setup is not being slowed down
by the disk access.


>
> The question is, is there any plus config or option I have to configure in
> rock cache to force more web caching, at least the same as AUFS
> configuration?

That question does not make much sense. There is no option to force
caching with AUFS - so "at least the same" is already true in regards to
what you are asking for.


You missed out the rest of the squid -v output which says what
particular version and vendor build (or not) you are using.


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: SMP-Workers + Rock Cache not caching as much as SMP-Workers + AUFS

Lucolo
Hi Amos

First of all, thank for your response.

I am more interested in having proper working rock cache

as you said:

The Rock setup:
 - all traffic funneled through one worker. *is it supposed to work that
way?*
 - 4 workers operating with shared caches. *That's correct, I assume.*
  - CARP load balancing selectively channels objects by URL to particular
worker.

I follow your manual just to configure "CARP Cluster of SMP workers with
rock", so I assume this is a working configuration
https://wiki.squid-cache.org/ConfigExamples/SmpCarpCluster
<https://wiki.squid-cache.org/ConfigExamples/SmpCarpCluster>  

Since it's the basic configuration Squid recommends, I don't see much
efficiency in using this kind of configuration.


The info missing in the previus post were:

# squid -v
Squid Cache: Version 4.4
Service Name: squid
This binary uses OpenSSL 1.0.2k-fips  26 Jan 2017.

Traffic in each proxy is around 1 Gb and 6K connections.

Thanks




--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: SMP-Workers + Rock Cache not caching as much as SMP-Workers + AUFS

Alex Rousskov
On 2/7/19 01:21, Lucolo wrote:

> I follow your manual just to configure "CARP Cluster of SMP workers with
> rock", so I assume this is a working configuration
> https://wiki.squid-cache.org/ConfigExamples/SmpCarpCluster

FWIW, that old configuration should not be used except, perhaps, in some
highly unusual/rare use cases. You are probably _not_ dealing with such
a case.


> Since it's the basic configuration Squid recommends,

It is not basic and it is not generally recommended (despite being
published on a Squid wiki).

Most modern SMP setups should use multiple workers and multiple Rock
diskers, without SMP macros in squid.conf. The exact number of workers
and diskers depends on the number of physical CPU cores, desired hit
ratio, and actual workload -- there is no "one size fits all" formula.
However, you may be able to start with

   W=C-2
   D=1

where W is the number of SMP workers, D is the number of rock cache_dir
lines (i.e. the number of diskers), and C is the "number of otherwise
idle physical CPU cores" on the Squid box. If your disker becomes
overloaded, increase D (and probably decrease W) and/or reduce disk
load. You can find more information at

   * https://wiki.squid-cache.org/Features/SmpScale

   * The tuning section of
     https://wiki.squid-cache.org/Features/RockStore

Alex.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: SMP-Workers + Rock Cache not caching as much as SMP-Workers + AUFS

Lucolo
Thanks Rousskov

I'll take a look and try to re-configure again in that way.





--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users