Operating System - HP-UX
1752749 Members
5171 Online
108789 Solutions
New Discussion юеВ

Re: Kernel parameter for Max TCP Connections

 
Phani_4
Frequent Advisor

Kernel parameter for Max TCP Connections

Hi,

1. Do we have any kernel parameter which will set / restrict the threshold value for maximum TCP connections..?

If yes which kernel parameter we need to modify to have more TCP connections.

2. How can we check the number TCP connections opened on the server...any command ?

Regards,
Phani
6 REPLIES 6
Kent Ostby
Honored Contributor

Re: Kernel parameter for Max TCP Connections

I believe this is covered in a document available on the HP web site:

http://www.docs.hp.com/hpux/onlinedocs/1435/NFSPerformanceTuninginHP-UX11.0and11iSystems.pdf

The following points regarding NFS/TCP are discussed in this publicly
available document:

adb() tunables:

clnt_max_conns - page 48

maxthreads - page 49

timeo - avoid with TCP page 92

mount options - page 97/98

kernel parameters - page 109 - 113

max_thread_proc - page 111

nkthread - page 113

See also:

http://www1.itrc.hp.com/service/cki/search.do?category=c0&mode=id&searchString=4000033874&searchCrit=allwords&docType=EngineerNotes&docType=BugReports&docType=ThirdParty&search.x=14&search.y=11

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Sundar_7
Honored Contributor

Re: Kernel parameter for Max TCP Connections

Hi Phani,

1. You can set the tcp parameter tcp_conn_request_max using ndd.

# ndd -get /dev/tcp tcp_conn_request_max
# ndd -set /dev/tcp tcp_conn_request_max 1024

# vi /etc/rc.config.d/nddconf
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_conn_request_max
NDD_VALUE[0]=1024


2. # netstat -an | grep ESTABLISHED | wc -l

The above command should return the number of TCP connections established.

Sundar
Learn What to do ,How to do and more importantly When to do ?
KapilRaj
Honored Contributor

Re: Kernel parameter for Max TCP Connections

1. I think nfile parameter will do the trick as UNIX treats every socket as an open file ! Not sure though
2. Install lsof ; then lsof |grep -i TCP |grep "8080"|wc -l # If you are counting number of connection's.

Regds,

Kaps
Nothing is impossible
rick jones
Honored Contributor

Re: Kernel parameter for Max TCP Connections

The tunables you would need/want to alter will depend on how those connections will be managed. Some of this has already been mentioned, but I will try to get it all in one place.

First the easy stuff - as mentioned, nfile will need to be at least as large as the number of TCP connections you expect, plus whatever files you expect to be open and such.

Next, if you have a model of one process per connection (a model that I must say isn't really a very good one) then you will also need to make sure that nproc is as large as the number of TCP connections you expect. Related to that would be maxuproc.

If you are handling one connection per thread (still not what I would consider an optimal model), you need to set the thread parms to allow as many threads.

If you have a model with a process handling many TCP connections then you want to make sure that maxfiles and maxfiles_lim are set large enough to have that many TCP connections. Ditto if you have threads handling many connections each.

Now, for performance considerations, you may want to increase tcphashsz.

The ndd setting tcp_conn_request_max does not control the maximum number of TCP connections. It does however control the maximum number of _pending_ TCP connections that can be queued to any given listen endpoint. The need to increase this depends on the rate at which connections are established. If this parm and/or the value the application is passing for the backlog to listen (the actual limit will be the lesser of the two) is too small, netstat -p tcp will show connections being dropped due to full queue.

To see the number of TCP connections on the server you can do "netstat -an | grep tcp | wc -l" or you can do an ndd /dev/tcp tcp_status.
there is no rest for the wicked yet the virtuous have no pillows
Phani_4
Frequent Advisor

Re: Kernel parameter for Max TCP Connections

Hi Rick,

The parameter which you suggested "tcphashsz"...is this parameter available in HP-UX 10.20 ?

If yes, can you please suggest us, to which value we need set.

Please let me know..

Thanks,
Regards,
Phani
rick jones
Honored Contributor

Re: Kernel parameter for Max TCP Connections

Eghads - 10.20!?! Not the place to be these days...

...in that case, ignore all the stuff about threads since you don't have them. Also ignore all the ndd stuff. And the connections dropped due to full queue output of netstat will not be there.

There is no pleasant interface to changing tcp hash sizes under 10.20. If you go look at the old archived HP-UX SPECweb96 (96 not 99) results on www.spec.org you may find a way to tweak the hash table size in the tuning descriptions.
there is no rest for the wicked yet the virtuous have no pillows