Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
up vote 3 down vote accepted

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 through 65535. 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.

share|improve this answer
Thank you it is great!. Do you mind if I ask you take me a some good URL for persuasion to my sys adm? – freddiefujiwra Jun 10 '11 at 5:14
Not URL. "man socket". – Max Alginin Jun 10 '11 at 16:16

a TCP stream is uniquely identified by 4 numbers:

  • host A IP number
  • port number on host A
  • host B IP number
  • port number on host B

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.