The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  ВХОД  слежка  RSS
"Squid-2.5 delay pools"
Вариант для распечатки Архивированная нить - только для чтения! 
Пред. тема | След. тема 
Форумы OpenNET: Виртуальная конференция (Public)
Изначальное сообщение [Проследить за развитием треда]

"Squid-2.5 delay pools"
Сообщение от Cyclone emailИскать по авторуВ закладки on 05-Мрт-03, 00:20  (MSK)
Народ снимите меня с ручника пожалуйста, хоть документации и масса, но я всё никак не могу въехать.

Есть канал 128К. Надо организовать справедливый делёж канала между двумя сетями. То есть надо в сеть 192.168.0.0 отдавать 96К а в сеть 192.168.1.0 32К, и в то же время давать разные ограничения на один IP в этих сетях.

Теперь, что не понятно:
1. тип delay_class - что конкретно значит каждый тип.
2. delay_parameters - что конкретно значат цифры которые тут стоят?

Заранее спасибо

  Рекомендовать в FAQ | Cообщить модератору | Наверх

 Оглавление

Индекс форумов | Темы | Пред. тема | След. тема
Сообщения по теме

1. "RE: Squid-2.5 delay pools"
Сообщение от crash Искать по авторуВ закладки on 05-Мрт-03, 06:30  (MSK)
в самом конфиге очень хорошие комментарии, и там все ясно...

  Рекомендовать в FAQ | Cообщить модератору | Наверх

2. "RE: Squid-2.5 delay pools"
Сообщение от iiws Искать по авторуВ закладки on 05-Мрт-03, 08:05  (MSK)
>Народ снимите меня с ручника пожалуйста, хоть документации и масса, но я
>всё никак не могу въехать.
>
>Есть канал 128К. Надо организовать справедливый делёж канала между двумя сетями. То
>есть надо в сеть 192.168.0.0 отдавать 96К а в сеть 192.168.1.0
>32К, и в то же время давать разные ограничения на один
>IP в этих сетях.
>
>Теперь, что не понятно:
>1. тип delay_class - что конкретно значит каждый тип.
>2. delay_parameters - что конкретно значат цифры которые тут стоят?
>
>Заранее спасибо

delay_pools 1
delay_class 1 2
delay_access 1 allow setka1
delay_access 1 deny all
delay_parameters 1 48000/96000 1000/2000

48000/96000 - параметр для всей сети, после скачки 96кб общая скорость будет понижена до 48кб/сек.
файлы до 2к будут скачиваться на максимальной скорости для этого пула в данном случае на скорости 96кб/cек или 48кб, которые больше 2к на скорости 1кб/сек . так я понимаю параметры delay pool, если ошибся поправьте.

тебе имхо лучше так сделать
delay_pools 2
delay_class 1 2
delay_class 2 2
delay_access 1 allow setka1
delay_access 1 deny all
delay_access 2 allow setka2
delay_access 2 deny all
delay_parameters 1 96000/96000 4000/4000
delay_parameters 2 32000/32000 2000/2000

пул номер 1 ведро на всех в 96кб, каждый ip будет сосасть на скорости не более 4кб/сек
пул номер 2 - ведро на всех в 32кб, каждый ip будет сосасть на скорости не более 2кб/сек

но ты должен учесть, что весь канал 128кб ты отдал сквиду, а у тебя еще есть почтовый трафик , dns трафик и др.... Поэтому весь канал сквиду отдавать не cтоит  . Уменьши параметр 96 или 32 или оба, например так
delay_parameters 1 72000/72000 4000/4000
delay_parameters 2 24000/24000 2000/2000

удачи

  Рекомендовать в FAQ | Cообщить модератору | Наверх

6. "RE: Squid-2.5 delay pools"
Сообщение от Cyclone emailИскать по авторуВ закладки on 06-Мрт-03, 20:52  (MSK)
>но ты должен учесть, что весь канал 128кб ты отдал сквиду, а
>у тебя еще есть почтовый трафик , dns трафик и др....
>Поэтому весь канал сквиду отдавать не cтоит  . Уменьши параметр
>96 или 32 или оба, например так
>delay_parameters 1 72000/72000 4000/4000
>delay_parameters 2 24000/24000 2000/2000


Спасибо большое, теперь мне понятно. Сделал так - всё пашет.
Но теперь получились другие грабли - при обращении на локальный вэб сервер 192.168.0.1 скорость тоже ограничена. Как сделать чтоб локальный сайт не попадал под эти ограничения?


  Рекомендовать в FAQ | Cообщить модератору | Наверх

7. "RE: Squid-2.5 delay pools"
Сообщение от iiws Искать по авторуВ закладки on 07-Мрт-03, 07:02  (MSK)
>>но ты должен учесть, что весь канал 128кб ты отдал сквиду, а
>>у тебя еще есть почтовый трафик , dns трафик и др....
>>Поэтому весь канал сквиду отдавать не cтоит  . Уменьши параметр
>>96 или 32 или оба, например так
>>delay_parameters 1 72000/72000 4000/4000
>>delay_parameters 2 24000/24000 2000/2000
>
>
>Спасибо большое, теперь мне понятно. Сделал так - всё пашет.
>Но теперь получились другие грабли - при обращении на локальный вэб сервер
>192.168.0.1 скорость тоже ограничена. Как сделать чтоб локальный сайт не попадал
>под эти ограничения?

или сделай для него отдельный аксель c одним ip и не пихай его в пул
или читай фак насчет сквида в качестве httpd акселератора .
вообще-то все в факах на сайте сквида есть, советую тебе его основательно почитать.   http://www.squid-cache.org/Doc/FAQ/FAQ.html


  Рекомендовать в FAQ | Cообщить модератору | Наверх

3. "RE: Squid-2.5 delay pools"
Сообщение от Igor Искать по авторуВ закладки on 05-Мрт-03, 10:44  (MSK)
Вот неплохое описание алгоритма и концепций. Прошу прощения у автора -
я не помню источник.
======================================================================
Well, I think that delay pools is one of the most useful features of Squid,
addressed to manageable teams of users, so I will try to give a brief
explanation of how it works. I have not been involved in the development, so
David please correct me where I am wrong:

Delay pools are meant to provide a way of assigning tokens of bandwidth
allowance to Squid users. Pools are assigned on a host basis (IP), which
basically means that what you restrict is the WAN bandwidth pumped by Squid
for any individual host accessing the Net through it.
I am beginning from the most general case, which is the allowance for a
group of hosts (a block of IP addresses).
An individual host may be part of a group or be a group in itself.

In delay pools there are four basic parameters to be defined:
1) aggregate_max
2) aggregate_restore
and
3) individual_max
4) individual_restore

In order to understand the meaning of each parameter I will briefly explain
the concept behind delay pools:
For every host in one group there is one delay pool size descriptor
(individual_max) and one increment level (individual_restore) associated.
We can think delay pools as a bucket of tokens (bytes). The size of the
bucket (for one host) is individual_max bytes. At any given time, the bucket
can have at max that many tokens (bytes) accumulated. Before Squid fetches a
page for that host, it looks up the number of tokens (bytes) available at
the bucket. Let's call it the current bucket watermark. If there are enough
tokens in the bucket, Squid gets the tokens it needs, lowers the bucket
watermark accordingly and proceeds to reading a number of bytes from the
connection. If there are no tokens available, Squid is enforced to defer the
read, until some tokens (bytes) are available within the bucket. How is this
done? This is where the increment level value comes into play:
individual_restore defines the number of tokens (bytes) added to the current
bucket watermark level every second.
To further visualise it, think of a real bucket under a faucet: the bucket
can hold a certain amount of water (e.g. 1 litre). The faucet drops a
certain amount of water each second (for example 10 cl).
We start with the bucket filled of water, but as we start taking water off
the bucket with a glass, the available water goes down. If we want to keep a
steady watermark level we must take water with the same rate it is dropping
from the faucet. If we have a higher rate, the bucket will soon become
empty, and then we will have to wait until the faucet has dropped enough
water in the bucket again.
If we do not use any water for some time the water will overflow the bucket,
therefore the bucket will continue to have at most 1 litre of water for
immediate use.
At telecomm parlance, this is a variation of the leaky bucket algorithm (no
wonder why I used the bucket as an example)! It will (?)be used for
bandwidth policing in modern data networks (ATM for example).

How to configure the delay pools in Squid now:
At first decide what kind of grouping you need. If you want all your users
to have only one bucket then you go for delay_class1.
If you want to have separate buckets for each user then you must opt for
delay_class2 or class3 (depends on your network).
The Aggregate_* settings work almost the same way as the individual with one
distinction: in class 2 (this is what I use) and class3 the aggregate delay
pool is used only if no individual pool is defined.
IMHO I think that it would be more efficient if the aggregate delay pool
could provide tokens if an individual pool ran out of tokens at a certain
time. (This could be an additional measure to accommodate bursts for some
users).

If you decide that you need class2 then remember to put the statement
acl all src 0.0.0.0/0.0.0.0
delay_class1_access deny all
At present it is needed in order to allow class2/class3.

Assume that you want class2 delay pools. Then you need something like the
following:

acl hosts src xxx.xxx.xxx.a-xxx.xxx.xxx.b/255.255.255.255
delay_class2_access allow  hosts

#delay_class2_aggregate_max 32000    
#delay_class2_aggregate_restore 2000

delay_class2_individual_max  24000
delay_class2_individual_restore 1200

This defines a block of hosts with IP addresses in the Class C net from a to
b (but you can add also other individual hosts to the acl)
that will share the following pool settings:
Maximum pool size 24000 bytes
Increment level 1200 bytes

I don't use the aggregate settings because they do not have any effect when
individual pools are set.
The individual settings more or less let the host fetch "immediately" pages
that are slightly larger than 24000 bytes. If the host tries to fetch a
large page then Squid after the initial burst (~24KB) it will slow down to
the rate defined by the increment value defined by
"delay_class2_individual_restore" (i.e. 1200 bytes/sec).
If you do not want to allow for any burstiness in the delay pool then simply
define the max size of the pool equal to the restore size. (but this is
already documented).

Right now, you can have only one effective delay pool setting. This means
that you cannot set more than one group of users in the same class. I hope
that David will find the time to extend delay pools in order to handle more
than one type of host groups in one class. In my view this is necessary.
After using delay pools for some time now, I strongly think that it is a
powerful add-on to Squid. I think that if it is extended to handle multiple
groups (with different pool settings in each group) its value will be really
leveraged.


Cheers,

Evaghelos.
=========================================================================

  Рекомендовать в FAQ | Cообщить модератору | Наверх

4. "RE: Squid-2.5 delay pools"
Сообщение от dima emailИскать по авторуВ закладки on 05-Мрт-03, 14:00  (MSK)
Еще одно питання вдогонку. Я вот слышал, что при передергивании  сквида
squid -k reconfigure
все delay pools сбрасываются, и если клиент не закрыл броузер - у него нет ограничений, он ходит по полному каналу.
Это правда?
  Рекомендовать в FAQ | Cообщить модератору | Наверх

5. "RE: Squid-2.5 delay pools"
Сообщение от iiws Искать по авторуВ закладки on 05-Мрт-03, 15:17  (MSK)
>Еще одно питання вдогонку. Я вот слышал, что при передергивании  сквида
>
>squid -k reconfigure
>все delay pools сбрасываются, и если клиент не закрыл броузер - у
>него нет ограничений, он ходит по полному каналу.
>Это правда?

есть такое дело, но не совсем так. пока новая сессия браузером не установится, новые настройки delay pool не работают, а установится она имхо при очередном рефреше. При закачке каким-либо менеджером будет сосать во всю дудку, поскольку сессия установлена, а настройка delay была сброшена. Так было до версии 2.5. В 2.5.1 не проверял, надо бы проверить, может уже поправлено.

  Рекомендовать в FAQ | Cообщить модератору | Наверх


Удалить

Индекс форумов | Темы | Пред. тема | След. тема
Пожалуйста, прежде чем написать сообщение, ознакомьтесь с данными рекомендациями.




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру