Operating System - HP-UX
1820595 Members
1312 Online
109626 Solutions
New Discussion юеВ

maximum number of sockets by any process

 
SOLVED
Go to solution
Shivkumar
Super Advisor

maximum number of sockets by any process

How many maximum number of sockets can be opened on hpux 11.00 or 11.11i? Is there any limit to any particular process that they can't use beyond certain number of sockets connection ?

Thanks,
Shiv
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: maximum number of sockets by any process

I don't know of any limits except for mathematical limits.

There is some discussion on this in other threads.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=205605

I got this by searching for socket limit hp-ux in the itrc search engine.

Perhaps someone else will have an exact answer for you.

The limits I am familiar with have to do with processes. maxuprc for example the maximum number of processes for any one user, default 75 I usually bump it up to 200.

If the new socket requires a process, this could be a problem. If not, you have some reading to do.

:-)

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: maximum number of sockets by any process

Hi Shiv:

System wide you are limited by 'tcp_conn_request_max'. You can see and or (re)set this value by using 'ndd'.

# ndd -get tcp_conn_request_max

...to show the value

# ndd -h tcp_conn_request_max

...to show the ranges allowed

# ndd -set tcp_conn_request_max >value>

...to set the value

See the 'ndd' manpages for the details.

On a process basis, the listen() call used to setup a TCP socket connection. The maximum number of connections is limited to the maxiumum value of 'tcp_conn_request_max' and the listen() specification. See also the manpages for listen(2).

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: maximum number of sockets by any process

Hi (again) Shiv:

Sorry, I forgot the network_device argument in the 'ndd' I posted above. To get/set use:

# ndd -get /dev/tcp tcp_conn_request_max

# ndd -set /dev/tcp tcp_conn_request_max

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: maximum number of sockets by any process

James missed the device file:

ndd -get /dev/tcp tcp_conn_request_max

I believe every socket use a file descriptor too so the ulimit value -n (sh-posix, not available in ksh yet) will limit your process. ulimit -n is a soft limit set by the kernel parameter maxfiles. You may change this with the standard HP-UX POSIX shell with ulimit:

ulimit -Sn 500

It is recommended to use -S to set a soft limit which will allow ulimit to increase the value in the current environment. Without -S, ulimit makes the value a hard limit which can only be changed downward at a later time. ulimit is a shell builtin and it can be used in a shell script to set the limit for processes run from the script.

The second limit is maxfiles_lim which is the system-wide limit for maxfiles. ulimit (or the program library call setrlimit) can't set the file descriptor limit higher than maxfiles_lim. It is good system practice to limit maxfiles to a low value if you have developers that might create a runaway program, and use ulimit only when necessary.

The last limit is nfile, the kernel parameter for all open files. maxfiles exists to help avoid exceeding nfile. If you have a program that needs to open 500 socket connections and the program will be run 10 times, nfile will have to be increased by 5000 to accomodate all the sockets.


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: maximum number of sockets by any process

Hi Shiv:

It seems I can't type. I should have written:

For any process, the maximum number of connections is limited to the MINIMUM value of 'tcp_conn_request_max' and the listen() specification.

Regards!

...JRF...

[ no points for this correction, please ]
rick jones
Honored Contributor

Re: maximum number of sockets by any process

Alas, tcp_conn_request_max does NOT control the maximum number of sockets for a process. All it does is provide a limit on the number of connections which can be queued to a listen socket, awaiting an accept() call. (The limit being the minimum of tcp_conn_request_max and what is passed-in in the call to listen() - ftp://ftp.cup.hp.com/dist/networking/briefs/annotated_ndd.txt


Sockets consume file descriptors. As such, they are limited by the same tunables that limit file descriptors:

maxfile/maxfile_lim for per-process
nfile for system-wide
there is no rest for the wicked yet the virtuous have no pillows
James R. Ferguson
Acclaimed Contributor

Re: maximum number of sockets by any process

Hi Rick!

I stand corrected, with thanks! I appreciate, too, the link to the network tunables.

Regards!

...JRF...

/* NO POINTS PLEASE */