0

I have a cluster of EC2 servers set up and just one is behaving very strangely. It's a t1.micro server running Ubuntu 14.04. Nginx, MySQL, and php5-fpm are installed. I've concluded that nginx and MySQL are operating perfectly; however, php5-fpm will take about 40-55 seconds to execute any script file. This problem occurs about 5 minutes after the service has started. Even a simple script file such as this will take about 50 seconds:

<?php
phpinfo();

I'm using the default configuration of php and have other servers with the exactly same setup which are having no difficulties.

If I restart the php5-fpm service, it will operate normally for 3-5 minutes and then start slowing down. I'm guessing this is something to do with the amount of child processes, but since the other servers (with identical setup) are running perfectly I'm not confident of anything.

I've tested the nginx setup by trying to download static pages and they work as expect. I'm ruling out MySQL since a script as simple as the one above will still take a tremendous time to execute.

If anyone could help me figure this out I would be tremendously grateful. Any ideas? Thanks in advance

  • 1
    I expect that you have much more memory on the other servers and you end up going out of memory on this one and heavily using the swap. – Florin Asăvoaie Sep 6 '14 at 23:00
  • 1
    1) micro instances are horrible. Performance from one micro instance to the next is not consistent. Try on instances intended for production use. 2) What do your performance metrics say? – EEAA Sep 6 '14 at 23:01
  • @FlorinAsavoaie They are all t1.micro instances and top tells me that I have over 100mb of free memory on the offending server. I could be missing something, but wouldn't the swap only be used after the memory is completely allocated? – tiernan Sep 6 '14 at 23:04
  • @EEAA I'm aware they're slow, but I have 8 others that are not causing any problems. My company wanted to have geographically distributed clone servers without heavy expense so it's what we went with. The metrics say there's about 30% constant CPU, and about 400KB network out. Almost 0 I/O, and nothing peaking. – tiernan Sep 6 '14 at 23:09
  • @tiernan, that's not exactly how Virtual Memory works in Linux. You should read a little bit more about it. According to TOP, does it use Swap? – Florin Asăvoaie Sep 6 '14 at 23:12
1

This server had a gp2 (general purpose SSD) disk mounted for the web content. I moved the content to a standard (magnetic) disk, and replaced the mount. Since then, I've had no disk I/O latency. I'm unsure of the cause for such high latency with the SSD disk, but never-the-less this is the solution that worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.