increasing open file limit?

increasing open file limit?

Post by Dustin Purye » Wed, 28 Mar 2001 03:05:40



Hello, I have found that under Linux 2.2 the maximum number of files that can
be opened is 1024. I want to increase this limit as it is a bit unrealistic
for our network server (the application should be able to open up a few
thousand sockets and maintain the connections).

I believe I read somewhere that this was doable, but quite painful. Is that
true? Has anyone solved this problem another way?

I was unsure if this should go to comp.os.linux.development.system or here,
so I just took a guess. :) Also, I could not find a FAQ for this ng at
www.faq.org. If one exist, and covers this topic, please alert me.

Regards, Dustin

--

http://members.telocity.com/~dpuryear
Integrate Linux Solutions into Your Windows Network
- http://www.prima-tech.com/integrate-linux

 
 
 

increasing open file limit?

Post by John Li » Wed, 28 Mar 2001 13:35:42


As root you can set system resources limit, if you want increase number of
opened file, just call setrlim, like fowlling:
/****************************************************
struct rlimit   rl;

rl.rlim_cur = rl.rlim_max = 3000;
setrlimit(RLIMIT_NOFILE, &rl);
****************************************************/

--
John Liu
640K thought to be enough for anybody.
        (Bill Gates, Microsoft, 1981)
http://www.may10.ca


> Hello, I have found that under Linux 2.2 the maximum number of files that
can
> be opened is 1024. I want to increase this limit as it is a bit
unrealistic
> for our network server (the application should be able to open up a few
> thousand sockets and maintain the connections).

> I believe I read somewhere that this was doable, but quite painful. Is
that
> true? Has anyone solved this problem another way?

> I was unsure if this should go to comp.os.linux.development.system or
here,
> so I just took a guess. :) Also, I could not find a FAQ for this ng at
> www.faq.org. If one exist, and covers this topic, please alert me.

> Regards, Dustin

> --

> http://members.telocity.com/~dpuryear
> Integrate Linux Solutions into Your Windows Network
> - http://www.prima-tech.com/integrate-linux


 
 
 

increasing open file limit?

Post by Dustin Purye » Thu, 29 Mar 2001 07:48:23



>As root you can set system resources limit, if you want increase number of
>opened file, just call setrlim, like fowlling:
>/****************************************************
>struct rlimit   rl;

>rl.rlim_cur = rl.rlim_max = 3000;
>setrlimit(RLIMIT_NOFILE, &rl);
>****************************************************/

I still have a problem that FD_SETSIZE is set to 1024 under Linux 2.2. I found
a document describing changes to /etc/security/limits.conf, /etc/pam.d/login,
and /proc/sys/fs/file-max and .../inode-max that allow me to open > 1024
files. However, how do I get around the select() issue?

Regards, Dustin

--

http://members.telocity.com/~dpuryear
Integrate Linux Solutions into Your Windows Network
- http://www.prima-tech.com/integrate-linux

 
 
 

increasing open file limit?

Post by Victo » Thu, 29 Mar 2001 11:49:02


You can change /proc/sys/fs/file-max (sometimes also inode-max) to expand
the system's limitation.
Then use "ulimit -HSn [number]" to change current user's limitation(you must
be a root).
And you can change FD_SETSIZE in "/usr/include/bits/types.h" to get around
the select() issue.

--


----------------------------------------------
http://www.baidu.com
?Behind Your e-Success!?



> >As root you can set system resources limit, if you want increase number
of
> >opened file, just call setrlim, like fowlling:
> >/****************************************************
> >struct rlimit   rl;

> >rl.rlim_cur = rl.rlim_max = 3000;
> >setrlimit(RLIMIT_NOFILE, &rl);
> >****************************************************/

> I still have a problem that FD_SETSIZE is set to 1024 under Linux 2.2. I
found
> a document describing changes to /etc/security/limits.conf,
/etc/pam.d/login,
> and /proc/sys/fs/file-max and .../inode-max that allow me to open > 1024
> files. However, how do I get around the select() issue?

> Regards, Dustin

> --

> http://members.telocity.com/~dpuryear
> Integrate Linux Solutions into Your Windows Network
> - http://www.prima-tech.com/integrate-linux

 
 
 

increasing open file limit?

Post by Dustin Purye » Fri, 30 Mar 2001 04:58:43



>You can change /proc/sys/fs/file-max (sometimes also inode-max) to expand
>the system's limitation.
>Then use "ulimit -HSn [number]" to change current user's limitation(you must
>be a root).
>And you can change FD_SETSIZE in "/usr/include/bits/types.h" to get around
>the select() issue.

Ah. I found that there are two definitions for FD_SETSIZE (__FD_SETSIZE). One
is in /usr/include/bits/types.h and the other in
/usr/include/linux/posix_types.h. By changing those to 4096 I could increase
my possible connections when using select().

Why is this value initially so low under Linux?

Regards, Dustin

--

http://members.telocity.com/~dpuryear
Integrate Linux Solutions into Your Windows Network
- http://www.prima-tech.com/integrate-linux

 
 
 

1. increasing open file limit

We are working with Linux and have hit a snag. We are performing some
tests and require our application to open a few thousand files at a
time. (We are looking to open approx. 4096.) By inspecting ulimit we
have found that the hard-limit seems to be 1024 file descriptors per
user:

core file size (blocks)  1000000
data seg size (kbytes)   unlimited
file size (blocks)       unlimited
max memory size (kbytes) unlimited
stack size (kbytes)      8192
cpu time (seconds)       unlimited
max user processes       256
pipe size (512 bytes)    8
open files               1024
virtual memory (kbytes)  2105343

The limit specified by /usr/src/linux/include/linux/limits.h per process
is:

#define OPEN_MAX         256    /* # open files a process may have */

We need to increase this limit from 256 per process to 4096 (or even
higher) for testing purposes. How can this be done? I assume I can do a
kernel recompile, but I would rather just flip a switch somewhere in a
configuration file, /proc, or something similar if possible.

Regards, Dustin

---
Dustin Puryear

Sent via Deja.com
http://www.deja.com/

2. Two simple questions

3. open files limit: how to increase?

4. Netscape Cookies questions

5. Open File Limit of 20 files per user on PLEXUS

6. Dosemu 0.53 won't compile

7. Increase File size limit for VI editor... How?

8. How can I remove the "Too many login attempts" lock ?

9. Increasing file size limit

10. File limit maximum increase

11. Increasing OS limit of file descriptors

12. increase file descriptors # limit

13. how to increase file limit per process?