0

I was told to switch to nginx or at least to mpm_worker. But really, how can I estimate if my server is not really overloaded even with mpm_prefork?

My system is:

  1. GCP 1 CPU + 3,75GB
  2. Debian 8
  3. Apache 2.4 with mpm_prefork
  4. Varnish cache, Memcache

Some php.ini settings

max_execution_time = 30
max_input_time = 60
memory_limit = 1536M

Some other various standard apache modules, without fastcgi and without php-fpm.

<IfModule mpm_prefork_module>
    StartServers             5
    MinSpareServers       5
    MaxSpareServers      10
    MaxRequestWorkers     250
    MaxConnectionsPerChild   0
</IfModule>

KeepAlive Off

And I have about 20 small wordpress blogs on it.

So how many concurrent users can I take all together on all sites? I don't need exact numbers. I want to understand if it's 10s 100s or 1000s? Probably not 10000s. But if it's something like 250 same time online - I think It's still good for now.

Also, should I set the memory limit to 3GB? OR let the left 2GB to be used by varnish is a good idea?

Completed 1000 requests
Finished 1000 requests
Server Software:        Apache/2.4.10
Server Hostname:        sochi.asp.sale
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256
Document Path:          /
Document Length:        199165 bytes
Concurrency Level:      100
Time taken for tests:   12.041 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      199546499 bytes
HTML transferred:       199165000 bytes
Requests per second:    83.05 [#/sec] (mean)
Time per request:       1204.067 [ms] (mean)
Time per request:       12.041 [ms] (mean, across all concurrent requests)
Transfer rate:          16184.28 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       12  711 1471.9    307    6868
Processing:    23  492 960.2    253    7588
Waiting:        2  302 957.0     76    7043
Total:         35 1203 2005.6    524    7629
Percentage of the requests served within a certain time (ms)
  50%    524
  66%    534
  75%    608
  80%    644
  90%   7164
  95%   7186
  98%   7188
  99%   7189
 100%   7629 (longest request)

2 Answers2

0

At a guess, probably less than 100 before it starts slowing down. For reference, I load tested a customers server this week. The specs were: 4core 4GB RAM 2 core litespeed with lsapi handler PHP 7 MariaDB 10 And just a really well coded site.

It could take 300 concurrent connections on the slowest page, before it started loading slower than 4 seconds per page.

When not under load it was getting ~50ms TTFB

In saying that, I'm not overly familiar with what Nginx+varnish can handle, so you may get similar results. However I'd recommend adding extra cores, and turning down that PHP memory limit. If a simple wordpress blog needs more than 256M, then something is wrong.

Easiest way to find out is to load test yourself -> https://httpd.apache.org/docs/2.4/programs/ab.html

Will
  • 14
  • 2
  • Hi, Thanks for the ab testing, i pasted the results into my original post. Can you help me read it? – Sam Tyurenkov Sep 30 '17 at 09:02
  • Also, you say about using only 256M for php. But where should I assign my 3.75GB memory? I thought since I don't have any other software besides web server - I should give all the memory to it. – Sam Tyurenkov Sep 30 '17 at 09:12
  • Most of the time you only need to look at the failed request, which in your test was 0. Sometimes you'll see a whole lot of failed ones for length, normally that can be ignored. Then you want to check the connection times. You have min max and average. You got: Total: 35 1203 2005.6 524 7629 So it was probably ok. I always click around the site at the same time, to get an idea of what it's actually like to use the site under that much load. – Will Oct 01 '17 at 06:53
  • Regarding PHP memory limit, that's a per process limit. So if anything was to actually use that much, you're going to create more problems. Generally that would only happen if there's a bug, and it's pretty much why the setting is there. – Will Oct 01 '17 at 06:56
0

Considering that you have Varnish it can easily be > 1000 if:

  • You have configured Varnish (VCL) properly
  • The blogs do not have much of dynamic nature (i.e. not Woocommerce powered stores) - mostly static articles.
Danila Vershinin
  • 4,738
  • 3
  • 16
  • 21
  • Daniel, thanks for the thoughts, however I'll choose Will's answers as best as he pointed me to the benchmarking tool. However I don't understand the output very well. – Sam Tyurenkov Sep 30 '17 at 09:04