📜 ⬆️ ⬇️

Squid for the smallest. Part 2. Customization

Good day.
This is a continuation of the Squid article for the smallest.
In this part, I will tell you about what basic parameters need to be changed, although not necessary, because the developers of the SQUID themselves set the lion's share of values ​​pretty well. So let's start in order ...
Since I often work through an ssh connection, sometimes on some servers there is a disgusting speed, in connection with this problem I recommend writing everything at the very beginning of the config, which gives it a fairly well readable look, and you don’t need to search for all values. Although, I want to note that all minor parameters (except ACL access lists and a couple of others) are not set in the default config. In fact, the default parameter is registered, and it has a comment. So we do not have to look for each parameter. BUT (!!!) if you already ruled, then you do not need to start writing everything at the very top, you need to find the commented values ​​and change them. Go.

The first thing I advise you to note, at least for the duration of the test, is the shutdown_lifetime parameter by default, it has a value of 30 seconds, which is very long. I will give an example, sometimes it happens that you missed something, and the Internet at the whole office disappeared, you quickly changed your mistake, but the squid itself after you sent it a SIGTERM or SIGHUP (reboot) is waiting for the time that is in this parameter during which the new connections will not be established, and the old ones must complete the download. I usually put:
shutdown_lifetime 5
The following parameters will be the parameters describing the cache cache_dir, maximum_object_size
So, if we have a normal gateway, which are proxied by the Internet, and there are enough computers in the organization> 30, then we need to install at least 2 gigabytes, although two are in principle enough for most. The cache_dir parameter has many parameters, I do not want to dwell on them, for all this is perfectly described in mana. I only glimpse what I consider the most rational, the standard 256 MB are no good at all :)
cache_dir ufs / var / squid / cache 2048 16 256
after that, you need to re-create directories with the Squid -z command, which will erase all of our previous cache.

maximum_object_size tells the squib whether to write files larger than a certain size.
maximum_object_size 10024 , it seems to me that this is quite enough, then some can be fished out of the cache. Sometimes it is useful if your employees download the latest version, for example, Adobe Flash Player.
')
Visible_hostname "% Hostname %"

Board



That seems to be all. As I have already said that everything is already well tuned in a squid, and I don’t need to worry ... I want to share one very wonderful advice that I could save a lot of time is the command
squid -k reconfigure
With this command, the squid will re-read its config file and apply it. Now you will not need to constantly restart the squid. Even if you still have errors in the config, a squid will swear at them, but it will remain to work on the previous version of the config that is in memory.
In the next part I plan to talk about delay pools in an accessible and alternate language, the way I understood it all ... Like everything else ...
If you meet some kind of accuracy, do not kick much, I write from memory ...
Threat there is a very different manual on the parameters of the SQUID www.bog.pp.ru/work/squid.html , I advise everyone to scroll through it. You will learn a lot of things, or maybe something interesting will be found.
ZYY Wow ... sort of had time, until karma went to minus ...))
Crosspost from my blog

Source: https://habr.com/ru/post/56290/


All Articles