[linux] apache a fd

Jan 'JaSan' Sarenik jasan na x31.com
Neděle Červenec 25 21:38:46 CEST 2004


  Ahoj!

> A este by som bol rad, keby mi niekto vysvetlil vyznam tychto cisel, lebo 
> som to nikde nemohol najst... Je v /proc este nieco, co sa tyka otvorenych 
> suborov?
> 
> cat /proc/sys/fs/file-nr
> 4678    3011    104856
> 
> cat /proc/sys/fs/file-max
> 104856

Ako prve ma napadlo ze ked tam mas take velke cisla ci nebude
daky overflow, ale dajme tomu ze nie. Zo suboru
linux/Documentation/filesystems/proc.txt som vytiahol takyto
popis suborov, ktore spominas:

file-nr and file-max
--------------------
The kernel  allocates file handles dynamically, but doesn't free them again at
this time.

The value  in  file-max  denotes  the  maximum number of file handles that the
Linux kernel will allocate. When you get a lot of error messages about running
out of  file handles, you might want to raise this limit. The default value is
10% of  RAM in kilobytes.  To  change it, just  write the new number  into the
file:

  # cat /proc/sys/fs/file-max
  4096
  # echo 8192 > /proc/sys/fs/file-max
  # cat /proc/sys/fs/file-max
  8192

Historically, the three values in file-nr denoted the number of allocated file
handles,  the number of  allocated but  unused file  handles, and  the maximum
number of file handles. Linux 2.6 always  reports 0 as the number of free file
handles -- this  is not an error,  it just means that the number of allocated
file handles exactly matches the number of used file handles.

Attempts to  allocate more  file descriptors than  file-max are  reported with
printk, look for "VFS: file-max limit <number> reached".
--------------%<---------------

Dufam ze Ti to pomoze. A odporucil by som predsa skusit do
file-max dat mensiu hodnotu (napr. nieco stvorciferne).

  Prajem vsetkym pekny den!
   S pozdravom
    Janko
-- 
http://www.x31.com/~jasan




Další informace o konferenci linux