maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   How to set swappiness? (https://talk.maemo.org/showthread.php?t=48966)

TheSacredSoul 2010-04-01 17:26

Re: How to set swappiness?
 
Quote:

Originally Posted by @SR (Post 591565)
On n900 default value for swappiness is set by /etc/init.d/rcS script somewhere in the last lines.
echo value > /proc/sys/vm/swappiness works until the next reboot. So if you want to change the value permanently you should edit it in rcS script.

How can we get hold of this script from the n900, edit it and push it back?:o

@SR 2010-04-01 18:10

Re: How to set swappiness?
 
Quote:

Originally Posted by TheSacredSoul (Post 591640)
How can we get hold of this script from the n900, edit it and push it back?:o

I think the easiest way would be to edit the file on n900 itself (you only need to change one number in this file). I recommend editing it using nano editor in terminal (nano /etc/init.d/rcS). vi editor may be a little hard to use for someone who haven't used it before. it is available in repository (apt-get install nano). You will also need root rights to do anything with that file (modify it on devise or replace it with the one you edited on computer) so you will need rootsh.
If you chose to edit it on computer then you should first copy it for example in MyDocs using terminal:
cp /etc/init.d/rcS /home/user/MyDocs/
Edit it and then copy it back:
cp /home/user/MyDocs/rcS /etc/init.d/rcS

Be careful not to edit something else in this script as it may result in unbootable device and you would have to reflash firmware to restore it.

Venemo 2010-04-01 20:33

Re: How to set swappiness?
 
Quote:

Originally Posted by TheSacredSoul (Post 591640)
How can we get hold of this script from the n900, edit it and push it back?:o

Perhaps you can use Midnight Commander on the N900, or WinSCP over SSH to edit and save it.

dhcmega 2010-04-01 23:58

Re: How to set swappiness?
 
Quote:

Originally Posted by @SR (Post 591695)
I think the easiest way would be to edit the file on n900 itself (you only need to change one number in this file). I recommend editing it using nano editor in terminal (nano /etc/init.d/rcS). vi editor may be a little hard to use for someone who haven't used it before. it is available in repository (apt-get install nano). You will also need root rights to do anything with that file (modify it on devise or replace it with the one you edited on computer) so you will need rootsh.
If you chose to edit it on computer then you should first copy it for example in MyDocs using terminal:
cp /etc/init.d/rcS /home/user/MyDocs/
Edit it and then copy it back:
cp /home/user/MyDocs/rcS /etc/init.d/rcS

Be careful not to edit something else in this script as it may result in unbootable device and you would have to reflash firmware to restore it.

hi
if you move rcS around, make sure it end up with exec permitions.

ls -al /etc/init.d/rcS
will show rwxr-xr-x
(look at the 3 x)

will it not work inside MyDocs, but if it loses that permitions, you can set it back with: chmod +x /etc/init.d/rcS

you can check it with: ls -al /etc/init.d/rcS

TheSacredSoul 2010-04-02 00:17

Re: How to set swappiness?
 
Hmm. I decided to use midnight commander. easier then expected. I browsed to the folder, tapped edit, searched for "swappiness", changed the 100 to 30, saved it, and rebooted.

cat /proc/sys/vm/swappiness shows 30.

Lets see how much of an improvement there is.

noipv4 2010-06-05 07:16

Re: How to set swappiness?
 
I tried this
echo 0 > /proc/sys/vm/page-cluster

in vim /etc/init.d/rcS line 264.

guided by this blog http://www.sabi.co.uk/blog/anno05-3rd.html#050923

Seemed to reduce the pressure on VM usage.

hackfanatic 2010-07-09 18:51

Re: How to set swappiness?
 
Hey guys i thought ill bring this thread back to life.. i have been using swappiness to 30 past few days..

I dont see any ill effects at all.. and performance seems to have improved a lot .. and battery life by a bit if im not imagining things

am running 750 mhz clocked kernel..

slender 2010-08-30 21:37

Re: How to set swappiness?
 
I have also tested swappiness 30 and page-cluster 0. I'm pretty sure that responsivness has been better. I would be highly interested on possible side-effects on these changes.

btw.
is it possible to unload preloaded modest and browserd?

.edit
I have also seen some nice value tweaks. Have you tried them and what were the results?

j.s 2010-08-30 21:48

Re: How to set swappiness?
 
Quote:

Originally Posted by pycage (Post 591545)
I have been running my N900 with swappiness 30 for some weeks without any ill side-effect. But it seems that battery-life and device responsiveness have both noticably improved.

BTW, on Diablo OS, the default swappiness value was 1. I'm almost certain that a default value of 100 on the N900 is not the optimal setting for this device at all.

In March, you said that you were using 1.
http://talk.maemo.org/showthread.php?t=47173&page=2

Did you decide 30 is better?

JaseP 2010-09-02 17:56

Re: How to set swappiness?
 
I just switched swappiness to 30,... much faster in starting and stopping applications,... just more responsive overall.

To give a comparison, Ubuntu defaults to a swapiness value of 60. On some server systems, where a large program is going to remain in memory while other tasks are being performed, a swappiness value of 100 can be advisable, but 60 is the sweet spot for desktop/server hybrid use (which is why they use that). For most desktop use, with a decent amount of RAM, you want to have a swappiness setting of 10 on Ubuntu systems...

The trade off is having enough virtual memory for keeping application that are idle running and happy, versus having too much being pushed to virtual memory. With flash memory, it has limited read-write cycles, even with modern level wearing stuff going on, so lower swappiness will help the system's flash memory lifespan.

For the N900, because it has flash storage, a setting of 60 is probably too much. And since flash memory's faster than disk, a 30 is proabably about right for the N900.

Setting it too low (like a 0 or a 1) might possibly effect some daemons (Like phone related stuff) running in the background that we might not be aware of. But overall, I agree that a 100 is way out of line. Running at 30 makes it seem like a whole new device.


All times are GMT. The time now is 06:32.

vBulletin® Version 3.8.8