How to track Apache server performance.

How To Track Apache Server Performance

Table of Contents

Banner opt.2.webp

  

Introduction

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.

                                         

                                                

Key Takeaways

  1. Apache is a popular open-source cross-platform HTTP server widely used for hosting websites.
  2. Monitoring Apache server performance is essential to maintain robust and efficient server functionality.
  3. Apache performance metrics can be accessed through the Apache server status module (mod_status) and server access log.
  4. Error log and access log analysis help identify server performance problems, error statuses, and attacks.
  5. Consistent monitoring and analysis of performance metrics help prevent server overload, traffic bottlenecks, and server outages.

 

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 the 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 the server and the client. In the 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 multi-core 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-existent 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: 

 

http://192.0.2.0/server-status

 

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).

    

http://192.0.2.0/server-status?refresh=5

    

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
  • uptime
  • 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: 

      

http://192.0.2.0/server-status?auto

       

           

Apache’s logs

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. 

             

Error log

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.  

          

Access log

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, request 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 a maximum number of workers, RAM size and other parameters are indeed important.

    

However 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 helps 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 the 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 Graphite 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.

          

     

          

Conclusion

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 Graphite and Grafana can help you get started on your Apache server performance journey. You can even get started with our free trial or book a demo and talk to one of our key MetricFire experts!

You might also like other posts...
metricfire Apr 10, 2024 · 9 min read

Step-by-Step Guide to Monitoring Your SNMP Devices With Telegraf

Monitoring SNMP devices is crucial for maintaining network health and security, enabling early detection... Continue Reading

metricfire Mar 13, 2024 · 8 min read

Easy Guide to monitoring uWSGI Using Telegraf and MetricFire

It's important to monitor uWSGI instances to ensure their stability, performance, and availability, helping... Continue Reading

metricfire Mar 12, 2024 · 8 min read

How to Monitor ClickHouse With Telegraf and MetricFire

Monitoring your ClickHouse database is a proactive measure that helps maintain its health and... Continue Reading

header image

We strive for
99.999% uptime

Because our system is your system.

14-day trial 14-day trial
No Credit Card Required No Credit Card Required