Adjust the number of files opened when squid is under heavy pressure

Source: Internet
Author: User
Adjust the number of files opened when squid is under heavy pressure-Linux Enterprise Application-Linux server application information. The following is a detailed description. When squid is under high pressure, it is found that the cause is that the maximum file descriptor opened by linux users is 1024 by default, and the traffic is not enough, squid performance decreases sharply, today we met the first time and checked it for one afternoon.

The solution is as follows:

The default value of squid 2.6 is max_filedesc 16384.

However, since the default linux version is different, linux only has 1024, so we need to change it.

Linux controls the number of opened files.

# Ulimit-Hn 63355 and write it into/etc/rc. local. Then start squid.

How to check the file descriptor used by squid

# Squidclient-p 80-U manager-W squidstats mgr: info

Output result:

File descriptor usage for squid:
Maximum number of file descriptors: 16384
Largest file desc currently in use: 169
Number of file desc currently in use: 132
Files queued for open: 0
Available number of file descriptors: 16252
Reserved number of file descriptors: 100
Store Disk files open: 39
IO loop method: epoll

The maximum file descriptor is 16384. Currently, the maximum file descriptor used is 169. A total of 132 file descriptors are used.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.