Score:0

When building a proxy server on ubuntu, please tell me about the parameters that need to be tuned in relation to the OS system

et flag

When building a proxy server on ubuntu, please tell me about the parameters that need to be tuned in relation to the OS system.

I am migrating squid running on redhat linux to ubuntu. The settings set the parameters when running on rhel, but when running on ubuntu

squid[1966]: WARNING! Your cache is running out of filedescriptors#012 listening port: 8080

I got an alert, and the performance of squid did not come out. This didn't happen when I was running on rhel.

Apparently, the maximum number of filedescriptors for squid is 1024, and it seems that no more processing can be done. When operating as a server on ubuntu, as a parameter that needs to be tuned in relation to these OS systems Please tell me what kind of things are there.

Score:0
in flag

Assuming you are running a modern version of Ubuntu, you will need to make some changes to the number of files that can be open at any given time. Be sure to confirm that your server has enough RAM installed to handle all of the files and also ensure that you have a large amount of swap space available in the event the memory is consumed. Memory mismanagement can cause the server to lock up.

DISCLAIMER:

You will be making changes to the number of files that can be open for processing simultaneously. This will have an immediate impact on the mount of RAM that is set aside for buffers and how much swap you may need. You — and only you — are the only person who is able to determine ahead of time how much memory your system needs to have dedicated for RAM and swap to ensure your Squid installation does not bring the server down.

With that out of the way, you will need to edit three files and reboot to resolve the cache issue. Here's how you do it:

  1. Connect to the server (if not already connected)

  2. Edit the limits.conf file:

    sudo {editor of choice} /etc/security/limits.conf 
    

    Note: Be sure to replace {editor of choice} with your editor of choice.

  3. Add the following line to the bottom of the configuration file:

    * - nofile 65535
    

    This changes the number of open files for every user to 65,535. DO NOT EXCEED THIS NUMBER unless you know exactly what you're doing and why. Bad things will happen if this number is higher than your system can handle.

  4. Save the file and exit the editor

  5. Edit the squid system configuration file:

    sudo {editor of choice} /etc/sysconfig/squid
    

    Note: Be sure to replace {editor of choice} with your editor of choice.

  6. Add the following line to the bottom of the configuration file:

    ulimit -n 65535
    

    This changes the number of open files Squid can have to 65,535. DO NOT EXCEED THIS NUMBER unless you know exactly what you're doing and why. Bad things will happen if this number is higher than your system can handle.

  7. Save the file and exit the editor.

  8. Edit the squid.conf configuration file:

    sudo {editor of choice} /etc/squid/squid.conf
    

    Note: Be sure to replace {editor of choice} with your editor of choice.

  9. Add the following line to the bottom of the configuration file:

    max_filedescriptors 65535
    

    Note: This number should not exceed the value you are using for ulimit.

  10. Save the file and exit the editor

  11. Reboot

Depending on what you are using Squid for, how much memory is installed on the server, how many other services are running, and how busy the system is overall, you should no longer see the cache warning.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.