Our system admin said
"Apache use a TCP port on each connection"
so A server can serve 65534 (MAX) simultaneously. is it Right?
I think Apache use only 80 or 443. But , he use many file descriptor (not ports) isn't it ?
/sbin/sysctl -a | grep fs.file-max
fs.file-max = 123456789
is max I think Could you give me some information about it ?
I think your system admin is slightly confused about what exactly a port and a file descriptor are.
Each server has 65536 ports numbered
0
through65535
. A program can listen on a port for requests from clients and process them accordingly. Only one program can listen on a port at any given time. In this regard, ports are a limited resource - though it's extremely rare to use most of those ports.When a client connects to the server, a file descriptor is created for the connection that represents the socket. You can read and write to this socket like any other ordinary file. The number of file descriptors available is huge but there is usually a limit on the number of file descriptors that one particular application can use.
Also, it should be noted that Apache can be configured to listen on more than one port simultaneously.
a TCP stream is uniquely identified by 4 numbers:
note that the client also uses a port number, that helps to keep streams separate.
The typical case consists of a server at a known (by DNS) IP address and a known port number, then each client has a different IP number, and the port number used by the client is chosen semi-randomly. That allows a single server to connect to many different clients, and also a single client can have several connections to the same port at the same server, just using different ports on the client side.