Results 1 to 9 of 9
Thread: Swap memory/Physical Memory
-
03-17-2011, 04:58 PM #1New Member
- Join Date
- Mar 2011
- Posts
- 4
Swap memory/Physical Memory
What would cause a server to be using swap memory even though it's not using all of the full memory?
I have one server that's been having really high loads the last couple of days.
The server has 12GB of Ram and it has only been using about 30-50% of that, but yet is using 30% swap.
Thanks
-
03-17-2011, 11:34 PM #2Web Hosting Master
- Join Date
- Nov 2006
- Location
- Karachi, Pakistan
- Posts
- 1,359
Nothing.
What has happened is that lot of traffic hit your server and it used up all its RAM and then started to use swap. By the time you logged in to check up on it traffic had died down and it was back to within RAM limits but swap space hadn't yet been freed. It probably will be freed eventually.
-
03-17-2011, 11:51 PM #3
It might be or it might not be. First off, I don't usually see the swap get freed in situations like this. Secondly, the ram "used", if you're relying on what cpanel tells you, is totally worthless. It will report a low ram use % even if you're using all of it. Go to ssh, type "free -m", and see how much you have free. Add "free" to "cached" to get your real free ram. I'm guessing there's 80% or more used.
IOFLOOD.com -- We Love Servers
Phoenix, AZ Dedicated Servers in under an hour
★ Ryzen 9: 7950x3D ★ Dual E5-2680v4 Xeon ★
Contact Us: sales@ioflood.com ★
-
03-19-2011, 03:34 PM #4WHT Addict
- Join Date
- Dec 2005
- Location
- The Netherlands
- Posts
- 107
It could be anything.
Perhaps you could post a ps -aux result here, so we can find out a little what's going on.
My first idea would be alot of apache/mysql processes are being spawned (needed or not), and causing alot of RAM usage.
Don't forget to addup the buffers and cache, if you use a panel like DirectAdmin or cPanel the figures you are seeing might be incorrect.
Swapping is the worst thing that could happen in any case, because it will kickdown your server in no-time.
High load though can also be caused by other things (and not always swapping), for example disk I/O waits.
If apache is spawning much processes, you might consider changing the configs so it accepts more connections and decrease the amount of processes being spawned.
However, we are touching in the dark (is that a valid English expression? ) without knowing more about your configuration, hardware in the machine and so on.
-
03-20-2011, 11:10 AM #5New Member
- Join Date
- Mar 2011
- Posts
- 4
Thank you for the replies.
Turns out I've learned 3 things -
1) The memory in cpanel is what I was looking at it and was indeed VERY incorrect.
2) The swap was indeed just there from previously and needed to be freed up.
3) Not all servers are created equally. For months, I've been mentally struggling with why a $400 server at one host can't handle anywhere near what a $250 server at another host can. I think I expected too much from the $400 one just because it was more expensive. Guess I'll be getting more of those $250 and doing lots of transferring....
Thanks again.
-
03-20-2011, 05:54 PM #6Newbie
- Join Date
- Mar 2011
- Posts
- 13
If you have enough memory you can disable swap, though its not recommended in all situations.
swapoff -a
-
03-22-2011, 07:57 PM #7New Member
- Join Date
- Mar 2011
- Posts
- 4
Well, this server went haywire again today - loads over 300.
I watched it for an hour or so and it fluctuated between 100 and 300. Started suspending accounts and it did drop down. At this point, I have every account suspended, so that I can try to get some of my better-earnings sites off of there and onto another server. Copy wouldn't work with the loads that high.
After suspending all of the accounts, noticed that it was using swap again. So I cleared that. I have a copy of 2 accounts running (they are large-ish accounts) and still all accounts suspended. Left the computer for dinner - came back and it had gone into swap again - just a bit, but still frustrating since all of my sites are down!
--------------------
Here's the ps aux that someone mentioned:
root@host [~]# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 10352 680 ? Ss Mar15 0:16 init [3]
root 2 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/0]
root 5 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/1]
root 6 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/1]
root 7 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/1]
root 8 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/2]
root 9 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/2]
root 10 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/2]
root 11 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/3]
root 12 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/3]
root 13 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/3]
root 14 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/4]
root 15 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/4]
root 16 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/4]
root 17 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/5]
root 18 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/5]
root 19 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/5]
root 20 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/6]
root 21 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/6]
root 22 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/6]
root 23 0.0 0.0 0 0 ? S< Mar15 0:00 [migration/7]
root 24 0.0 0.0 0 0 ? SN Mar15 0:00 [ksoftirqd/7]
root 25 0.0 0.0 0 0 ? S< Mar15 0:00 [watchdog/7]
root 26 0.0 0.0 0 0 ? S< Mar15 0:00 [events/0]
root 27 0.0 0.0 0 0 ? S< Mar15 0:00 [events/1]
root 28 0.0 0.0 0 0 ? S< Mar15 0:00 [events/2]
root 29 0.0 0.0 0 0 ? S< Mar15 0:00 [events/3]
root 30 0.0 0.0 0 0 ? S< Mar15 0:00 [events/4]
root 31 0.0 0.0 0 0 ? S< Mar15 0:00 [events/5]
root 32 0.0 0.0 0 0 ? S< Mar15 0:00 [events/6]
root 33 0.0 0.0 0 0 ? S< Mar15 0:00 [events/7]
root 34 0.0 0.0 0 0 ? S< Mar15 0:00 [khelper]
root 135 0.0 0.0 0 0 ? S< Mar15 0:00 [kthread]
root 146 0.0 0.0 0 0 ? S< Mar15 0:00 [kblockd/0]
root 147 0.0 0.0 0 0 ? S< Mar15 1:27 [kblockd/1]
root 148 0.0 0.0 0 0 ? S< Mar15 0:00 [kblockd/2]
root 149 0.0 0.0 0 0 ? S< Mar15 0:00 [kblockd/3]
root 150 0.0 0.0 0 0 ? S< Mar15 0:00 [kblockd/4]
root 151 0.0 0.0 0 0 ? S< Mar15 0:13 [kblockd/5]
root 152 0.0 0.0 0 0 ? S< Mar15 0:00 [kblockd/6]
root 153 0.0 0.0 0 0 ? S< Mar15 0:00 [kblockd/7]
root 154 0.0 0.0 0 0 ? S< Mar15 0:00 [kacpid]
root 306 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/0]
root 307 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/1]
root 308 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/2]
root 309 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/3]
root 310 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/4]
root 311 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/5]
root 312 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/6]
root 313 0.0 0.0 0 0 ? S< Mar15 0:00 [cqueue/7]
root 316 0.0 0.0 0 0 ? S< Mar15 0:00 [khubd]
root 318 0.0 0.0 0 0 ? S< Mar15 0:00 [kseriod]
root 440 0.0 0.0 0 0 ? S Mar15 0:00 [khungtaskd]
root 443 0.0 0.0 0 0 ? S< Mar15 5:19 [kswapd0]
root 444 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/0]
root 445 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/1]
root 446 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/2]
root 447 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/3]
root 448 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/4]
root 449 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/5]
root 450 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/6]
root 451 0.0 0.0 0 0 ? S< Mar15 0:00 [aio/7]
root 606 0.0 0.0 0 0 ? S< Mar15 0:00 [kpsmoused]
root 685 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/0]
root 686 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/1]
root 687 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/2]
root 688 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/3]
root 689 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/4]
root 690 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/5]
root 691 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/6]
root 692 0.0 0.0 0 0 ? S< Mar15 0:00 [ata/7]
root 693 0.0 0.0 0 0 ? S< Mar15 0:00 [ata_aux]
root 703 0.0 0.0 0 0 ? S< Mar15 0:00 [scsi_eh_0]
root 704 0.0 0.0 0 0 ? S< Mar15 0:00 [scsi_eh_1]
root 705 0.0 0.0 0 0 ? S< Mar15 0:00 [scsi_eh_2]
root 706 0.0 0.0 0 0 ? S< Mar15 0:00 [scsi_eh_3]
root 725 0.0 0.0 0 0 ? S< Mar15 0:00 [kstriped]
root 762 0.0 0.0 0 0 ? S< Mar15 0:15 [kjournald]
root 792 0.0 0.0 0 0 ? S< Mar15 0:03 [kauditd]
root 825 0.0 0.0 13672 1932 ? S<s Mar15 0:00 /sbin/udevd -d
root 1920 0.2 0.0 0 0 ? S 17:12 0:12 [pdflush]
root 2255 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/0]
root 2256 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/1]
root 2257 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/2]
root 2258 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/3]
root 2259 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/4]
root 2260 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/5]
root 2261 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/6]
root 2262 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpathd/7]
root 2263 0.0 0.0 0 0 ? S< Mar15 0:00 [kmpath_handle]
root 2302 0.0 0.0 0 0 ? S< Mar15 0:30 [kjournald]
root 2304 0.0 0.0 0 0 ? S< Mar15 0:00 [kjournald]
root 2306 0.0 0.0 0 0 ? S< Mar15 2:39 [kjournald]
root 2308 0.0 0.0 0 0 ? S< Mar15 0:28 [kjournald]
root 2310 0.0 0.0 0 0 ? S< Mar15 0:50 [kjournald]
root 2312 0.0 0.0 0 0 ? S< Mar15 1:43 [kjournald]
root 2314 0.0 0.0 0 0 ? S< Mar15 0:16 [kjournald]
root 2487 28.8 0.0 3808 444 ? RN 18:47 0:34 /usr/bin/md5sum
root 2669 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/0]
root 2670 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/1]
root 2671 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/2]
root 2672 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/3]
root 2673 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/4]
root 2674 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/5]
root 2675 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/6]
root 2676 0.0 0.0 0 0 ? S< Mar15 0:00 [kondemand/7]
root 3056 0.0 0.0 92888 904 ? S<sl Mar15 0:21 auditd
root 3058 0.0 0.0 147352 1104 ? S<sl Mar15 0:10 /sbin/audispd
root 3161 0.0 0.0 65600 980 pts/0 R+ 18:49 0:00 ps aux
root 3191 0.0 0.1 27628 17824 ? Ss Mar15 0:01 /usr/sbin/resto
root 3204 0.0 0.0 5912 612 ? Ss Mar15 0:22 syslogd -m 0
root 3207 0.0 0.0 3808 428 ? Ss Mar15 0:00 klogd -x
root 3221 0.0 0.0 10764 376 ? Ss Mar15 0:03 irqbalance
dbus 3244 0.0 0.0 31504 816 ? Ssl Mar15 0:00 dbus-daemon --s
root 3259 0.0 0.0 3804 544 ? Ss Mar15 0:00 /usr/sbin/acpid
root 3294 0.0 0.0 121992 1116 ? Ssl Mar15 0:00 automount
root 3371 0.0 0.0 158572 5744 ? Sl Mar15 0:15 /usr/sbin/snmpd
root 3388 0.0 0.0 62628 1148 ? Ss Mar15 0:00 /usr/sbin/sshd
root 3850 0.4 0.8 188460 98732 ? S 15:12 0:52 spamd child
root 4894 0.0 1.1 347524 137100 ? Ssl Mar15 1:09 /usr/sbin/clamd
mailnull 4901 0.0 0.0 64332 2072 ? Ss Mar15 0:04 /usr/sbin/exim
root 4980 0.0 0.0 12412 640 ? Ss Mar15 0:02 /usr/sbin/dovec
root 4981 0.0 0.0 19144 1108 ? S Mar15 0:03 dovecot-auth
dovecot 4994 0.0 0.0 38288 2024 ? S Mar15 0:01 pop3-login
dovecot 4995 0.0 0.0 38288 1980 ? S Mar15 0:00 pop3-login
dovecot 4996 0.0 0.0 38736 2552 ? S Mar15 0:16 imap-login
dovecot 4997 0.0 0.0 38604 2324 ? S Mar15 0:04 imap-login
root 5045 0.0 0.0 93356 1244 ? Ss Mar15 0:00 pure-ftpd (SERV
root 5047 0.0 0.0 91000 936 ? S Mar15 0:00 /usr/sbin/pure-
root 5060 0.0 0.0 74816 1256 ? Ss Mar15 0:05 crond
root 5074 0.0 0.0 18736 460 ? Ss Mar15 0:00 /usr/sbin/atd
root 5292 0.0 0.1 97708 16284 ? S Mar15 0:00 cpdavd - accept
root 5321 0.0 0.0 40788 7532 ? S Mar15 0:00 queueprocd - wa
root 5331 0.0 0.0 46160 9416 ? S Mar15 0:11 tailwatchd
root 5337 0.0 0.0 26012 2176 ? SN Mar15 0:00 cpanellogd - sl
root 5358 0.0 0.0 86568 12176 ? S Mar15 0:04 cpsrvd - waitin
mailman 5383 0.0 0.0 92936 6376 ? Ss Mar15 0:00 /usr/local/cpan
root 5395 0.0 0.1 120972 15988 ? Ss 00:00 0:17 lfd - sleeping
68 5419 0.0 0.0 31260 3644 ? Ss Mar15 0:00 hald
root 5420 0.0 0.0 21700 752 ? S Mar15 0:00 hald-runner
mailman 5421 0.0 0.0 90836 7836 ? S Mar15 0:02 /usr/local/cpan
mailman 5422 0.0 0.0 90840 7852 ? S Mar15 0:02 /usr/local/cpan
mailman 5423 0.0 0.0 90840 7832 ? S Mar15 0:02 /usr/local/cpan
mailman 5424 0.0 0.0 90848 7824 ? S Mar15 0:02 /usr/local/cpan
mailman 5425 0.0 0.0 90856 7876 ? S Mar15 0:02 /usr/local/cpan
mailman 5426 0.0 0.0 90988 7944 ? S Mar15 0:02 /usr/local/cpan
mailman 5427 0.0 0.0 90920 7836 ? S Mar15 0:02 /usr/local/cpan
mailman 5428 0.0 0.0 90920 7828 ? S Mar15 0:00 /usr/local/cpan
68 5468 0.0 0.0 12328 660 ? S Mar15 0:00 hald-addon-acpi
named 5478 0.0 0.3 500356 41992 ? Ssl Mar15 7:57 /usr/sbin/named
68 5489 0.0 0.0 12328 660 ? S Mar15 0:00 hald-addon-keyb
root 5537 0.0 0.0 3816 312 ? Ss Mar15 0:00 /usr/sbin/ports
root 5603 0.0 0.0 153600 8916 ? S Mar15 0:00 /usr/local/wt_p
root 5630 0.1 0.0 0 0 ? SN Mar15 20:14 [kipmi0]
nobody 5725 0.0 0.0 ****0 300 ? Ss Mar15 0:00 /var/dcc/libexe
nobody 5726 0.0 0.0 74864 7656 ? Sl Mar15 0:13 /var/dcc/libexe
root 5742 0.0 0.0 18420 448 ? S Mar15 0:00 /usr/sbin/smart
root 5745 0.0 0.0 3796 472 tty1 Ss+ Mar15 0:00 /sbin/mingetty
root 5746 0.0 0.0 3796 472 tty2 Ss+ Mar15 0:00 /sbin/mingetty
root 5747 0.0 0.0 3796 472 tty3 Ss+ Mar15 0:00 /sbin/mingetty
root 5748 0.0 0.0 3796 472 tty4 Ss+ Mar15 0:00 /sbin/mingetty
root 5749 0.0 0.0 3796 468 tty5 Ss+ Mar15 0:00 /sbin/mingetty
root 5750 0.0 0.0 3796 468 tty6 Ss+ Mar15 0:00 /sbin/mingetty
root 5752 0.0 0.0 3800 440 ttyS1 Ss+ Mar15 0:00 /sbin/agetty -h
root 6622 0.1 0.0 22744 4132 ? S Mar15 12:44 /usr/local/wt_p
root 6819 0.0 0.0 92184 3364 ? Ss 17:24 0:00 sshd: root@pts/
root 7119 0.0 0.0 66072 1608 pts/0 Ss 17:25 0:00 -bash
root 7425 0.0 0.7 179284 89560 ? S 15:38 0:02 spamd child
root 10870 0.0 0.0 3784 452 ? SN 17:37 0:00 /usr/local/cpan
root 10871 0.0 0.1 61748 18528 ? SNs 17:37 0:01 pkgacct - wells
root 13275 0.0 0.0 0 0 ? S 16:17 0:05 [pdflush]
silkweav 15064 8.3 0.1 86828 13664 ? Ss 17:49 5:03 whostmgrd - ser
silkweav 15067 2.0 0.0 21296 1332 ? S 17:49 1:13 /bin/gtar -c -f
root 19288 0.4 1.0 154400 132320 ? S< 18:06 0:12 litespeed (lsht
root 19289 0.0 0.0 5876 440 ? S< 18:06 0:00 httpd (lscgid)
root 19528 0.0 0.0 45260 7808 ? SNs 00:59 0:00 /scripts/cpback
nobody 19536 0.1 1.0 154456 132244 ? S< 18:07 0:03 litespeed (lsht
nobody 19537 0.4 1.0 154472 132636 ? S< 18:07 0:10 litespeed (lsht
root 22990 0.0 0.6 173984 84536 ? Ss Mar16 0:07 /usr/bin/spamd
root 26800 0.0 0.0 63844 1168 ? S Mar15 0:00 /bin/sh /usr/bi
mysql 26934 28.3 8.1 1474912 1004340 ? Sl Mar15 2848:22 /usr/sbin/mysq
root@host [~]#
and here is the free -m
total used free shared buffers cached
Mem: 12009 11948 61 0 157 9646
-/+ buffers/cache: 2145 9864
Swap: 2047 0 2047
(I have since cleared the swap again)
-------------------------------------
Anyone have any idea what is bogging the server down? I appreciate any insight - I really don't know yet how to diagnose these things myself.
Thanks
Twinmom
-
03-22-2011, 08:12 PM #8Web Hosting Master
- Join Date
- Sep 2010
- Location
- /usr/bin/fail
- Posts
- 859
These two should answer as to why its was at 100-300.. cpanel backups was running and was tarring up a site.
silkweav 15067 2.0 0.0 21296 1332 ? S 17:49 1:13 /bin/gtar -c -f
root 19528 0.0 0.0 45260 7808 ? SNs 00:59 0:00 /scripts/cpback
-
03-22-2011, 08:23 PM #9New Member
- Join Date
- Mar 2011
- Posts
- 4
Whoa! That makes sense, though. Thank you.
Next question, how can I prevent those backups from doing that?
Or is there a way?
Similar Threads
-
Physical memory running out
By matthisco in forum Web HostingReplies: 14Last Post: 05-15-2009, 04:41 AM -
I'm missing 7 GB of ram: Installed Physical Memory 8 GB / Total Physical Memory 1 GB
By smartins in forum Dedicated ServerReplies: 21Last Post: 04-04-2009, 06:38 PM -
VPS and physical memory
By pw911 in forum VPS HostingReplies: 5Last Post: 11-02-2008, 08:48 PM -
Physical memory
By Dras in forum Running a Web Hosting BusinessReplies: 7Last Post: 07-29-2003, 11:55 AM -
Physical Memory??
By Eiv in forum Hosting Security and TechnologyReplies: 1Last Post: 11-24-2001, 12:07 PM