Performance issue with Squid proxy

Solution Verified - Updated -

Issue

  •     Client systems taking too much time to open a website when using squid proxy
  •     Errors reported on the server

       "WARNING! Your cache is running out of file descriptors"
    

Environament

  • RedHat Enterprise Linux 5.7
  • squid-2.6.STABLE21-6.el5

Resolution

  •     First of all to resolve the issue reported in errors, the file descriptor limits nedds to be increased by default the limit is 1042. This can be verified with below command:

                #squidclient  mgr:info | grep 'file descri'
    
  •     To increse the limit of file descriptors first increase open file limits by editing /etc/security/limits.conf, by default the limit is 1024. Open file limits can be checked with below command:

          #ulimit -n
    
  •     Edit the /etc/security/limits.conf file and increase the open files value to 4096 or 8192 as described below: (Example given is for 4096)

         *   -   nofile   4096
    
  •     logoff and relogin to system to check new limits. Also edit /etc/squid/squid.conf file simunteniously and append the file descriptor directive to 4096 or 8192.

         max_filedesc 4096
    
  •     After making changes restart the squid service and verified the changes with above commands.

  •     Cache_mem parameter is also playing a part in performance of the issue, by default squid is using 8 MB cache_mem . This can be increased as per the requirement to 16,32,64,128,216,512 etc.
  •     Restart Squid service after making every changes in the configuration file.
  •     If squid is not running on default port then below command will be used to check file-descriptors:

     #squidclient -p 8080 mgr:info | grep 'file descri'

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments