Table of Contents
- Why we need to monitor Apache performance
- Key Apache performance metrics
- Methods and approaches in Apache performance metrics collection
- Apache performance monitoring tools and solutions
Tracking Apache server performance is important to avoid future problems. Hence, what is Apache? Apache is one of the most popular and widely used web servers.
As an open source cross platform HTTP server, it can be run in a Linux, Unix, or Windows environment. Stable modular Apache architecture can be configured for multiple needs and it’s crucial to provide seamless and efficient server functionality.
Why we need to monitor Apache performance
To ensure robust server performance, it is very important to set the correct initial configuration and configure an Apache performance monitoring system.
With well-configured monitoring tools you can track key Apache monitoring metrics to prevent fatal problems, especially in cases where server load and requests scale up. With clear and real time dashboards, you can view changes in core metrics and instantly react to provide stable and efficient server work.
MetricFire has extensive experience in monitoring systems. So why wait, when you can use our product with minimal configuration and get right to monitoring your Apache server performance!
To learn more about it, please book a demo with us, or sign up for the free trial today.
Key Apache performance metrics
So what are the key Apache performance metrics that you need to monitor? Let’s have a look at them.
Apache web server metrics
Requests per second - this metric specifies time in microseconds required to process client requests to the server. It is an important metric that refers to servers performance under load.
An average request per second drop can reveal a problem in infrastructure between server and client. In a case of metric boost, this can indicate a denial of service (DOS) attack.
Bytes per second - this metric specifies the amount of information transferred between server and client per second.
Bytes per request - this metric points to the amount of information transferred for each request.
Uptime - this measures how long a server is operational in seconds from when the server starts. Uptime drops refer to unexpected outages and server restarts. Outages have an extreme effect on the end users, so tracking this parameter is also important.
Multi-Processing Modules (MPM) efficiency - Multi-processing module is responsible for network ports binding, accepting requests, and dispatching processes to handle these requests.
There are three main modules that can be chosen on a Linux or Unix-like machine: prefork MPM, worker MPM, and event MPM.
Some indicators may point out whether your server processing module performs efficiently or not. These indicators include number of serving requests workers, idle workers number, the status of each worker, and others.
This allows the server administrator to understand how well the server is performing, and how efficiently your server is using resources to process user requests. All these metrics are saved in the Apache server status module.
Please note: If you are not using a Unix-like machine, then you can only run one MPM at a time. Apache will default choose what it thinks your environment needs.
Infrastructure specific metrics
Memory usage - This metric points to the current memory usage. High memory usage signals to infrastructure problems, so use this metric to help you evenly distribute network resources. In “out of memory” cases, server performance drops rapidly.
CPU usage - This metric indicates CPU utilization of the underlying server. The case of constant CPU usage rises reveals a shortage in resources to handle current requests. You should also monitor CPU utilization across all cores when you are using a multicore system.
Disk usage - The Apache web server doesn’t store files physically on the host machine, which is why you need to provide sufficient disk space for Apache logging and temporary files.
Bandwidth - This is a metric that helps you to understand latency and throughput. Bandwidth directly influences request processing speed that, in turn, directly impacts end user experience. So the network bandwidth is another important metric to monitor.
Load - This is a metric that aggregates other performance metrics into one mark that can reveal problems from the start of monitoring. Ideally, Apache server load must be less than the number of processing cores.
Error rate - This is a metric that helps you reveal if a client is trying to find your server vulnerability or trying to access a non existing page.
MetricFire is capable of monitoring these key Apache web server metrics with easy configuration. Sign up for the free trial, or if you would like to learn more from one of our seasoned experts, book a demo with us today!
Methods and approaches in Apache performance metrics collection
The metrics mentioned above are available through the Apache server status module (mod_status) and server access log. Details about a specific client request can be found in the access log.
Apache’s status module
You can set up server set_mod availability in the server module configuration file (on Debian platforms) or in the main Apache configuration file (all other Unix platforms).
Then the Apache server status module page (mod_status page) will be available at:
In the event your browser supports auto refresh, you may find that server status pages automatically update. However, you may access the following address in order to automatically update your page every 5 seconds (you can replace the 5 at the end to suit your preference).
Although there is a possibility of a slight hit to performance, by enabling ExtendedStatus in your httpd.conf, you will get more information on the mod_status page. The following additional metrics will be available:
- total accesses/hits
- total kBytes served
- CPU load
- requests per second
- bytes per second
- bytes per request
When you set ExtendedStatus to “on”, additional information about each request, client processing time and requested source will be available. By ordering output by CPU usage or memory usage, depending on the problem you have, you can identify specific processes that can be the cause of performance decrease.
To retrieve information in machine readable format you can access the following address:
To effectively track Apache server performance, it is very useful to monitor and analyze web server logs. Error log analyzing helps to reveal server performance problems, discover error statuses, and detect attacks.
Access logs monitoring gives you information about the server load, the most popular resources, and traffic sources. Analyzing historical data allows you to retrieve trends and predict requirements for server infrastructure.
In cases where the server’s maximum number of active processes or concurrently open files are reached, messages are displayed in the error log file. You can specify ErrorLog configuration through ErrorLog and LogLevel configuration directives.
The ErrorLog directive sets the name and file location. Additional information is shown, such as the client IP address and port of the request, local IP-address and port, header name, and so on.
The LogLevel directive sets the error significance.
Frequent error log review is a very good practice to catch and resolve potential pitfalls before they become problematic.
Apache server keeps track of all processed requests in its access log file. Log format has essential options for customizing for your particular needs.
For example, day/time of the request, client IP address, hosts, requests results, and other information, can be configured through the LogFormat directive.
Apache performance monitoring tools and solutions
Initial Apache server configuration for performance plays a significant role in its functionality. Selecting the correct multi-processing module, setting up maximum number of workers, RAM size and other parameters are indeed important.
But persistent tracking of Apache performance, with the use of monitoring metrics, helps to avoid problems with server overload, traffic bottlenecks, server outages, and other issues during real server activity.
Metrics visualization using Apache monitoring tools provides clear insight to understand situations rather than just looking at rows of numbers. Alerting systems with notifications help prevent server crashes before crucial metrics can reach thresholds.
A great tool to use is the CollectD Apache plugin. You can automatically parse a page generated by Apache server status module and then visualize Apache monitoring metrics. Visualize this with Prometheus built-in dashboards or by using Prometheus as a data source. It provides essential visualization capabilities in the Grafana monitoring system.
There are many commercial and open-source services for aggregating, parsing, and monitoring Apache logs. Open source tools like Logstash and FluentD are generally used to aggregate and parse valuable data and transfer this information to monitoring and visualization systems like Prometheus and Grafana.
With Hosted Prometheus monitoring and visualization tools, MetricFire can easily organize an Apache server performance tracking demo. Or you can get started with a free trial to determine if this is something that would benefit your business.
Tracking Apache server performance is crucial, and using tools like Prometheus or Grafana to monitor performance metrics makes it easier to provide stable and trouble-free Apache server work.
MetricFire’s Hosted Grafana and Hosted Prometheus can help you get started on your Apache server performance journey. You can even avail our free trial or book a demo and talk to one of our key MetricFire experts!