I measured the maximum number of cases that the web server (Apache) can handle simultaneously using a VPS rental server.
Publication Date:December 31, 2020
INFOMARTION > I measured the maximum number of cases that the web server (Apache) can handle simultaneously using a VPS rental server.
summary
I have measured the maximum number of cases that the web server (Apache) can process at the same time, and I would like to write the results. I was curious about the maximum number of requests that could be handled, so I did some research. Please use this as a reference for selecting VPS server specifications.
This time, we measured only with WEB (Apache), but please refer to the following article for measurement with WEB/AP servers (Apache and Tomcat).
Table of Contents
1. measurement
1-1. Measurement environment
The following is the environment in which the measurements will be made.
■Rental Server Information
CPU | 2core |
---|---|
memory | 1GB |
SSD | 50GB |
■Server Information
OS | CentOS 7.4 64bit |
---|---|
WEB Server | Apache HTTP Server 2.4.41 |
1-2. measurement method
I would like to measure using JMeter. JMeter is a load measurement tool that runs in Java. This tool allows a large number of requests to be thrown at the same time. We would like to gradually increase the number of simultaneous requests using JMeter and increase the load until the processing cannot be handled any longer.
Specific conditions include
- Request Interval・・・5 sec.
- Number of simultaneous requests・・・10 cases(Gradually increase the number of measurements by 10 cases each.)
- Measurement Time・・・60 sec.
The measurement time is "60 seconds" and the request interval is "5 seconds", so we would like to access the site 12 times (60÷5) repeatedly.
1-3. measurement results
In the end, many people may be wondering about the conclusion of what specs the server can handle and how much it can handle.
CPU:2core memory:1GB SSD:50GB | Can handle up to 120 simultaneous requests |
---|
Based on the results of this measurement, the above was obtained. From the above results, we may infer the following. Please try to use this as a criterion for selecting server specifications.
CPU:1core memory:512MB SSD:25GB | Up to 60 simultaneous requests can be handled |
---|---|
CPU:2core memory:1GB SSD:50GB | Can handle up to 120 simultaneous requests |
CPU:3core memory:2GB SSD:100GB | Can handle up to 240 simultaneous requests |
Even with specifications of "CPU: 1 core," "memory: 512MB," and "SSD: 25GB," we found that a system with about 60 users would run without problems.
2. Measurement result details
If you are interested in the results of the measurement, please also check the details of the measurement results to be described in the future.
2-1. WEB server (Apache) measurement
Repeated requests were thrown for pages created in HTML. It will be a simple page with no complex PHP processing or JavaScript.
The measurements yielded the following results.
- For 10 simultaneous requests⇒OK
- For 20 simultaneous requests⇒OK
- For 30 simultaneous requests⇒OK
- For 40 simultaneous requests⇒OK
- For 50 simultaneous requests⇒OK
- For 60 simultaneous requests⇒OK
- For 70 simultaneous requests⇒OK
- For 80 simultaneous requests⇒OK
- For 90 simultaneous requests⇒OK
- For 100 simultaneous requests⇒OK
- For 110 simultaneous requests⇒OK
- For 120 simultaneous requests⇒OK
- For 130 simultaneous requests⇒NG
An error occurred on the 130th case. The cause was a connection error to Apache. The status of the server at this time was as follows.
- CPU utilization・・・26%
- memory utilization・・・100%
The complete lack of memory was the bottleneck.
This is a bit geeky, but here is how Apache's Multi-Processing Module (MPM) is configured. MPM is simply a setting for how much Apache is allowed to process in parallel.
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 250
MaxConnectionsPerChild 0
</IfModule>
The setting of interest is "250" for "MaxRequestWorkers". This is a setting for the maximum number of cases Apache can process at the same time. The maximum number of parallel processing is "250," so it seems that 250 cases can be processed in parallel, but looking at the memory usage, about 8 MB of memory was used per case.
It seemed to be using 960MB of memory (8M x 120 processes) and the setting value was "250", but it did not seem to be able to create more than "120" processes.
※The server's memory is almost at its maximum limit of 1G.
When actually operating the server, if PHP and Java are also included, the limit is about 100 cases, and if there is room, about 80 cases can be processed concurrently.
When only Apache is installed and running, I found that with the specifications "CPU: 2core, memory: 1GB, SSD: 50GB", the number of simultaneous accesses is limited to "120".
2-2. consideration
As a consideration, I think that the number of concurrent processes may increase if the memory is changed since memory is the bottleneck.
【present(memory1GB)】
- memory:1GB
- Number of Apache threads:120 cases
- Memory consumption per thread in Apache:8MB
- Apache memory consumption:960MB(120 cases×8MB)
【After change(memory2GB)】
- memory:2GB
- Number of Apache threads:240 cases
- Memory consumption per thread in Apache:8MB
- Apache memory consumption:1920MB(240 cases×8MB)
If memory is increased to 2GB, it would be possible to double the number of simultaneous parallel processing to about 240 cases. If the memory is increased to 3GB, more concurrent processing may be possible, but since the "MaxRequestWorkers (maximum number of concurrent processes)" of Apache's MPM is 250, further tuning may be necessary if the memory is increased further. On the other hand, if memory is cut in half, it would be as follows.
【After change(memory512GB)】
- memory:512GB
- Number of Apache threads:60 cases
- Memory consumption per thread in Apache:8MB
- Apache memory consumption:480MB(60 cases×8MB)
3. summary
I have described the results of measuring the maximum number of cases that the web server (Apache) can process at the same time. We found that a system with about 60 users would work fine with "CPU: 1 core," "memory: 512MB," and "SSD: 25GB.
This survey is based on the assumption that no other software is running at marginal performance. We recommend that you choose a specification with a bit of leeway as it is a marginal value.
Thank you for taking the time to read this to the end.
■INFORMATION
Please click here to go to the top page of INFORMATION.
■PROFILE
Please click here to view the profile.
■For inquiries, please contact