The OpenNET Project / Index page

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

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

"Нехватка файловых дескрипторов (FreeBSD 4.5 и Squid 2.5.STAB..."
Сообщение от Begemoth Искать по авторуВ закладки on 10-Дек-02, 18:16  (MSK)
Squid при Configure выдает, что в системе мало файловых дескрипторов (324). У меня в инет ползают порядка 20 человек. Как увеличить количество дескрипторов и надо ли это делать? Кстати ядро я скомпилил с максимальным количеством юзеров равным 10 (maxusers 10), может в этом дело?
  Рекомендовать в FAQ | Cообщить модератору | Наверх

 Оглавление

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

1. "RE: Нехватка файловых дескрипторов (FreeBSD 4.5 и Squid 2.5...."
Сообщение от lavr emailИскать по авторуВ закладки on 10-Дек-02, 20:17  (MSK)
>Squid при Configure выдает, что в системе мало файловых дескрипторов (324). У
>меня в инет ползают порядка 20 человек. Как увеличить количество дескрипторов
>и надо ли это делать? Кстати ядро я скомпилил с максимальным
>количеством юзеров равным 10 (maxusers 10), может в этом дело?

уже не помню:

sysctl -a | grep files

дальше станет понятно, ну и /etc/login.conf и man login.conf

man tuning все прояснит


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

2. "RE: Нехватка файловых дескрипторов (FreeBSD 4.5 и Squid 2.5...."
Сообщение от noname Искать по авторуВ закладки on 11-Дек-02, 07:25  (MSK)
А в факе это все есть.


11.4 Running out of filedescriptors

If you see the Too many open files error message, you are most likely running out of file descriptors. This may be due to running Squid on an operating system with a low filedescriptor limit. This limit is often configurable in the kernel or with other system tuning tools. There are two ways to run out of file descriptors: first, you can hit the per-process limit on file descriptors. Second, you can hit the system limit on total file descriptors for all processes.

FreeBSD

by Torsten Sturm

How do I check my maximum filedescriptors?

Do sysctl -a and look for the value of kern.maxfilesperproc.

How do I increase them?


        sysctl -w kern.maxfiles=XXXX
        sysctl -w kern.maxfilesperproc=XXXX


Warning: You probably want maxfiles > maxfilesperproc if you're going to be pushing the limit.
What is the upper limit?

I don't think there is a formal upper limit inside the kernel. All the data structures are dynamically allocated. In practice there might be unintended metaphenomena (kernel spending too much time searching tables, for example).

General BSD

For most BSD-derived systems (SunOS, 4.4BSD, OpenBSD, FreeBSD, NetBSD, BSD/OS, 386BSD, Ultrix) you can also use the ``brute force'' method to increase these values in the kernel (requires a kernel rebuild):

How do I check my maximum filedescriptors?

Do pstat -T and look for the files value, typically expressed as the ratio of currentmaximum/.

How do I increase them the easy way?

One way is to increase the value of the maxusers variable in the kernel configuration file and build a new kernel. This method is quick and easy but also has the effect of increasing a wide variety of other variables that you may not need or want increased.

Is there a more precise method?

Another way is to find the param.c file in your kernel build area and change the arithmetic behind the relationship between maxusers and the maximum number of open files.

Reconfigure afterwards

NOTE: After you rebuild/reconfigure your kernel with more filedescriptors, you must then recompile Squid. Squid's configure script determines how many filedescriptors are available, so you must make sure the configure script runs again as well. For example:


    cd squid-1.1.x
        make realclean
        ./configure --prefix=/usr/local/squid
        make

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

3. "RE: Нехватка файловых дескрипторов (FreeBSD 4.5 и Squid 2.5...."
Сообщение от Begemoth Искать по авторуВ закладки on 11-Дек-02, 11:26  (MSK)
Мужики, все оказалось гораздо проще. Как я и думал, перекомпиляция ядра с параметром maxusers=64 а не maxusers=10 дало прирост файловых дескрипторов с 324 до 2088! :)
  Рекомендовать в FAQ | Cообщить модератору | Наверх


Удалить

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




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

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