0

We have the following server resources :

16GB RAM Memory
Intel Xeon E5-2650 v2 @ 2.60GHz (8 Core)
240GB SSD (RAID 10)
1 IP Address (2 extra)
Unmetered Traffic / 1Gbit Port / 100Mbps guaranteed

We are using piece of javascript on around 30 websites untill now sends HTTP requests to PHP script located on our server to track the page loads and save the website information in our MySQL DB.

So the requests sometimes reach millions a day and the server becomes too slow, once I disable sending the requests to our server, everything works fine.

From the apache error log, I found the following error :

[core:notice] [pid 4918:tid 139902294153344] AH00094: Command line: '/usr/sbin/httpd'
[mpm_worker:error] [pid 4918:tid 139902294153344] AH00287: server is within MinSpareThreads of MaxRequestWorkers, consider raising the MaxRequestWorkers setting
[mpm_worker:error] [pid 4918:tid 139902294153344] AH00286: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

Also :

[mpm_event:error] [pid 22565:tid 140163371042688] AH00485: scoreboard is full, not at MaxRequestWorkers

After digging into this issue, I found an article to set the optimal configuration for Apache httpd.conf for such issues :

StartServers 5
<IfModule prefork.c>
    MinSpareServers 25
    MaxSpareServers 50
</IfModule>

ServerLimit 256
MaxRequestWorkers 1000
MaxConnectionsPerChild 10000
KeepAlive On
KeepAliveTimeout 100
MaxKeepAliveRequests Unlimited
Timeout 300

Still getting the same, I was thinking that it might be issue with many transactions to db in the same time, so I stopped the storing to db part in the script and got the same issue.

Any suggestions regarding the above issue ?

Assume we have moved to cloud hosting with more resources, is it still fine to save such requests to db immediatly ? I was thinking of saving into file and dump it each 4 hours for ex.

  • Without knowing the details of your application, it is impossible to tell what exactly you can do. You need to check your application architecture, if that is optimal. Check your database tables, indexing. Check your application server caching. And then apply scientific method to find out how to improve performance. You can also consider scaling out the hardware. – Tero Kilkanen Feb 28 '17 at 15:54
  • *"I found an article to set the optimal configuration for Apache"* ==> Unless that article explained the methodology how determine an optimal configuration, you're using settings that are optimal for the author of that article, not necessarily settings optimal for *your use case*. – HBruijn Feb 28 '17 at 22:19

0 Answers0