Find the answer to your Linux question:
Results 1 to 9 of 9
Hi guys, I've set up Squid on our local network about 8 months ago. Our users do a LOT of web browsing in their line of work. Having went through ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Location
    Cape Town, South Africa
    Posts
    10

    Squid proxy - poor efficiency


    Hi guys,

    I've set up Squid on our local network about 8 months ago. Our users do a LOT of web browsing in their line of work. Having went through various squid efficiency and performance guides, I set it up for what I at the time assumed was the best efficiency.

    However, I checked the logs recently with an efficiency analyzer, and discovered that only 7% of all LAN browsing traffic were hits and come from the cache, the other 93% were all misses and came directly from the Internet itself.

    Would it help if I post my version of the squid config file here? Maybe you guys can make a few suggestions based on that?

  2. #2
    Just Joined!
    Join Date
    Aug 2006
    Location
    Cape Town, South Africa
    Posts
    10
    By the way, as a sidenote: According to the efficiency analyzer, 55% of all browsing REQUESTS were cache hits, but only 7% of all TRAFFIC were cache hits.

  3. #3
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Can you give the details of your cache and some stats of your network usage.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Aug 2006
    Location
    Cape Town, South Africa
    Posts
    10
    What do you mean by details of the cache? As for network usage, in this particular LAN there are about 5 computers browsing constantly, mostly doing graphic design work (thereby visiting the same picture gallery sites over and over again).

    Total bandwidth used per day by the office is between 350 and 500mb.

  6. #5
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    The squid cache is quite similar to a processor's cache. There are levels in that cache and you can specify the structure of a cache there. Depending upon the usage stats you should choose an appropriate lay-out for the cache.

    Since the daily usage averages to about 300-350 MB then its a good idea. Look at squid.conf for more details on the cache structure. The CS department in my univ uses a bandwidth of 100MB per user each week and typically people are using google search and downloading research papers etc..... So we use a cache like this.....
    Code:
    cache_mem 1GB
    cache_swap_low 90
    cache_swap_high 95
    maximum_object_size 4 MB
    maximum_object_size_in_memory 512 KB
    cache_dir ufs /extra/squid_cache/squid1 4000 16 256
    cache_dir ufs /extra/squid_cache/squid2 4000 16 256
    cache_dir ufs /extra/squid_cache/squid3 4000 16 256
    cache_dir ufs /extra/squid_cache/squid4 4000 16 256
    cache_dir ufs /extra/squid_cache/squid5 4000 16 256
    etc.....

    Since the same picture gallary is being used by everybody its a good idea to change the cache replacement policy to LRU. Hope this helps you.

    Note that you need to play with the cache design a lot before you pin down an optimal value.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  7. #6
    Just Joined!
    Join Date
    Aug 2006
    Location
    Cape Town, South Africa
    Posts
    10
    We are already using LRU - but I did make a few other adjustments - thanks for the help!

    I have a question though: I noticed that you're using 5 cachedirs. Is there any specific reason for using 5 dirs of 4GB each instead of 1 dir of 20GB?

  8. #7
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Quote Originally Posted by Aeros View Post
    Is there any specific reason for using 5 dirs of 4GB each instead of 1 dir of 20GB?
    I think there is no specific reason behind this. But I am trying to find that out by contacting older sys-admins (they are passed out and its difficult to get in touch with them) but when I joined the team and saw five cache dirs all I did was to increase their sizes.....(legacy matters I suppose)
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  9. #8
    Just Joined!
    Join Date
    Aug 2006
    Location
    Cape Town, South Africa
    Posts
    10
    apoorv,

    What's your refresh_pattern directive look like? Because if I'm not mistaken, that's what controls how strict the caching is.

    Can anyone make some solid recommendations as to what refresh_pattern should be?

  10. #9
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Quote Originally Posted by Aeros View Post
    apoorv,
    What's your refresh_pattern directive look like? Because if I'm not mistaken, that's what controls how strict the caching is.
    Thats us
    Code:
    refresh_pattern ^ftp:           1440    20%     10080
    refresh_pattern ^gopher:        1440    0%      1440
    refresh_pattern .               0       20%     4320
    Those are the default values I suppose.
    Last edited by apoorv_khurasia; 06-05-2007 at 05:21 PM. Reason: value--->values (grammer)
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •