TOP questions


#1

I was told that I am using too much memory…

Even though I managed to bring CPU down I am not allowed to move to reseller account because of memory issue.

I run top and this is what I see:

top - 21:56:22 up 2 days, 22:02, 1 user, load average: 0.66, 0.88, 1.14
Tasks: 38 total, 2 running, 35 sleeping, 0 stopped, 1 zombie
Cpu(s): 60.2% us, 12.6% sy, 0.0% ni, 22.1% id, 4.3% wa, 0.2% hi, 0.5% si
Mem: 417792k total, 342796k used, 74996k free, 0k buffers
Swap: 417792k total, 0k used, 417792k free, 0k cached

PID USER PR NI RES VIRT SHR S %CPU %MEM TIME+ PPID SWAP TIME CODE DATA COMMAND
1522 teguh123 15 0 1036 2132 836 R 0.0 0.2 0:00.03 31248 1096 0:00 48 280 top
2541 teguh123 16 0 0 0 0 Z 1.3 0.0 0:00.04 1845 0 0:00 0 0 php5.cgi
31243 teguh123 15 0 1216 6108 912 R 0.0 0.3 0:00.10 31130 4892 0:00 276 456 sshd
31248 teguh123 15 0 1384 2608 1128 S 0.0 0.3 0:00.00 31243 1224 0:00 592 228 bash
1 root 15 0 576 1848 496 S 0.0 0.1 0:01.84 0 1272 0:01 32 280 init
2407 root 15 0 1512 2820 676 S 0.0 0.4 0:14.41 1 1308 0:14 276 960 syslog-ng
2445 root 15 0 20m 31468 5840 S 0.0 4.9 0:20.43 1 10m 0:20 316 14m apache2-teguh12
2461 root 15 0 480 1616 420 S 0.0 0.1 0:00.02 1 1136 0:00 20 232 inetd
2572 root 15 0 1156 3044 980 S 0.0 0.3 0:01.17 1 1888 0:01 24 264 master
2582 root 15 0 928 3548 696 S 0.0 0.2 0:00.60 1 2620 0:00 276 456 sshd
2599 root 15 0 756 1824 608 S 0.0 0.2 0:03.27 1 1068 0:03 28 248 cron
2609 root 20 0 448 1572 388 S 0.0 0.1 0:00.04 1 1124 0:00 16 232 ud
31130 root 15 0 1536 6124 1240 S 0.0 0.4 0:00.00 2582 4588 0:00 276 456 sshd
1732 postfix 15 0 1660 3400 1408 S 0.0 0.4 0:00.00 2572 1740 0:00 28 436 cleanup
1733 postfix 15 0 1456 3232 1244 S 0.0 0.3 0:00.00 2572 1776 0:00 16 436 trivial-rewrite
1775 postfix 16 0 1532 3252 1304 S 0.0 0.4 0:00.00 2572 1720 0:00 36 436 local
1790 postfix 16 0 1336 3108 1132 S 0.0 0.3 0:00.00 2572 1772 0:00 32 264 smtp
2577 postfix 15 0 1228 3084 1016 S 0.0 0.3 0:01.03 2572 1856 0:01 40 264 qmgr
17659 postfix 17 0 1172 3052 992 S 0.0 0.3 0:00.00 2572 1880 0:00 8 264 pickup
558 obd 25 0 1384 2704 976 S 0.0 0.3 0:00.00 2593 1320 0:00 428 636 proftpd
2593 nobody 18 0 832 2464 472 S 0.0 0.2 0:00.14 1 1632 0:00 428 580 proftpd
507 dhapache 15 0 18m 31816 3864 S 0.3 4.5 0:00.20 2445 12m 0:00 316 15m apache2-teguh12
516 dhapache 15 0 18m 31860 4024 S 0.3 4.6 0:00.17 2445 12m 0:00 316 15m apache2-teguh12
604 dhapache 18 0 18m 31792 3864 S 0.0 4.5 0:00.16 2445 12m 0:00 316 15m apache2-teguh12
1488 dhapache 15 0 18m 31864 3868 S 0.0 4.6 0:00.10 2445 12m 0:00 316 15m apache2-teguh12
1845 dhapache 15 0 18m 31752 3864 S 0.3 4.5 0:00.04 2445 12m 0:00 316 15m apache2-teguh12
2377 dhapache 15 0 18m 31776 3860 S 0.0 4.5 0:00.00 2445 12m 0:00 316 15m apache2-teguh12
2470 dhapache 15 0 18m 31744 3820 S 0.0 4.5 0:00.00 2445 12m 0:00 316 15m apache2-teguh12
2478 dhapache 15 0 18m 31744 3820 S 0.0 4.5 0:00.00 2445 12m 0:00 316 15m apache2-teguh12
2479 dhapache 15 0 18m 31776 3848 S 0.0 4.5 0:00.00 2445 12m 0:00 316 15m apache2-teguh12
30368 dhapache 18 0 15m 31468 1196 S 0.0 3.8 0:00.00 2445 15m 0:00 316 14m apache2-teguh12
31136 dhapache 15 0 18m 31824 3868 S 0.0 4.6 0:00.29 2445 12m 0:00 316 15m apache2-teguh12
31137 dhapache 16 0 18m 31992 3868 S 0.0 4.6 0:00.30 2445 12m 0:00 316 15m apache2-teguh12
31765 dhapache 15 0 18m 31864 3868 S 0.0 4.6 0:00.25 2445 12m 0:00 316 15m apache2-teguh12
32169 dhapache 15 0 18m 31936 3868 S 0.0 4.6 0:00.19 2445 12m 0:00 316 15m apache2-teguh12
32170 dhapache 15 0 18m 31952 3868 S 0.0 4.6 0:00.22 2445 12m 0:00 316 15m apache2-teguh12
32298 dhapache 15 0 18m 31840 3868 S 0.3 4.6 0:00.22 2445 12m 0:00 316 15m apache2-teguh12
2596 daemon 18 0 388 1768 308 S 0.0 0.1 0:00.00 1 1380 0:00 16 248 atd

Some things are strange.

For example, most of the time I got like 40 sleeping processes…

Why are the sleeping processes still there?

Also, every time someone visit my sites, my program would execute for like less than 1 seconds and finish…

So why all the memory is not erased?

The user that’s running all the sleeping process are called dhapache… What the hell is that guy doing and why my processes sleeps for so long?

PID 30368, for example, has been around for minutes…


#2

Please don’t post your request for help with ‘top’ multiple times and in multiple forums.

-Scott