So I created a LAMP site on a Fedora Linux server running on a dedicated 2GHZ Celeron server with 768MB RAM. I set it up, we launched, and it was off and running and I forgot about it. I got a call from my partner/friend the other day and he says that people have been using it and it's getting a bit slow. I'm pretty new to diagnosing server bottlnecks. Can someone check out my diagnosis here and maybe answer a question or two?
First, uname:
Code:
[root@mydomain root]# uname -a
Linux mydomain.mydomain.com 2.4.22-1.2115.nptl #1 Wed Oct 29 15:42:51 EST 2003 i686 i686 i386 GNU/Linux
I ran free during peak usage and noticed that I'm getting some memory swapping going on so it looks like more RAM is needed--at least I think so. I also ran top a bit after peak usage hours and got the following output:
Code:
16:16:42 up 463 days, 3:17, 1 user, load average: 1.05, 0.62, 0.64
109 processes: 108 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 0.4% 0.0% 2.9% 0.0% 0.0% 0.0% 96.5%
Mem: 765520k av, 608828k used, 156692k free, 0k shrd, 71488k buff
349696k active, 211724k inactive
Swap: 1052248k av, 120996k used, 931252k free 310264k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM CTIME CPU COMMAND
3818 root 16 0 38120 2692 2660 S 0.9 0.3 24762m 0 httpd
3691 mysql 16 0 17764 12M 10340 S 0.0 1.7 23293m 0 mysqld
4005 root 16 0 448 396 352 S 0.0 0.0 8793m 0 crond
4272 root 16 0 19640 8488 7396 S 0.0 1.1 2599m 0 spamd
1 root 16 0 256 232 204 S 0.0 0.0 940:05 0 init
3588 root 16 0 596 480 444 S 0.0 0.0 131:07 0 sshd
3743 root 16 0 1372 832 704 S 0.0 0.1 126:50 0 sendmail
3578 root 16 0 568 464 420 S 0.0 0.0 110:45 0 esshd
3613 root 15 0 468 400 352 S 0.0 0.0 109:42 0 xinetd
The CPU consumption for mysqld bursts into 50, 75, 90 per cent and higher range every now and then for a split second. The load average is getting fairly high too. Or is it?
Anyways, MY DIAGNOSIS:
* A bit of memory swapping to disk going on, but not much. 1.5GB to 2GB of RAM should remedy that (OR WOULD IT?). It might be nice to get more for unexpected bursts during peak hours.
* The server does NOT seem to be I/O bound so current disk drive configuration is probably adequate (COMMENTS?). If we want to plan ahead for future disk bottleneck, put Linux, Apache, and MySQL all on separate disks or use a RAID setup for all 3.
* A multi-core or multi-cpu system could provide better performance because Apache and MySQL would be able to execute code concurrently (I'm not sure of this...IS THIS TRUE?).
* Another possibly approach would be to put MYSQL on a separate machine with its own separate resources (PROS? CONS? WILL NETWORK PROVE TO BE A BOTTLENECK?)
Any help is much appreciated!