Re: [squid-users] Urgent Help Needed: Any suggestion on CPU utiliztion increased from 73% to 97.5 after cache_mem increased from 4 GB to 8 GB

From: Arkin Y <arkin.yang_at_gmail.com>
Date: Sun, 15 Jun 2008 10:57:25 +0800

Henrik , Neil ,
Thanks a lot for your response !!
I got several times sent mail failure notice , so I resend it again .
hope you could get it .

Acctually , I tried to use Linux OS default malloc, gnu malloc , dlmalloc,
dlmalloc could help me get the best performance among the three different
malloc .
I checked all my mgr:info log , when I set the cache_mem to different size ,
the stroe entries are different too .
When the cache memory is 4GB , the Store Entries are ~519396
When the cache memory is 6 GB , the StoreEntries are ~776836
When the cache memory is 8 GB , the StoreEntries are ~1026097
The average size of the stored objects almost ~8KB, so I am not sure
whether such problem was caused by large objects .
In the mean time , the request rate to the squid was about 2500
requests per second .
I checked a hash_lookup method , If in the worst cases in 8G scenario,it
looks like almost 2 times of hash keys will be traversed to get the
storeEntry than in 4 G scenario.
Is it a possible reason ?
Or any other suggestion ?
void *
hash_lookup(hash_table * hid, const void *k)
{
  hash_link *walker;
  int b;
  assert(k !=3D NULL);
  b =3D hid->hash(k, hid->size);
  *for (walker =3D hid->buckets[b]; walker !=3D NULL; walker =3D walker->=
next*)
{
      /* strcmp of NULL is a SEGV */
      if (NULL =3D=3D walker->key)
          return NULL;
if ((hid->cmp) (k, walker->key) =3D=3D 0)
   return (walker);
assert(walker !=3D walker->next);
  }
  return NULL;
Thanks ,
-Arkin
On Sat, Jun 14, 2008 at 5:25 PM, Henrik Nordstrom
<henrik_at_henriknordstrom.net> wrote:
> On lör, 2008-06-14 at 14:10 +0800, Arkin, Y wrote:
>
>> Configuration:
>> ./configure --enable-dlmalloc ...etc...
>
> Hmm.. don't use --enable-dlmalloc if you have more than 2 GB of memory,
> or at all if you have a reasonably modern OS.. (i.e. almost anything
> released this millenium)
>
>> one Squid instance is running on the cache server ,
>> squid .conf :
>> cache_mem 8192 MB
>> maximum_object_size_in_memory 2048 KB
>
> This may be the culpit. Squid-2 is very very poor at handling large
> objects in memory, wasting exponential amount of CPU the larger the
> object is..
>
> This is fixed in Squid-3.
>
> Regards
> Henrik
>
Received on Sun Jun 15 2008 - 02:57:27 MDT

This archive was generated by hypermail 2.2.0 : Sun Jun 15 2008 - 12:00:03 MDT