LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-02-2011, 01:03 AM   #1
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Rep: Reputation: 16
problem with swapoff -a


In our cluster, both the server and worker had been gone to swap and the performance is extremely slow. Although currently the memory is free but I don't know why the in the swap area is still being there and ubuntu doesn't move them to the memory and empty the swap.

On the other hand, when I run
Code:
sudo swapoff -a
on the server it says:
Code:
mahmood@server:~$ sudo swapoff -a
[sudo] password for mahmood:
swapoff: /dev/sda1: swapoff failed: Cannot allocate memory
Any idea about that?
 
Old 02-02-2011, 01:06 AM   #2
prodev05
Member
 
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
While switching off the swap, the running apps, doesn't know to take which memory. Is that apps cluster or OS Cluster?
 
Old 02-02-2011, 01:16 AM   #3
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
I don't exactly what you mean but they are normal applications and not OS
 
Old 02-02-2011, 01:22 AM   #4
prodev05
Member
 
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
some thing happened inside memory allocator. some thing junky-monkey :P
 
Old 02-02-2011, 01:27 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by mahmoodn View Post
Although currently the memory is free
How did you determine that ?. Show us evidence - /proc/meminfo would be acceptable.

swapoff is designed to fail if sufficient memory can't be allocated.
 
Old 02-02-2011, 01:32 AM   #6
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
Code:
mahmood@server:~$ cat /proc/meminfo
MemTotal:       33013844 kB
MemFree:           71028 kB
Buffers:           15480 kB
Cached:           370436 kB
SwapCached:      2124200 kB
Active:         26670708 kB
Inactive:        5321516 kB
Active(anon):   26630268 kB
Inactive(anon):  4977432 kB
Active(file):      40440 kB
Inactive(file):   344084 kB
Unevictable:       15784 kB
Mlocked:           15784 kB
SwapTotal:      62698488 kB
SwapFree:       33240212 kB
Dirty:               120 kB
Writeback:           124 kB
AnonPages:      30788868 kB
Mapped:            12224 kB
Shmem:                80 kB
Slab:              98160 kB
SReclaimable:      61580 kB
SUnreclaim:        36580 kB
KernelStack:        3816 kB
PageTables:       130440 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    79205408 kB
Committed_AS:   66997324 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      364908 kB
VmallocChunk:   34333713840 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        9920 kB
DirectMap2M:     3135488 kB
DirectMap1G:    30408704 kB
 
Old 02-02-2011, 01:37 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
.....and ubuntu doesn't move them to the memory and empty the swap.
If the amount of (free) physical memory is less then the amount occupied by swap, then you cannot turn off swap.

Quote:
In our cluster, both the server and worker had been gone to swap and the performance is extremely slow.
Turning off swap won't solve this problem, it will probably make it worse. Without any extra info it looks like your machine tries to allocate more resources then it has available.

Hope this helps.
 
Old 02-02-2011, 01:39 AM   #8
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
how can i sort processes by memory usage? TOP command sort them by cpu usage
 
Old 02-02-2011, 01:51 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Using top: Start top, press F or O and select the field you want to sort on.

Hope this helps.
 
Old 02-02-2011, 01:54 AM   #10
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Try to drop all caches from memory, but maybe first stop all main apps and then drop caches:

Code:
echo "3" > /proc/sys/vm/drop_caches
wait... for like a min, then

Code:
echo "0" > /proc/sys/vm/drop_caches
and check if you can swap off after.

Also, this might not help, because from what I saw in /proc/meminfo, you don't seems to have too much caches objects, but you can always try.
 
Old 02-02-2011, 02:44 AM   #11
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
Thanks. I found the honger process and emptied the swap.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do I have a path problem, an Apache2 problem or a Javascript problem or any other pro rblampain Linux - Networking 0 12-29-2010 03:50 AM
swapoff dangers? web_janitor Linux - Server 11 11-19-2008 09:31 AM
LXer: Swapoff Performance LXer Syndicated Linux News 0 09-10-2007 10:00 PM
RH9 - Swapoff /dev/hda3 - segmentation failure cobrichka Red Hat 1 12-30-2003 06:03 AM
swapoff problems with gentoo starquake Linux - Newbie 1 04-17-2003 03:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration