Problem
My application returns SOCKET accept failed [errno 126] when I try to open over 200 sockets every second.
Cause
From /usr/include/sys/errno.h we can see that error 126 refers to:
#define EADDRNOTAVAIL 126 /* Can't assign requested address */This is not defined in "man 3 accept" but is in "man tcp": [EADDRNOTAVAIL]
When an attempt is made to create a socket with a network address for which no network interface exists
Solution
There are a number of steps we can take to try to alleviate the problem:
1. Visit https://ftp.scoexpert.com/unixware7/drivers/network/ for a list of the latest network drivers available for your Network Interface Card (NIC).
2. Visit https://ftp.scoexpert.com/unixware7 for a list of the latest patches for UnixWare7.
3. You may wish to turn off network services not being used by the
server from /etc/rc2.d. For example, SENDMAIL.
More information on this can be found from TA 111865,
"How do I tune my UnixWare 7 server to run Tarantella?"4. TCP/IP TuningThe following values can be increased to improve TCP/IP performance:
ulimit:# ulimit unlimited(tcp_2msl)The tcp_2msl parameter defines the time connections will remain
in TIME_WAIT state - see RFC793. By default the value is 240
(4minutes). It can be reduced to 30 seconds with the following:inconfig tcp_2msl 30(tcp)"tcp" is the maximum number of simultaneous tcp connections on a server.
The configuration file is in /etc/conf/sdevice.d (3rd field)The factory default is 1000 and the maximum can be set to 4096.
The limitation is related to select() /FD_SETSIZE which limits the number of File Descriptors (FD) opened to 4096.
"man 3 select" states:The behavior of these macros is undefined if a descriptor value is less than zero or greater than or equal to FD_SETSIZE. FD_SETSIZE is a constant defined in sys/select.h.
In UnixWare 7 and previous releases of UnixWare, its value
was 1024. FD_SETSIZE was increased to 4096 in UnixWare 7
Release 7.0.1. See ``Notices''.(ticots)/dev/ticots is typically invoked as the implied device in a call to socket or as the first argument in a call to t_open and is used to identify the transport protocol that will supply a connection-based transport service.
Basically, ticots is the module which is opened when you open a connection-oriented Unix domain socket.
The configuration file is in /etc/conf/sdevice.d (3rd field)The factory default is 256 and the maximum can be set to 8192.
(ticlts)This appears to be the connectionless Unix domain socket (AF_UNIX,SOCK_DGRAM)
The configuration file is in /etc/conf/sdevice.d (3rd field)The factory default is 256 and the maximum can be set to 1000.
(ticotsor)This is the connection-oriented unix domain sockets (UDS) with "orderly release".
The configuration file is in /etc/conf/sdevice.d (3rd field)The factory default is 256 and the maximum can be set to 1000.
"ticots", and "ticotsor" are connection-oriented loopback transport provider that is used for unix domain sockets within a system, rather than over a network. "ticlts" is actually connectionless.
There is another tuneable ipport_reserved_high which increases the number of allowed privileged ports. You can try increasing it to 2048.
NOTE: The factory default values may change per release. See also
ta111586, "Understanding, debugging and tuning UnixWare 7
telnet connections."ta111865, "How do I tune my UnixWare 7 server to run Tarantella?" select(3C)