Swappiness

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Swappiness

Postby Zeeman » May 1st, '20, 04:45

With which command line can I check the swappiness and how should I change the swappiness to 10?
Zeeman
 
Posts: 10
Joined: Jun 1st, '19, 00:50

Re: Swappiness

Postby doktor5000 » May 1st, '20, 11:02

Do you want to change it permanently or only temporarily?
You can check the current setting as root with
Code: Select all
sysctl vm.swappiness

and you can change it during runtime with
Code: Select all
sysctl -w vm.swappiness=10


If you want to change it permanently, you should put vm.swappiness=10 into a file below /etc/sysctl.d/ which is read during boot.

Although it would probably be a good idea if you add some context information on WHY you want to change it, also how much RAM and swap you currently have ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Swappiness

Postby Zeeman » May 1st, '20, 18:24

Hello doktor5000, thanks for the quick response. I have 4GB-RAM (3.9GB) and at the moment is the swappiness 60.
I want change the swappiness permanently but I'm a computer dummy so I don't understand what you mean with vm.swappiness=10 into a file below /etc/sysctl.d/ which is read during boot. I have used before a couple of years Linux mint and it looks a lot easy-er there. but I think it's only that I used it for a few years.
Last edited by Zeeman on May 1st, '20, 18:38, edited 1 time in total.
Zeeman
 
Posts: 10
Joined: Jun 1st, '19, 00:50

Re: Swappiness

Postby doktor5000 » May 1st, '20, 18:37

OK, but WHY do you want to change swappiness in particular?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Swappiness

Postby Zeeman » May 1st, '20, 18:48

on all debian and ubuntu they recommend it because linux is used a lot of swappiness.
Decrease the swappiness (important)
1.5. With normal computer use (when you don't have a server), you definitely want to decrease Mint's swappiness . That can make a huge difference to the speed of your system.

You will notice this especially with little RAM (2 GB or less). At 8 GB of RAM or more, you probably won't notice a difference when swapping down.
https://rudd-o.com/linux-and-free-softw ... o-fix-that
https://easylinuxtipsproject.blogspot.c ... iness.html
Zeeman
 
Posts: 10
Joined: Jun 1st, '19, 00:50

Re: Swappiness

Postby laidlaws » Nov 16th, '20, 17:43

I have just come across this thread. My computer is suddenly locking up for a few minutes at a time. I hafe 8 Gb RAMand 4 Gb swap. htop shows that only avout 700 MiB of ordinary RAMis in use, but over 3 Gib of swap. I read the same Ubuntu threads as the OP, but decided to check the Mageia forum first. I have no other reason to fiddle with the swappiness. Am I barking up the wrong tree completely?
laidlaws
 
Posts: 233
Joined: May 24th, '11, 04:58

Re: Swappiness

Postby doktor5000 » Nov 17th, '20, 02:57

You should create a separate thread for that, and add some actual details like output of free -ltm and vmstat and htop or similar, along with some more context information and also some journalctl excerpts.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Swappiness

Postby laidlaws » Nov 17th, '20, 10:31

Thanks, Doktor. I will do that when I have collected more info.
laidlaws
 
Posts: 233
Joined: May 24th, '11, 04:58

[SOLVED] Re: Swappiness

Postby laidlaws » Nov 17th, '20, 11:38

I just wiggled both my onboard RAM sticks, and everything seems back to normal. No swap is being used. Dust is a real problem here. Here's hoping.
laidlaws
 
Posts: 233
Joined: May 24th, '11, 04:58

Re: Swappiness

Postby JoesCat » Nov 19th, '20, 06:24

@Zeeman - if you do not have that much RAM, you may want to consider loading Mageia Classic install which uses 32bit code.
32bit code is a bit more compact than 64bit, therefore using less code for executable programs and more space for data. Many users won't see a difference or impact between 32bit or 64bit code, so this may be to your benefit.

@laidman, if you are wiggling the onboard RAM, you may as well remove them, and rub a pencil eraser across the contact fingers to clean-off grit, dirt, greases. Some people put their fingers on the contacts, which is bad in adding whatever is on your hands to the contacts (making them dirty or oxidized). Some people also have their towers sit on the floor, and it can be expected you have a load of dust inside the case (this happens in work environments, and homes too when people kick-up dirt from the floor and it gets sucked in through the vents.
If this is the case (dust, dirt), you can unplug the PC, open the case, grab the bare metal with one hand (to ground yourself from creating static), and with the other hand, run a vacuum around to suck-out, or blow-out dust and dirt inside the computer. When I say grab bare metal, I mean the same PC you are cleaning, so you are like a bird on a wire, at the same voltage potential as the PC itself - I've seen people grab other metal, and that is wrong - saying this one more time - make sure the PC is unplugged.
If it is an old PC, you may be dealing with "cold solder joints", this happens with hot/cold/hot/cold/hot/cold as you turn on and turn-off a PC over the years....it is metal fatigue due to expansion and contraction - you might have discovered a location when you wiggled the RAM....but then again, it could have been a dirty connection.
The what-ifs increase with time, and older equipment.
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron