x
Loading
 Loading
Hello, Guest | Login | Register

Optimize Apache

My web site is gaining popularity quickly, but I can’t afford to upgrade my hardware. What can I do to optimize Apache?

My web site is gaining popularity quickly, but I can’t afford to upgrade my hardware. What can I do to optimize Apache?

With the explosion of Internet use and its attendant traffic, keeping pace with rising demand is a common problem. Luckily, there are some concrete steps you can take to relieve system stress.

As with all performance problems, your first action should be to identify and ease bottlenecks. Use tools such as top, vmstat, and iostat to diagnose your system. Also, consider what kinds of content you are serving: if you use CGI, scripting, databases, or other tools to generate and serve dynamic content, analyze and optimize each of those subsystems, too.

Focus next on hardware. Lots of RAM is essential for smooth Apache performance — you must have enough memory to avoid hitting swap. If you serve static content, raw CPU power shouldn’t be a concern. However, if you serve dynamic content, the more processing power, the better. Also, make sure you have fairly fast disks, and, of course, enough network bandwidth.

There are also many ways to improve Apache’s own performance. In Apache’s configuration file, httpd.conf, it’s important that you disable HostnameLookups. If left on, Apache waits for a DNS response before completing each and every request. (If you want to use reverse lookups to collect statistics, you can easily derive them after the log’s been rotated. In fact, many log analysis programs even have this built-in.)

Whenever possible, enable FollowSymLinks and disable…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. KDE 4.4: Does It Work Yet?
  2. Writing Custom Nagios Plugins with Python
  3. Power Up Linux GUI Apps
  4. Tweeting from the Command Line with Twyt
  5. When Memory Serves You: Using ramfs and tmpfs
Follow Linux Magazine
Rackspace