Swap usage full?


#1

Swap usage is full, although I have a ton of free memory is that a issue?

Image


#2

this is because you used less than 1gb swap. id try making swap between 5-15GB


#3

How do you change it?


#4

one way that i know of is reinstall os when partitioning set more swap.


#5

Would really rather not reinstall if I don’t have to :confused :confused:


#6

yeah i dont blame you. how large is the storage on it?


#7

Disk space? 6tb


#8

Using 1 right now


#9

well i have plenty of space if you would like to backup to my server, being your a donor i would not mind so that you could reinstall.

but i am looking up a way to add more swap without reinstall,

looks like you could add a swap file to your / mount
this should work if you follow it and make ajustments where needed


easier to follow.


#10

I guess the question is, do I need to increase the swap?

From my quick search its mainly used when you run out of memory right, so since i have 26 gigs free I should be good for now?


#11

depends how many torrents you plan to run?


#12

Torrents wouldn’t just load in normal ram?


#13

i guess best way to figure it out would be try it. if it stops working then i’d work on adding more swap :wink: till then i would not worry too much.


#14

On a system with 32gb, where it has 20.3 Gb free. I personally would disable swap. Its obviously badly written (the OS) if its swapping ultra fast memory to slow hard disk with such a huge amount of free memory remaining.

I actually have done the same with my Windows.

My Quickbox is doing something similar (but with only 1 Gb of ram), and I cant help but wonder if its put the deluge cache to swapfile which of course defeats the whole point of a cache. Sadly I cant turn mine off to test as its OpenVZ.

Edit:

I did a bit of thinking and Googling after posting this, and I found a command that shows which programs are actually using the swap file and how much they are using.

for file in /proc/*/status ; do awk ‘/VmSwap|Name/{printf $2 " " $3}END{ print “”}’ $file; done

This proves my theory, in that on my box Deluge is using 317252 Kb of swap, which is 309 Mb!! So my deluge memory cache is pointless. Will be looking into this in more detail and see what I can do to force deluge to use actual memory.

Edit2: I have found setting called swappie which is used to control how likely the system is to swap physical memory to swap file.

I am trying a setting of 0 on my vps, by using this command

echo -e “vm.swappiness=0” | sudo tee -a /etc/sysctl.conf

I had to reboot to make this change effective, so will monitor to see if its made any difference to performance.


#15

Additional to what @Jason has said (which is very good info) you may additionally turn swap off by typing swapoff -a. As stated above, more than likely what is happening is you are running Deluge and it is caching to your swap partition directly in order to find additional speed boost. In some cases this can be ok, however, it will additionally contribute to circumstances such as that encountered.

My biggest advice (and I do this on my own systems) is to simply turn swap off.

####But you want swap on and just want to clear it somehow?

Simple, swapoff -a and follow it up with swapon -a this will turn off the swap, flush and reactivate on the given partition that is located with your /etc/fstab.