Runbook

High CPU and Keep-Alive Connections in Apache Server

Back to Runbooks

Overview

This incident type refers to a high resource utilization issue in an Apache server. Specifically, it involves a high number of keep-alive async connections combined with high CPU usage. The recommended solution involves lowering the maximum number of simultaneous connections to the server and/or decreasing the KeepAliveTimeout to avoid holding connections open longer than necessary. This incident type can impact the performance of the Apache server and may require immediate attention to avoid further issues.

Parameters

Debug

Display the current cpu usage using the 'top' command.

Check Apache processes

Check Apache resource usage

Check Apache configuration

Check Apache error log for any recent errors

Check Apache access log for requests and response codes

Check the current number of established connections

Check the maximum number of simultaneous connections allowed

Check the KeepAliveTimeout setting

A sudden increase in traffic to the server could lead to a spike in CPU usage and the number of Keep-Alive connections.

Repair

Set the desired MaxRequestWorkers value

Set the Apache configuration file path

Find the current MaxRequestWorkers line and replace its value

Restart the Apache service

Decrease the KeepAliveTimeout to avoid holding connections open longer than necessary.

Learn more

Related Runbooks

Check out these related runbooks to help you debug and resolve similar issues.