Question

I am using amazon aws ec2, its very very slow. I don't know where is wrong.

I am using free and top command, and found mysql and apache using lots of memory.

free -m

Here is top -M

top -M

I found that apache and mysql eat more.

Here is apache info:

[ec2-user@www ****]$ httpd -v
Server version: Apache/2.4.6 (Amazon)
Server built:   Sep 20 2013 18:01:06

Mysql info:

Server version: 5.5.34 MySQL Community Server (GPL)

I am not modify any mysql & apache configuration file , what should I do next ? Any suggestion is welcome.

Was it helpful?

Solution

You haven't shown us any reason to think this is slow. What you have shown us is that almost all of your memory is free and that your CPUs, from the picture, are idle.

When analyzing memory usage, remember that "cached" memory is used to hold things that were retrieved from the hard drive. Rather than free that memory and then waste it, the linux kernel smartly leaves the data in memory, clearing it out when necessary. This is a good thing - it means that many things, eg mysql data files, live in memory whenever possible. Caching files in memory is a great thing! You actually have over 6 gigs free.

The VIRT memory in top is basically meaningless - ignore it. See https://serverfault.com/questions/138427/top-what-does-virtual-memory-size-mean-linux-ubuntu What you should be looking at is RES - and 256M for mysql and a few dozen megs for Apache and mod-php is pretty nominal. In fact, for the server you appear to have ( Large with 7 gigs of memory) if you have more than 200 megs or so of data in your database ,you should probably use more of it for mysql, as it would yeild great performance gains.

If your site is slow, it's not because of memory.

A few questions to consider to determine likely performance bottlenecks:

  • what instance type are you using?
  • is it Ephemeral backed, or EBS Backed?
  • do you see spikes in Wait time when the server is being "slow"?
  • What php application are you running?

AWS instances often are underpowered for their memory and ephemeral storage. For example large instances have 7 gigs of ram, but only 2, 2ghz circa 2007 processors. So they're not fast by any means. The c1 and m3 line of instances do much to improve on this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top