Help - Search - Members - Calendar
Full Version: Newb That Needs Help With Apache & MySQL Memory Usage
The Planet Forums > System Administration > General Support Questions
teedizz
Hello, for some reason I have been having NUMEROUS problem with apache & mysql using up all my memory on my server & cuasing me to have to reboot my server like 4-5 a day. It gets really annoying & its hard to run a some what decent forums when this continously happens. I currently have the cheapest server ev1 offers, I think its the 99 a month server. I upgarded my RAM to 1gb & that worked for a while but it started happening again.

I since had my freind LiteSpeed Web Server instead of apche & I did see a speed increase but it seems nothing has been fixed. heres what ev1 wrote to me:

CODE
The problem with your server is MailScanner, apache and mysql using up your memory. You will need to configure your apache to run more efficiently. You can read more about that here: [url="http://forum.ev1servers.net/showthread.php?t=61055&"]http://forum.ev1servers.net/showthread.php?t=61055&[/url] highlight=httpd.conf



03:44:07 up 54 min, 1 user, load average: 5.94, 4.30, 2.42

118 processes: 113 sleeping, 5 running, 0 zombie, 0 stopped

CPU states: cpu user nice system irq softirq iowait idle

total 79.0% 0.0% 20.7% 0.0% 0.1% 0.0% 0.0%

Mem: 1017328k av, 648256k used, 369072k free, 0k shrd, 32092k buff

535960k actv, 56780k in_d, 3376k in_c

Swap: 2048276k av, 0k used, 2048276k free 158440k cached



PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND

2765 apache 16 0 37060 36M 7236 S 0.0 3.6 0:40 0 httpd

4410 apache 15 0 37012 36M 7188 S 0.0 3.6 0:07 0 httpd

2395 root 15 0 35432 34M 2828 S 0.0 3.4 0:04 0 MailScanner

2480 root 15 0 35432 34M 2828 S 0.0 3.4 0:04 0 MailScanner

2558 root 15 0 35432 34M 2828 S 0.0 3.4 0:04 0 MailScanner

2665 root 15 0 35432 34M 2828 S 0.0 3.4 0:04 0 MailScanner

2788 root 15 0 35404 34M 2800 S 0.0 3.4 0:04 0 MailScanner

4482 apache 18 0 31720 30M 7228 R 19.9 3.1 0:12 0 httpd

2335 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:00 0 mysqld

2336 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:00 0 mysqld

2337 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:00 0 mysqld

2344 mysql 15 0 24124 23M 1820 S 0.0 2.3 1:09 0 mysqld

2997 mysql 15 0 24124 23M 1820 S 0.1 2.3 1:02 0 mysqld

3006 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:50 0 mysqld

3246 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:37 0 mysqld

4498 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:07 0 mysqld

4499 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:14 0 mysqld

4500 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:07 0 mysqld

4501 mysql 17 0 24124 23M 1820 R 41.0 2.3 0:06 0 mysqld

4502 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:08 0 mysqld

4589 mysql 16 0 24124 23M 1820 S 10.3 2.3 0:00 0 mysqld

4590 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:00 0 mysqld

4591 mysql 15 0 24124 23M 1820 S 0.0 2.3 0:01 0 mysqld

2755 apache 15 0 22908 22M 7236 S 0.0 2.2 0:34 0 httpd

2759 apache 15 0 22840 22M 7252 S 0.0 2.2 0:34 0 httpd

4409 apache 15 0 22580 22M 7224 S 0.7 2.2 0:12 0 httpd

2800 root 5 -10 21284 20M 4708 S < 0.0 2.0 0:00 0 ensim-python

4140 apache 15 0 19036 18M 7244 S 0.0 1.8 0:16 0 httpd

2767 apache 15 0 19032 18M 7264 S 0.0 1.8 0:21 0 httpd

2461 root 25 0 18756 18M 2440 S 0.0 1.8 0:01 0 spamd

2757 apache 15 0 17332 16M 7232 S 0.0 1.7 0:24 0 httpd

4408 apache 15 0 17140 16M 7228 S 1.7 1.6 0:04 0 httpd

2754 apache 15 0 17104 16M 7672 S 0.0 1.6 0:30 0 httpd



Ima newb at all this so i have no idea what this means. Can someone with some knowledge let me know. Thanks.
huck
Install sysstat so you can get historical data. This will be very useful for you to see trends in RAM, CPU, disk io and many other metrics.

A top output is just a snapshot in time.

In general we find the following to be the cause of a performance issues:
i. Poor config (no php caching, no mysql caching, poor apache settings, poor mysql settings).
ii. bad mysql -- we see many apps with just bad sql. there is nothing you can do here except fix the sql.
iii. Too little ram.
iv. Too little disk io
V. Too little CPU.

CPU speeds have soared compared to disk IO. IDE-33 may seem like a long time ago but even the latest SAS 10K RPM drives only turn 2-3x the IO. In the meantime, CPU speeds have soared, so CPU is rarely the issue.

Sysstat will give you the base line to help you or others start to find the bottleneck.
teedizz
do you do a paid service on the side to fix server issues?
eth00
QUOTE (teedizz)
do you do a paid service on the side to fix server issues?


Yes Huck is a very well respected member of the community and does provide commercial support via www.rackaid.com
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.