Portal Home > Knowledgebase > Articles Database > memory and swap problem linux server
memory and swap problem linux server
Posted by roeybl, 02-12-2011, 05:58 PM |
hi
i hava a dediceited server
2 porc amd optron
6gb ram
2 sata disks
centos 5.5 64 bit
Apache 2.2.17
DirectAdmin 1.37.0
Exim 4.69
MySQL 5.1.54
Named 9.3.6
ProFTPd 1.3.3d
sshd
vm-Pop3d 1.1.7f-DA-2
Php 5.2.17
i am using csf (firewall)
and eAccelerator
this is his conf
eAccelerator support enabled
Version 0.9.6.1
Caching Enabled true
Optimizer Enabled true
Check mtime Enabled true
Memory Size 16,777,144 Bytes
Memory Available 2,352 Bytes
Memory Allocated 16,774,792 Bytes
Cached Scripts 134
Removed Scripts 0
Directive Local Value Master Value
eaccelerator.allowed_admin_path no value no value
eaccelerator.cache_dir /tmp/eaccelerator /tmp/eaccelerator
eaccelerator.check_mtime 1 1
eaccelerator.debug 0 0
eaccelerator.enable 1 1
eaccelerator.filter no value no value
eaccelerator.log_file no value no value
eaccelerator.optimizer 1 1
eaccelerator.shm_max 0 0
eaccelerator.shm_only 0 0
eaccelerator.shm_prune_period 0 0
eaccelerator.shm_size 16 16
eaccelerator.shm_ttl 0 0
most of the time it seems all the memory is being used and the swap as well
the server keeps working good and the load is low
i am hosting my sites and 2 radio accounts
i need some advise what to do ?
and some times
thnx
|
Posted by Squidix - SamBarrow, 02-12-2011, 06:00 PM |
From this output it looks like you're not using any swap or memory.
|
Posted by roeybl, 02-12-2011, 06:04 PM |
the forum show it wrong
it like this
and some times
Mem: 6107092k total, 6077908k used, 29184k free, 113592k buffers
Swap: 2031608k total, 2030756k used, 852k free, 5028392k cached
|
Posted by wartungsfenster, 02-12-2011, 06:16 PM |
if something is eating up your ram, check what it is.
ps -eo pmem,pcpu,rss,vsize,pid,args | sort -k 1 -r | head -30
besides, when asking for help, it'd be real nice if you bothered to write readable instead of just letting it be with the keys you didn't miss.
|
Posted by roeybl, 02-12-2011, 06:25 PM |
tnx for your fast reply
i didnt understand you lest line .
this is the output
%MEM %CPU RSS VSZ PID COMMAND
5.4 30.7 333064 1018568 25171 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/myserv2.com.err --pid-file=/var/lib/mysql/myserv2.pid
2.4 0.1 147312 351068 4141 /usr/local/sbin/clamd
0.4 7.7 28456 184108 25154 /usr/sbin/httpd -k start -DSSL
0.4 4.1 29388 133536 23164 /usr/sbin/httpd -k start -DSSL
0.4 4.1 25980 130128 27756 /usr/sbin/httpd -k start -DSSL
0.4 3.5 25916 129416 22029 /usr/sbin/httpd -k start -DSSL
0.4 2.6 28880 184288 22612 /usr/sbin/httpd -k start -DSSL
0.4 0.0 25116 128152 9886 lfd - sleeping
0.3 7.4 19448 124860 27742 /usr/sbin/httpd -k start -DSSL
0.3 4.5 21896 125148 27755 /usr/sbin/httpd -k start -DSSL
0.3 4.3 20092 123892 27921 /usr/sbin/httpd -k start -DSSL
0.3 4.1 21212 124664 27431 /usr/sbin/httpd -k start -DSSL
0.3 2.9 20804 179860 23791 /usr/sbin/httpd -k start -DSSL
0.2 1.3 17040 123764 27837 /usr/sbin/httpd -k start -DSSL
0.2 0.5 12552 122564 28002 /usr/sbin/httpd -k start -DSSL
0.2 0.0 16648 66624 12479 /usr/local/bin/freshclam -d -c 6
0.1 14.0 10128 35044 28082 /usr/bin/perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=myserv2.com -staticlinks=myserv2.com.1102 -diricons=icon -configdir=/home/shai/domains/myserv2.com/awstats/.data -output=keywords
0.1 0.0 9208 92228 6711 /usr/local/bin/php /home/mysite/domains/my-site.co.il/public_html/mail/send_mail.php
0.1 0.0 10008 119824 14825 /usr/sbin/httpd -k start -DSSL
0.0 2.2 3840 49176 15960 /usr/local/directadmin/dataskq
0.0 0.1 0 0 558 [kjournald]
0.0 0.1 0 0 3370 [pdflush]
0.0 0.1 0 0 2561 [pdflush]
0.0 0.0 984 8704 28081 sh -c "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -config=myserv2.com -staticlinks=myserv2.com.1102 -diricons=icon -configdir=/home/shai/domains/myserv2.com/awstats/.data -output=keywords 2>&1
0.0 0.0 984 8704 27525 sh -c /usr/local/directadmin/scripts/awstats_process.sh shai myserv2.com 2>&1
0.0 0.0 948 76632 3747 SCREEN -A -m -d -S radio ./sc_serv
0.0 0.0 872 21500 2623 dbus-daemon --system
0.0 0.0 852 63496 28086 ps -eo pmem,pcpu,rss,vsize,pid,args
0.0 0.0 76 14480 27810 vm-pop3d -d 10 -t 600
|
Posted by Hostify Networks, 02-12-2011, 07:01 PM |
You have almost 5gb of free memory. If you look at the cache column, that is memory that can be freed up instantly and used elsewhere.
It's interesting that you are using almost 2gb of swap. You'll want to monitor the server so you can figure out what is causing that. This is typically caused by running out of memory. My guess is that this is occurring during peak usage hours.
|
Posted by roeybl, 02-12-2011, 07:23 PM |
i see only 29mb of memory free ... :/
Mem: 6107092k total, 6077908k used, 29184k free, 113592k buffers
Swap: 2031608k total, 2030756k used, 852k free, 5028392k cached
|
Posted by Hostify Networks, 02-12-2011, 07:29 PM |
It seems you missed this part of my post:
Essentially, cache is free memory.
|
Posted by roeybl, 02-12-2011, 08:44 PM |
ok i understed/
so this is cached memory is good ?
or i need to limit the cached memory ?
swap is being used and this is not a good thing . no ?
|
Posted by Tom,, 02-12-2011, 08:44 PM |
If you run a command such as -
It'll clear the cached memory. However all this will do if anything is make your server slower.
|
Posted by Hostify Networks, 02-12-2011, 08:48 PM |
Cached memory is good. No need to limit or clear at any point. The OS will take care of managing the cache for you.
Swap being used is bad if it's impacting the performance of your server. Normally, swap won't be used, so something is using up all the memory on your server at some point, but is then freeing it up. Once again, that's not really a problem unless it is making a noticeable impact on the performance of your server.
|
Posted by roeybl, 02-12-2011, 08:49 PM |
so this is a good thing i shouldnt change someting ?
|
Posted by netmar, 02-13-2011, 01:39 PM |
You don't need to change anything. Like Hostify was saying, it's mostly cache. If you look at the second line, that starts with -/+, that's the real amount of memory that is being used (910) and that's free (5053).
|
Posted by roeybl, 02-13-2011, 03:29 PM |
your all great
thx !!!
|
Add to Favourites Print this Article
Also Read