On 27/09/2013 6:07 p.m., Ding Guigeng wrote:
Dear all:
i created a vm.
it has 1 cpu with 2 cores,2G ram.
when i set the below in squid.conf:
workers 2
cache_dir rock /cache1 20480 max-size=10240 swap-timeout=1000
max-swap-rate=100
cache_dir rock /cache2 20480 max-size=10240 swap-timeout=1000
max-swap-rate=100
cache_dir aufs /cache3 10240 16 256
the squid runs very slow.
if something wrong i made?
Yes. The Rock dir are fine. The AUFS type do not yet support SMP so
until that is implemeted you need to add some more syntax to prevent the
workers causing trouble to each other in the AUFS cache.
We provide if, else, endif directives and ${process_number} maros to
wrap worker-specific configuration details.
Option #1: only worker #1 has an AUFS directory
if ${process_number} = 1
cache_dir aufs /cache3 10240 16 256
endif
Option #2: both workers have AUFS but different locations
if ${process_number} = 1
cache_dir aufs /cache3 10240 16 256
endif
if ${process_number} = 2
cache_dir aufs /cache4 10240 16 256
endif
Option #3: small optimization on option #2 where the workers have
separate sub-dir inside cache3 directory.
cache_dir aufs /cache3/${process_number}/ 10240 16 256
Note that option #2 and #3 will use 2x more cache_dir space for 2
workers than 1 worker.
Amos