Forge Forge/ Apache Check  by Franck Hisbergue
  Connexion  -  Fr / En
FAQ

Why it is always written MaxRequestWorkers / MaxClients ? Which one should I use ?

MaxRequestWorkers was called MaxClients before version 2.3.13. The old name is still supported.
If you use a 2.3.13 or newer version, use MaxRequestWorkers. If you use an earlier version, use MaxClients.

I have a question, i can

What is the Estimated residual disk IO speed ? The manufacturer of my SSD drive tells me the IO speed is about 300Mo/s, why ApacheCheck just tells me the disk IO speed is about 7Mo/s ?

First of all, the manufacturer gives the maximum IO speed of the disk, in the best conditions. Usually the best speed is achieved with large files transfers, but an Apache web server usually read/write small files. To simulate real Apache activities, the ApacheCheck script is copying files from 256 octects to 512ko. The result of this measurement is, of course, an estimation.
In a second hand, the script is measuring the disk IO during normal activity of the server, that means the disk is already doing IO, that’s why the script only measure residual IO speed.

Measurement of disk IO speed takes time, can I skip it ?

Yes, just use the -d parameter on the command line : php apachecheck.php -d
Use –help command line parameters to have all available options.

The script hangs for one or two minutes before displaying results. Why ?

Maybe the disk IO speed measurement takes time if the disk is very slow, but most likely your server doesn’t have internet access. The script use internet for two reasons : get the external IP of the server (display only), and because it is looking for new versions of the script.
You may try to deactivate this internet checks by using the command line parameter -i like this : php apachecheck.php -i

The script doesn’t work on my server, I don’t understand why…

Have a close look to the output of the script, the reason may be indicated.
Maybe your distribution has specific directories or ways to execute Apache. You can open a ticket and explain the problem with all the information you can give. If it is possible, a patch will be developed for supporting your distribution in the next release.

My Apache has a lot of config files, can I have a view on the entire Apache config files content ?

Yes, just use the -a (--apache-config) parameter on the command line : php apachecheck.php -a
The content of all the Apache config files will be displayed after the usual checks.

I have a 4 cores HT CPU (linux says it has 8 cores), why the script tells max CPU is about 520% ?

One a server with one CPU with one core, a software can only use from 0 to 100%.
If the server has one CPU with two cores, a software may use from 0 to 200%.
If the server has one CPU with two cores HT (hyperthreading), the hyperthreading cores aren’t real cores, then help to switch between contexts more quickly. With software like Apache, the average gain of performance about 30% with hyperthreading cores. So the maximum usage is about : 2 x 100% for the real cores, and 2 x 30% for the HT, so about 260%.
On a 4 cores HT CPU, a software will use from 0% to 520% (4 x 100 + 4 x 30). Of course it is not completely accurate, but still better than thinking 8 cores = 800%.

I execute the ApacheCheck script several times, why the maximum value of MaxRequestWorkers / MaxClients varies ?

The results depend on the server activity at the execution time. The script measures CPU usage, disk usage and memory usage, and extrapolate the usage if server load reaches limits. If the server activity varies, the results also will. So it is a good idea to launch the script when the server has real activities. For example, if the visitors come on evening read your website, it is better to wait the evening to execute the script.
The result may also varies is your server is occasionally busy doing something else, no-Apache related tasks (for example a task doing lot of disk IO).

Why HostnameLookups should be Off ?

If you don't truly need the reverse lookups, in order to save the network traffic and give better end users experience (because they don't have to suffer the extra latency that a lookup entails), heavily loaded sites should leave this directive off, since DNS lookups can take considerable amounts of time.

Why ServerSignature should be Off ?

If ServerSignature is On, a footer line under server-generated documents (error messages, directory indexes…) will be added, including Apache version, and ServerAdmin email. It is not a big deal, but it is better to avoid telling such information to some malicious people.

Is it dangerous to activate BufferedLogs ?

Before 2.4, BufferedLogs was marked as experimental, but lot of people used it without problems. In 2.4, it is not experimental anymore and can be use safely.
BufferedLogs causes mod_log_config to store several log entries in memory and write them together to disk, rather than writing them after each request, this may result in more efficient disk access, reducing IO. But you must know that a crash might cause loss of logging data.

Why MaxConnectionsPerChild / MaxRequestsPerChild shouldn’t be zero ?

First off all, MaxConnectionsPerChild was called MaxRequestsPerChild before 2.3.9. The old name is still supported.
Setting MaxConnectionsPerChild to a non-zero value limits the amount of memory that a process can consume by (accidental) memory leakage, forcing the parent process to kill the child and create a new ones.

How is calculated the average memory usage per Apache child ?

Regarding the actual activity of the server, there are two types of Apache child process : the ones who have or had activities, and the ones who are waiting because of MinSpareThreads. The seconds one are not used in the calculation.
The average memory usage per Apache child is the sum of Apache child memory usage + (MySql thread memory usage / number of Apache childs) + (PHP-FPM process memory usage / number of Apache childs) + …
The purpose is to have an estimation of memory usage per activities generated by one Apache child, so some extrapolations can be made.

How is calculated the Maximum value for MaxRequestWorkers / MaxClients on this server ?

Three values are calculated : one based on CPU usage, one based on disk IO usage, and one based on memory usage. The smallest value is used as the limit for this server.
The script calculate (estimate) the needs for as many Apache children as the MaxRequestWorkers, based on average CPU usage, average disk IO and average memory usage per Apache Child for Apache itself, but also for other webserver related processes (MySql, PHP-FPM…).
For the memory usage, two values are used : average usage and maximum usage. The average usage may underestimate the real memory usage of Apache children (some are not working at measures time), and the maximum memory usage certainly overestimate it, so the truth is probably between this two values.

I have a question that is not present in this FAQ, what can i do ?

Just open a ticket !

Xulops Forge - Page faq