![]() |
Re: How to set swappiness?
Well it's write mixed with reads, which on all sd/mmc/usbflash I've seen translates into a big read/modify/write cycle right after write-read commands come from host..
At one point I plotted all writes done by kswapd, and found that it's indeed mostly sequential until it reaches the end of the swap area, after which it becomes increasingly random.. swapoff/swapon fixes that, and I now have a script that checks iostat for amount of writes and does swapoff/swapon/swapoff via a temporary swapfile when writes exceed swap size.. |
Re: How to set swappiness?
i created a file named swapmop in etc/event.d/
content: Quote:
when doing cat /proc/sys/vm/swappiness, it still sais "100" what am i doing wrong? :O |
Re: How to set swappiness?
Quote:
|
Re: How to set swappiness?
Quote:
Code:
#!/bin/sh also try Code:
chmod a+x /etc/event.d/swapmop |
Re: How to set swappiness?
Quote:
though right now i'm not seeing any differences at all... /edit: ha, there is a difference: my RAM-usage is constantly at around 180 mb. not sure if thats good...?! |
Re: How to set swappiness?
#!/bin/sh should not have difference. But don't forget a space between 30 and >
Actually, it is better to use this script in /etc/event.d/myscript Code:
description "tuning system" Sorry for possible misguide... |
Re: How to set swappiness?
Quote:
High swappiness makes the system swap out (RAM->SWAP) aggressively (idle processes memory blocks are moved to disk). Low swappiness swaps out when memory is running full instead. http://kerneltrap.org/node/3000 Experiment with it and find out what setting fits Your usage pattern... ;) I wouldn't recommend setting the value too low (30 seems fine here so far). |
Re: How to set swappiness?
Quote:
i tried to use your script, but it did not work. i ended up modifying it until i had the first script i used to make it work. i had to remove the following part: Code:
description "tuning system" |
Re: How to set swappiness?
This worked for me (/etc/event.d/tuning):
Code:
description "System Tuning" |
Re: How to set swappiness?
its easier to use vi editor for this, run
sudo gainroot vi /etc/init.d/rcS scroll down to 263/281 press the letter i - don't press enter after it looks like this echo 100 > /proc/sys/vm/swappiness use the arrows to move the cursor and change the value to 30 or whatever you want - keep it above 30 tho then press the onscreen 'esc' button then type this :wq then hit enter |
Re: How to set swappiness?
Quote:
There's a reason for creating a new event.d script though (I also edited rcS at first). |
Re: How to set swappiness?
Quote:
i'm so new to linux that i only found out about vi a few days ago whilst trying to add aliases to root/.profile and i only found out cos i overwrote the damn file and lost the ability to run any apt command or do a reboot learning something new every day tho :D |
Re: How to set swappiness?
Google for Vi Cheat Sheet... ;)
Oh, and have a nice journey... :cool: |
Re: How to set swappiness?
what about that:
HTML Code:
# my rcS.e fix |
Re: How to set swappiness?
Quote:
Code:
description "it is my own N900 tuning" echo "95" > /proc/sys/vm/dirty_ratio It could not expose you to very common bug - the sequence like '95>' without space has a special meaning in shell. Note: I didn't evaluate the effect of that "echo" commands. |
Re: How to set swappiness?
For an explanation of these settings and values see http://www.knownokia.ca/2010/08/n900...-and-more.html
FWIW, I'm gonna try them out next days. |
Re: How to set swappiness?
I have a long time ago made a script that sets swappiness to 100 it is on the garage it is called "seatbelt" install the script will set swappines at startup.
whether this is a good thing to do i do not know. It worked great on the 770 |
Re: How to set swappiness?
To save users the time of searching, It's here ...
Using the seat belts read me file, I'm guessing we have to do this? As root. Copy the script to /etc/init.d Change script mode to executable Create this symbolic link using this command: ln -s /etc/init.d/<Script Name> /etc/rc2.d/S80seatbelt" Reboot And To reverse changes, remove the link and script... So basically all we need to do is create a sym link to a script for it to run on start up? |
Re: How to set swappiness?
Quote:
Quote:
No need for fugly sysvinit junk. On Maemo 5 just put in /etc/event.d/tuning Code:
description "N900 tuning" |
Re: How to set swappiness?
Quote:
|
Re: How to set swappiness?
The tuning lines described by kaze.daniel and allnameswereout seem to work wonders on my n900. Music doesn't stutter at all like when I edited only swappiness and page-cluster. The GUI is superfluid like liquid helium. Life's good :) Thanks guys!
|
Re: How to set swappiness?
Quote:
|
Re: How to set swappiness?
nope, but unfortunately i have had couple of shutdowns. These were done by purpose. So no long uptime (3 days or more) tests.
I have also applied other tweaks (made tuning file to /etc/event.d/ dir) and still no ill side effects. IMO the biggest difference came with just swappiness 30. I should try to make heavy banging with multimedia/browser + sleep + test how it wakes up when call comes. still i would like to get more information about purpose of swapon and swapoff commands. Why, when, how? |
Re: How to set swappiness?
I liked kaze.daniel and allnameswereout's hack so much that made a debian package for everybody to test it without the need for messing with root terminal.
See here. |
Re: How to set swappiness?
Neat but please note nobody has tested any of the settings. Speaking for myself, I am able to experience an improvement (more snappier) with swappiness = 30. The settings have to be carefully tested and benchmarked in order to declare them both usable and safe. One could argue "if it doesn't hurt, it doesn't matter" but I don't recommend to the general public changing too many settings you don't know effect about. That said, if anyone can explain how to benchmark the effects I'd love to share the benchmarks from my machines.
|
Re: How to set swappiness?
I am running swappiness at 30 for about a week. Haven't noticed any improvements neither in speed or battery life. Haven't noticed any deterioration either though.
So the effects can not be felt in everyday use(for my phone and usage pattern). PS. @allnameswereout - I am using stock kernel without any modifications. |
Re: How to set swappiness?
Quote:
|
Re: How to set swappiness?
Here is a compilation of observations made by N900 users shared in this thread when using swappiness = 30.
Battery-life improved & responsiveness improved & no regressions pycage hackfanatic Responsiveness improved slender note: and page-cluster 0 JaseP iareraccoon note: using knownokia.ca's settings compared to merely swapiness = 15 No improvements & no regressions memoryguy zlatko jnack95 Note that nobody has specified which kernel they're using. I'm not sure whether this is relevant. You're encouraged to verify my compilation, improve details on your (future) reports, and use above compilation as basis in next analysis of this tweak whether in this thread or on wiki. |
Re: How to set swappiness?
I found no particular effect from swappiness changing alone, but the complete set of new values you quoted from kaze.daniel worked wonders on my nit. I haven't had a jerkiness in the user interface since I changed them.
|
Re: How to set swappiness?
Quote:
|
Re: How to set swappiness?
Quote:
It's difficult to substantiate with benchmarks but the main effect is on the gui snappiness, swiftness, lack of tearing, in a word fluidity. I didn't imagine that those problems depended on memory allocation in ram vs flash memory. |
Re: How to set swappiness?
Quote:
On my device, this is a *significant* change. I used to get all these hangs and "hello, is anybody home?" and "Hey, I *CLICKED* here already" frustrated interaction with the device. With these changes, they all went away (so far - *knock on wood*). I must say it was an enlightening read about the swap stuff in that linux thread. Clearly, in my opinon, swappiness=100 is *always* utter madness on *any* system. The example mentioned in that thread is when un-tar'ing a multi-megabyte file, the filecache utilizing all "free" space as disk-cache, hence swapping out all apps, hence making the machine dead slow. Well, that's crazy, an un-tar basicaly serially reads/writes ONCE, and needs NO CACHEING AT ALL for efficiency!!! Thank you deepest for the person inventing these settings. For now, I label them golden. The only thing that could un-golden these settings would be crash issues (none so far) or battery drainage (not enough data yet to judge, but it is very unlikely, if anything avoiding swapping should take LESS battery than excessive swapping would!) Again, thanks /Z |
Re: How to set swappiness?
Not to be too dramatic, but if you're not noticing an improvement from swappiness = 30, you might want to audit what you have running and/or installed. With almost 5 days of uptime, and with no other changes to usage patterns, my n900 consistently feels like a different device. And I log many hours a day with it.
Hopefully in the next few weeks I'll try some of the other optimizations, but this one seems like a no-brainer. Also, about 2 months ago I made the following recommended changes in: /home/user/.config/tracker/tracker.cfg Code:
... |
Re: How to set swappiness?
Just warning - N900 has not enough RAM for all applications which it runs, typical sizes are:
gstreamer - 100MB, pulseaudio - 60-70MB modest - 45-80MB browser - 60-120MB or more etc And it also has a slow flash for swap. So, with very non-aggressive swapiness it is easy to hit a situation then you have no free memory and incoming call may wait until kernel swaps out some apps. It may take up to 5-10 secs just to swap out... but kernel may need to swap in/load a phone application... ===> missed call. I believe it is a reason why Nokia set swapiness to 100. |
Re: How to set swappiness?
Well, we're on the bleeding edge here, maybe it's time for a dynamic strategy that involves mlock type mechanisms.
|
Re: How to set swappiness?
I've been running with swappiness set at 30 for about a week now and have noticed a tremendous improvement in speed and battery life. I'm trying now with allnameswereout's further tuning to see how it improves.
egoshin's point makes sense; i hardly ever get calls so haven't noticed any such problem, but would be interested in hearing about others' experience. |
Re: How to set swappiness?
im currently using 30 swappiness and 0 page cluster.
heres an experiment i did: opened about 15 or more odd applications, including the media player, phone, conversations, pictures, microb etc. then i tried calling my phone from a landline a couple of times and it did what it was expected to do. no lags in receiving calls what so ever. there was tearing tho when i was scrolling the screen and i can feel that the system was working really hard.. ill try to observe a few more days if theres anything unusual happening but a couple of days ago when i only tried the 30 swappiness setting, the conversations application became laggy when its coming from sleep. ill check if this will happen again with my page cluster set to 0. |
Re: How to set swappiness?
Quote:
i did the exact same thing!!! lol using the tuning script from knownokias page. it did seem to lag ALOT though wen i updated filebox thru application manager, and it took about 16seconds for the phone to receive the call :S will test again edit: it seems so. apt-worker lags up the phone once i install something. its prob not getting enough swap for setting up the apps, only way is to kill it from xterm |
Re: How to set swappiness?
made the same experience with apt-worker some days ago. swappiness was set to 30 without further modified settings.
|
Re: How to set swappiness?
Shall I remove faster kinetic scrolling - (desktop_kinetic_2.2.138-1+0m5_armel.deb)
before installation of this add-on? Sorry if my question looks noob... Thanks. Regards |
All times are GMT. The time now is 09:58. |
vBulletin® Version 3.8.8