Monitor Apache Web Server Performance

The Apache HTTP Server, also known as Apache HTTPd, is a commonly used web server software. Its wide usage has been due to its easy customizable feature and being open source.

If you have been using Apache, it is critical to monitor its performance to be aware of degradation issues and bottlenecks. Use our plugin and see real time performance trends and historical metrics, all in a single dashboard. This document details:

Performance Monitoring Metrics

Requests per Second

req_per_sec records the total number of HTTP requests the web server is processing per second.

Busy Workers

Use the metric busy_workers to get the total number of processes actively processing an HTTP request

Idle Workers

idle_workers is the total number of idle workers/idle processes waiting for an HTTP request. If you have very few or no idle processes, it means your server is using up all the processes and new requests have to be on hold until the older requests are completed.

Uptime

The metric uptime gets the total amount of time the server has been up and running.

Bytes per Second

bytes_per_sec records the total amount of data the web server is transferring per second.

CPU Load

Use the metric cpu_load and get the total percentage of CPU used by the web server.

Bytes per Request

The average number of bytes being transferred per HTTP request is obtained using the metric bytes_per_req.

Total Accesses

The total number of accesses on the server is monitored using the metric total_accessess.

Prerequisites

  • This is a Python based plugin supported from Python versions 2.7 and above. For version 2.7, we use urllib2 module and for version 3.0 and above, we use urllib module for monitoring the web server.

Apache Configuration

Please follow the below steps to configure your web server to monitor its performance. Regardless of the system you’re using, make sure to save a backup of the configuration file before making changes to it; in case you need to revert to an earlier version.

Configuring the Status URL: For your server to be available at http://localhost:80/server-status, the server should be running and status module (mod_status) should be enabled.
Configuring the Port
Enabling SSL

Plugin Installation

  • Configure Apache as mentioned above to monitor its performance attributes.
  • Download and install the latest version of the Site24x7 Linux agent in the server where you plan to run the plugin. If it is installed successfully, you will see a Linux server monitor in the Site24x7 Control Panel. This confirms that the agent is able to communicate with our data center.
  • Download the "apache.py" file from our GitHub repository
    wget https://raw.githubusercontent.com/site24x7/plugins/master/apache/apache.py
  • Update the file with your Status URL for monitoring apache. By default, we have enabled it to be:
    http://localhost:80/server-status?auto
  • Create a folder with the name "apache", under the Site24x7 Linux agent plugin directory '/opt/site24x7/monagent/plugins/' and place the 'apache.py' under '/opt/site24x7/monagent/plugins/apache/'

The agent will automatically execute the plugin within five minutes and send performance data to the Site24x7 data center.

View Data in the Site24x7 Web Client

  1. Login and go to Server > Plugins > Name of Plugin Monitor
  2. You will be able to view the performance charts on the various metrics for your server.

Error Handling

S.No Error Message Reason
1 Error_code : URL Error [Errno -2] Name or service not known Invalid hostname
2 Error_code : URL Error [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol If the Apache Status URL is not HTTPS configured
3 Error_code : HTTP Error 404 Invalid Status URL
4 Error_code : HTTP Error 400 Invalid Port number

Plugin Contribution

Feel free to contribute to our existing plugin and come up with suggestions or feedback on our Community.

Related Articles

  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Server Monitoring - Stay on top of server outages and performance issues
  • Redis - Monitor performance metrics of your Redis databases
  • MySQL - Monitor performance metrics of your MySQL databases
  • Zombie Process - Analyze performance of your Zombie process server
  • Nagios - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
  • Custom Script Monitoring - Create custom Linux and Windows plugins and monitor attributes that you need
  • GitHub Repository - Check out our 50+ plugin integrations
Trusted

World's leading companies

Client

Don't have a Site24x7 account? Sign up now!