5

I'm trying to test load a LAMP application that my team developed and deployed on AWS ubuntu 14.04 using jmeter. We are using AWS CDN to serve static files, mysql and apache are on the same host.

When there is only one user doing stuff, the response time is normal, between 2 and 5 seconds depending on the page.

My goal is to make it respond with that same time to 500 connected users doing stuff at the same time.

I started with smaller number of users, using mod_php and prefork module on a t2.small ( 1vCPU, 2 Gb RAM ) and I was satisfied with only 40 connected users. Once there are 100, it extremely slows down with a response time +20s.

I tried with php-fpm and event module after going on some SO ressources. The performance was better but remains slow; +15s for any single page. I decided to upgrade the server to M4.2xlarge( 8vCPU, 32 Gb RAM). For 100 connected users, it behaves normal and I'm satisfied, but that's an expensive one and I want to find the better performance using the most suited server spec.

Anyway, I tried to test this M4.2xlarge with 330 connected users doing stuff concurently, and it became too slow, +15~+20s per page. Been trying to tune event configuration, and fpm process with no luck (In most case I have +90℅ cpu, but enough RAM not being used that's why I yhink there us a limit somewhere).

I feel I'm so close but I can't do it. I will update my question with any file, log or ouptut you would ask for.

Tim
  • 30,383
  • 6
  • 47
  • 77
user388194
  • 51
  • 3
  • 2
    You need to identify what's taking the resources and work out how to reduce it. You could provide us with that information. Consider caching of pages or resources that are not private. PHP is a resource hungry language, you may need to use a load balancer and multiple servers, along with AWS Relational Database Service. – Tim Nov 29 '16 at 20:09
  • Possible duplicate of [Can you help me with my capacity planning?](http://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning) – Tim Nov 29 '16 at 20:09
  • First, identify your bottleneck. – Michael Hampton Nov 29 '16 at 20:33
  • Tim: Please, I'm just starting. / Michael: that's what I'm not able to do. I've just started my DevOps journey, and that's why I suggested to post any output, log or file. Please bear with me. – user388194 Nov 29 '16 at 20:36
  • Did you find a solution in the meanwhile? It's worth a try, setting up the same environment with `nginx` instead of `apache` (easy when using `php-fpm` anyway) and test if you observe the same performance issue there. If not, it's like an apache issue. – BurninLeo Jan 20 '18 at 20:00

1 Answers1

1

I think you could set nginx to cache and reverse proxy the requests to apache and Cloudfront. I did that a time ago. And solve my problem of latency.

My setup is: EC2 + RDS + Cloudfront/S3

I setup my EC2 with nginx caching and proxying request of static files to cloudfront that points to a bucket on S3. And chaching and proxying requestes that needs to run on server-side to apache. And set my database service on RDS.

That solves my problem and decreased my latency to milliseconds.