0

I have read several posts and questions about KeepAlive but have not found any suitable for me.

I have a server with just one client (Trivago) doing hundreds of (hotel availability) requests per second. For each request, I have to request the price to a third party server. So the flow would be like this:

Trivago ask for availabilities and prices, I ask for them to a third party supplier, I receive them, do the PHP logic, and return a json response to Trivago.

Server details:

CentOS Linux 7
Plesk Onyx (uses nginx & apache)
4 cores
8GB

PleskPHP config php-fpm directives:

pm.max_children    250
pm.max_requests    1000
pm                 ondemand

httpd.conf:

ServerLimit           16
MaxClients           400
StartServers           3
ThreadsPerChild       25
ThreadLimit           64

Using this, I'm getting 12.5MB or RAM per process which, theoretically, allow me o have up to 500 processes running at once using 6GB of RAM:

ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'

Question:

  • Should I use KeepAlive? Since Trivago is doing hundreds of request, how do I determine if same 'open/stablished connection' is being used?

While other resources utilization looks consistent:

network cpu mysql RAM

apache memory usage looks like this:

Apache RAM

Am I wrong or is it caused by KeepAlive?

Those are graphs of low traffic hours, by the way. On high traffic hours Apache memory usage goes near 8GB limit.

Thanks.


Edit:

This is marked as duplicate and yes, It may be duplicate but I'm a step ahead that question. I've already monitored the system, added traffic via JMeter, evaluated the results and remediated some things. Therefore, I will ask a simplier question:

  • Does the apache graph looks like I should set KeepAlive to off?

I understand the aproach here is to set it off and test it but since the server is in production now (I did not experienced this graph while using JMeter), I can't.

Hache_raw
  • 101
  • 2
  • This is what performance testing is meant to find out. – Jenny D Jul 02 '19 at 13:32
  • Possible duplicate of [How do you do load testing and capacity planning for web sites?](https://serverfault.com/questions/350454/how-do-you-do-load-testing-and-capacity-planning-for-web-sites) – Jenny D Jul 02 '19 at 13:32
  • Thank you. That was one of the questions I've read. I already used JMeter to test 1000 simulatneus request but did not get the same graphs. Actually my question is quite simplier than it looks: does the apache memory usage graph looks like connections are keeping alive and unused? – Hache_raw Jul 02 '19 at 16:06

0 Answers0