Configurable OS Parameters
Here, we go over optimum parameters for
web services. 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 10 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 services, 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 very large number of open files and connections in a process, it is possible to run out of file descriptors, meaning that you will not be able to accept new connections until old connections terminate and give up their descriptors. In programmer’s terms, 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 (asOPEN_MAX
inlimits.h
for SVR4), but every system has increased it far beyond that. It is not unreasonable to want several thousand ...
Get Web Performance Tuning now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.