Swap space is never used, are my settings correct
I'm on GNU/Linux and top command always show that swap space is always 0k used!
How to make sure that its used. I changed its priority from -1 to 1. Its still not used.
Please help me out.
Following are the various stats:
<<<<<<<<<<<<<<<<<<<<<<<br />
top - 04:30:55 up 1 day, 1:35, 2 users, load average: 1.04, 0.47, 0.46
Tasks: 106 total, 2 running, 104 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.0% us, 3.4% sy, 1.3% ni, 85.2% id, 6.4% wa, 0.0% hi, 2.7% si
Mem: 3089396k total, 1954548k used, 1134848k free, 157268k buffers
Swap: 2031608k total, 0k used, 2031608k free, 1290560k cached
%cat /proc/sys/vm/swappiness
60
%swapon -s
Filename Type Size Used Priority
/dev/mapper/VolGroup00-LogVol01 partition 2031608 0 1
# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/hda /media/cdrom auto pamconsole,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Comments
-
Your results are showing that you have 3G of RAM which is more than enough for most basic tasks, in most cases swap is used as overflow when you exceed your RAM space. I do not understand why you would want to use swap instead of RAM, but you can change the priority by changing your swappiness value, the higher the value (up to 100) the greater potential for swap to be used.
In my case with my desktop which has 4G or RAM, I only use swap space when I am running virtual machines.0 -
Thanks for the help.
More background: This machine is a server machine. There are seven to eight other client machines in the intranet which copies data from this server; upto 400MB data is copied by each client. Each client continously writes data to the server machine. So it may happen that 400MB * 7; this much data is transferred from the server!!! Plus non-stop writes to server!!
Problem: Many times, when the client machine is trying to access html pages via the browser, it takes few minutes (upto 5 minutes) to deliver the data. For this slowness I suspected that since the swap space is not used we are getting this slow response.
I want to know how to improve the performance and if unused swap space is the cause.0 -
The RAM has much greater response speed than the swap, with that being the case I do not think that is the bottleneck, I think it is most likely related to available cpu cycles.
You can try increasing the swappiness to see if that will improve performance. But I think the bottleneck could be in the cpu scheduling, a network bottleneck or even an issue with the disk performance. Since this is a production server it would not be best to just start changing things, you need to run some logging and conduct some research before implementing a change or you will risk creating greater performance issues.
If you can confirm that the issue is a full cpu during these long wait times, then you would want to use the renice tool to change cpu priorities for applications to give your web services greater priority. http://www.linux.com/archive/feed/58638
If the issue is a network issue then you must look at replacing the low throughput hardware to allow more traffic to pass to the server.
After the information you posted about the delay I would interested in seeing exactly what is causing that kind of a delay, so please keep us updated on what you try and what you find.0 -
Another posibility is a bottle neck at the bus with the drives. If you are really reading and writing that much data simultaneously to that machine, the drives and the bus that the drives are on may not be able to keep up.
Sources of a network bottle neck can be anythng from the switch being used in the LAN, to improper cabling (e.g. too much untwisted where it was crimped), to the bus into which the network card is plugged. Consider for example, a 1000baseT card plugged into a PCI bus. A PCI bus will NOT move data at 1000bps ....0 -
I tried changing the swapiness to 100 but it did not showed any swap usage via top; although I'm waiting for observing it when same problem is seen again. I'll check if its a full CPU issue and record top details with full load.
Another thing is that this particular server is a VM. (sorry, forgot to mention this earlier). I'll keep updating.0 -
Since it is a VM there are additional layers that could be causing the problem such as contending for resources with other VMs running under the same host or potential issues with the virtual disks. I would recommend monitoring both the VM client and the host machine to track bottlenecks and their sources.0
-
The issue just happened, so after fours days of up time the server memory shows following:
top - 09:03:38 up 3 days, 22 min, 2 users, load average: 0.00, 0.03, 0.00
Tasks: 104 total, 1 running, 103 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2% us, 0.2% sy, 0.0% ni, 98.6% id, 0.8% wa, 0.0% hi, 0.1% si
Mem: 3089396k total, 3059924k used, 29472k free, 137096k buffers
Swap: 2031608k total, 0k used, 2031608k free, 2526236k cached
So, at this time when any client tries to copy that 200mb file, it hangs. So, somehow it never starts using the
swap space. (which its supposed to start using when RAM is near full!)
I am now rebooting the server to avail all the 3gb RAM!0 -
Based upon the amount of RAM that is still showing as free, I don't think the actions are really eating the RAM. Have you considered that the RAM may be used for the prefetch operations? Read http://www.linuxatemyram.com/ to learn about RAM usage, it will also tell you how to free the cache next time it appears full so you can properly asses the RAM use.
I highly recommend looking to the operations on the host machine and the other virtual machines on the host to find the source of the bottleneck.0 -
Ram is like real food and swap is like army rations. You only eat the army rations when you run out of real food, and when you have to eat army rations, life sucks. Whatever solution you come up with, using swap is probably not what you want to do.
What virtualization system are you using? Vmware? Xen? KVM? What other things is the virtualization host doing? How many other VMs are you running? How are they behaving?
What kind of HDD setup do you have? If the host/dom0/metal just has a regular disk, and your'e sharing it among multiple VMs including this IO intensive one, that's probably your bottleneck. Is the host OS using lots of swap? I could imagine something like you're describing if the host OS is thrashing but the guest claims to have free ram.
What are you doing that's using so much network? You may have to figure out a better way to make everyone play nicely. Do you know for a fact that things only go bad when multiple hosts do these big transfers, or is it just a slow creeping death?
Really, as I'm typing this, it smells like you have a memory leak that you either need to plug or restart the responsible process automatically. That should be easy to set up. Do you know what processes are eating the ram? You should find out.0
Categories
- All Categories
- 167 LFX Mentorship
- 219 LFX Mentorship: Linux Kernel
- 795 Linux Foundation IT Professional Programs
- 355 Cloud Engineer IT Professional Program
- 179 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 127 Cloud Native Developer IT Professional Program
- 112 Express Training Courses
- 112 Express Courses - Discussion Forum
- 6.2K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 17 LFC131 Class Forum
- 35 LFD102 Class Forum
- 227 LFD103 Class Forum
- 14 LFD110 Class Forum
- 39 LFD121 Class Forum
- 15 LFD133 Class Forum
- 7 LFD134 Class Forum
- 17 LFD137 Class Forum
- 63 LFD201 Class Forum
- 3 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 697 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 152 LFS101 Class Forum
- 1 LFS111 Class Forum
- 1 LFS112 Class Forum
- 1 LFS116 Class Forum
- 1 LFS118 Class Forum
- LFS120 Class Forum
- 7 LFS142 Class Forum
- 7 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 33 LFS158 Class Forum
- 8 LFS162 Class Forum
- 1 LFS166 Class Forum
- 1 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 1 LFS178 Class Forum
- 1 LFS180 Class Forum
- 1 LFS182 Class Forum
- 1 LFS183 Class Forum
- 29 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 14 LFS203 Class Forum
- 102 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 48 LFS241 Class Forum
- 42 LFS242 Class Forum
- 37 LFS243 Class Forum
- 15 LFS244 Class Forum
- LFS245 Class Forum
- LFS246 Class Forum
- 50 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 154 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 5 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 111 LFS260 Class Forum
- 159 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 20 LFS267 Class Forum
- 24 LFS268 Class Forum
- 29 LFS269 Class Forum
- 1 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 9 LFW111 Class Forum
- 260 LFW211 Class Forum
- 182 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 782 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 743 Linux Distributions
- 80 Debian
- 67 Fedora
- 15 Linux Mint
- 13 Mageia
- 23 openSUSE
- 143 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 348 Ubuntu
- 461 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 90 Linux Security
- 77 Network Management
- 101 System Management
- 46 Web Management
- 64 Mobile Computing
- 17 Android
- 34 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 19 Study Material
- 507 Programming and Development
- 285 Kernel Development
- 204 Software Development
- 1.8K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 309 Installation
- 97 All In Program
- 97 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)