3

I have a worker tier that is using PHP process control (pcntl) functions to send multiple requests to the SNS service in parallel. My question is how best to tune MPM_PREFORK directives to get the best out of the box and how to calculate the most concurrent PHP processes I can run with the resources available. I am running a T2 medium at the moment which is spec'd like this:

Model     |vCPU | CPU Credits / hour | Mem (GiB) | Storage
t2.medium | 2   |    24              |     4     | EBS-Only

Also if anyone could shed some light on how the CPU credits are used/factored into this calculation I would be very grateful. I have currently sort of applied the thinking in these posts..

http://cloudinservice.com/tune-apache-performance-using-mpm-prefork-module/

http://fuscata.com/kb/set-maxclients-apache-prefork

Any help much appreciated

Mike Miller
  • 401
  • 1
  • 3
  • 9
  • You'll need to benchmark it. – ceejayoz Feb 19 '15 at 13:26
  • Could you elaborate please? – Mike Miller Feb 19 '15 at 14:13
  • There's not much elaboration to be had. We can't really answer your question, because the resources used by PHP will depend on what your PHP is doing. You need to benchmark it by doing a real-world test with your actual live code running on a couple actual live instances. Adjust the process counts until you're using but not running out of CPU credits. – ceejayoz Feb 19 '15 at 14:15
  • OK gotcha,thanks. This I have done but hoped there was a more scientific approach (working back from what is available) than just suck and see. Do you know how the CPU credits work or at least how they differ from normal CPU resource on a physical box? – Mike Miller Feb 19 '15 at 14:19
  • Also is there anything worth doing in the mpm stuff to let PHP at more of the available memory? – Mike Miller Feb 19 '15 at 14:19
  • CPU credits are documented at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html#t2-instances-cpu-credits - they are essentially a way to better handle bursting CPU needs. – ceejayoz Feb 19 '15 at 14:22
  • Appreciate the help – Mike Miller Feb 19 '15 at 14:44

0 Answers0