[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: [LI] Problem with squid....




Hi!
I'm new to the list so I dont know if the Q on max no of open files has already been answered, or not. Please excuse me if I'm repeating it...

Kanwar had asked:
> the
> > problem lies in the max open inodes and files. What i'd like someone to
> > help
> > me out with is how do i increase these limits? For instance, open files
> has
> > a max limit of 256 which i'd like to be at least 4096 or higher...

The max limit of open files (for a process) is currently defined to be 1024 in /usr/src/linux/include/linux/limits.h

[reX@penguin linux]# grep 'define NR_OPEN' -r /usr/src/linux
./include/linux/fs.h:#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */ ./include/linux/fs.h.orig:#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */
./include/linux/limits.h:#define NR_OPEN                1024

This value of NR_OPEN is used in the process table structure (struct task_struct). File descriptotrs are assigned to files via the fd[] field in the "struct files_struct files[1]" substructure
which has the following four components:

int count;
fd_set close_on_exec;
fd_set open_fds;
struct file * fd[NR_OPEN];

Here open_fds contains a bit mask of all the file descriptors which are open.
so, you can  have a 2^16 open files in Kernel 2.2.5-15


> As a extension to above question wanted to know, how in general we can
> manipulate all the kernel parameters.
>
> Kishore ---

We can manipulate /all/ kernel parameters by tweaking the source code, which we have the prevelige of having for free!
Kernel parameters can also be specified at LILO boot time as parameters.

hope this helps,
Rohit


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.