0

The setup is

  • EC2 Micro instance
  • Nginx 1.0.0.5 with FPM
  • PHP 5.2.17 with CGI
  • App connects to MySQL on RDS
  • Collectd for monitoring

JMeter is used on other servers on same EC2 region (so latency is not an issue). The problem is from the graph generated by Collectd, results are VERY spikey.

For example, 200k requests took 20 minutes, and the pattern is like 1k requests for 1 minute, then pretty much flat (not even 100) requests for 2 minutes, repeat.

The only resource that reached the limit here is CPU at 100%. The rest are still not fully-utilized.

Heck, I've tried on static page before and get pretty much the same pattern:

HUGE spike - flat - flat - HUGE spike

What am I overlooking here? Some stuff I've taken care of:

  • rlimit set to very high
  • nginx worker connection set to 8192
  • PHP-FPM max children set to 140

Below is said graph from one of the runs (200,000 requests total)

200k requests

Thanks.

Ochoto
  • 1,174
  • 7
  • 12
syaz
  • 382
  • 3
  • 8

2 Answers2

1

micro ec2 instances have a burst capacity. So if the CPU is at 100% all the time, then the micro instance would get extra cpu power for a few seconds.

Thats is what is probably causing the spikes. A sudden increase in CPU power for a few seconds.

nafis
  • 11
  • 3
1

Micro EC2 instances are designed to:

Provide a small amount of consistent CPU resources and allow you to burst CPU capacity when additional cycles are available. They are well suited for lower throughput applications and web sites that consume significant compute cycles periodically

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?instance-types.html

Your load is cpu heavy so the instance is using burst capacity, the downside of it is that you get a cpu downburst after that. Your metrics match those done by Huan Liu:

http://huanliu.wordpress.com/2010/09/10/amazon-ec2-micro-instances-deeper-dive/

You should choose (by metering) a better alternative for high cpu usage from the EC2 instance type list taking into account other aspects of your application such as I/O and memory usage.

Ochoto
  • 1,174
  • 7
  • 12