Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-02-2011, 01:03 AM
|
#1
|
Member
Registered: May 2010
Posts: 427
Rep:
|
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 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?
|
|
|
02-02-2011, 01:06 AM
|
#2
|
Member
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304
Rep:
|
While switching off the swap, the running apps, doesn't know to take which memory. Is that apps cluster or OS Cluster?
|
|
|
02-02-2011, 01:16 AM
|
#3
|
Member
Registered: May 2010
Posts: 427
Original Poster
Rep:
|
I don't exactly what you mean but they are normal applications and not OS
|
|
|
02-02-2011, 01:22 AM
|
#4
|
Member
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304
Rep:
|
some thing happened inside memory allocator. some thing junky-monkey :P
|
|
|
02-02-2011, 01:27 AM
|
#5
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,236
|
Quote:
Originally Posted by mahmoodn
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.
|
|
|
02-02-2011, 01:32 AM
|
#6
|
Member
Registered: May 2010
Posts: 427
Original Poster
Rep:
|
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
|
|
|
02-02-2011, 01:37 AM
|
#7
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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.
|
|
|
02-02-2011, 01:39 AM
|
#8
|
Member
Registered: May 2010
Posts: 427
Original Poster
Rep:
|
how can i sort processes by memory usage? TOP command sort them by cpu usage
|
|
|
02-02-2011, 01:51 AM
|
#9
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
Using top: Start top, press F or O and select the field you want to sort on.
Hope this helps.
|
|
|
02-02-2011, 01:54 AM
|
#10
|
Member
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749
Rep:
|
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.
|
|
|
02-02-2011, 02:44 AM
|
#11
|
Member
Registered: May 2010
Posts: 427
Original Poster
Rep:
|
Thanks. I found the honger process and emptied the swap.
|
|
|
All times are GMT -5. The time now is 01:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|