Limit of maximal open sockets on debian testing.

M

Michael Kurz

Hi,

I use my ruby application as server and it seems that it can only open about
1024 sockets (files) at once.
(linux debian testing)

How can I change this?


Regards
Michael
 
T

Tanaka Akira

Michael Kurz said:
I use my ruby application as server and it seems that it can only open about
1024 sockets (files) at once.
(linux debian testing)

How can I change this?

Use ulimit or a similar builtin in your shell.

# ulimit -n
1024
# ruby -e 'fs=[]; loop { fs<<open(".") } rescue p fs.length'
1017
# ulimit -n 10000
# ruby -e 'fs=[]; loop { fs<<open(".") } rescue p fs.length'
9993
# cat /etc/debian_version
3.1

Note that you need a root privilege to increase hard limits.
 
Z

Zed A. Shaw

You'll also run into a similar limit if you use select for multi-plexing
IO. Depending on the platform, this may be 256 (BSD?), but usually
1024.

I'm not aware of any standard ulimit modifiers for this as it is
generally a space setting on the fd sets used in select.

Zed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top