O'Reilly logo

Web Performance Tuning, 2nd Edition by Patrick Killelea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configurable OS Parameters

Here we will go over optimum parameters for running a web server. Note that Unix systems are shipped with a generic kernel, optimized not for any particular use, but for acceptable performance for general use. See Chapter 15 for information on configuring TCP. You can see the current settings in a Solaris system by viewing /etc/system or grepping for ndd from inetinit. In general, Solaris 2.6 is already tuned for web serving, so you shouldn’t have to modify anything to get the best performance. Here are a few of the most basic parameters you may want to tune on Linux or another OS. Remember to back up your kernel and configuration files before changing anything.

Number of File Descriptors

File descriptors are positive integers by which the kernel keeps track of open files and network connections per process. If your web server software has a large number of open files and connections in a single process, it is possible to run out of file descriptors, meaning that you will not be able to accept new connections or open new files until old connections terminate or files are closed. For network connections, the accept( ) system call will fail. What happens after that depends on your version of Unix; it may log an error to the system log or print a message on the console, among other things.

Old versions of Unix had a file descriptor limit of 20 (as OPEN_MAX in limits.h for SVR4), but every system has increased it far beyond that. It is not unreasonable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required