Active Topics

 


Reply
Thread Tools
Posts: 1,258 | Thanked: 672 times | Joined on Mar 2009
#41
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..
 

The Following User Says Thank You to shadowjk For This Useful Post:
msa's Avatar
Posts: 909 | Thanked: 216 times | Joined on Nov 2009 @ Bremen, Germany
#42
i created a file named swapmop in etc/event.d/

content:
# swappiness auf 30

start on started rcS-late

script
echo 30 > /proc/sys/vm/swappiness
end script
then i rebooted.
when doing cat /proc/sys/vm/swappiness, it still sais "100"

what am i doing wrong? :O
 
Posts: 2,829 | Thanked: 1,459 times | Joined on Dec 2009 @ Finland
#43
Originally Posted by shadowjk View Post
...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..
Would it be possible to share that script with us?
 

The Following User Says Thank You to slender For This Useful Post:
Posts: 42 | Thanked: 13 times | Joined on Jun 2010 @ Netherlands
#44
Originally Posted by msa View Post
i created a file named swapmop in etc/event.d/

content:


then i rebooted.
when doing cat /proc/sys/vm/swappiness, it still sais "100"

what am i doing wrong? :O
try to add:
Code:
#!/bin/sh
at the very beginning of your script.
also try
Code:
chmod a+x /etc/event.d/swapmop
as root
 

The Following User Says Thank You to sake For This Useful Post:
msa's Avatar
Posts: 909 | Thanked: 216 times | Joined on Nov 2009 @ Bremen, Germany
#45
Originally Posted by sake View Post
try to add:
Code:
#!/bin/sh
at the very beginning of your script.
also try
Code:
chmod a+x /etc/event.d/swapmop
as root
the #!/bin/sh helped! thanks!
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...?!

Last edited by msa; 2010-09-09 at 21:32.
 
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#46
#!/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"
author My Name

console output

start on started rcS-late

script
        echo "30" > /proc/sys/vm/swappiness
end script

Sorry for possible misguide...
 

The Following User Says Thank You to egoshin For This Useful Post:
Posts: 515 | Thanked: 266 times | Joined on Nov 2009 @ Oelsted, Denmark
#47
Originally Posted by msa View Post
ha, there is a difference: my RAM-usage is constantly at around 180 mb. not sure if thats good...?!
Using the memory available isn't a BAD thing... Running out of memory is though... That's where swap is useful.

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).
__________________
Christian Wilken - tux-POWER.dk!
... May the Source be with You ...

Last edited by DrWilken; 2010-09-10 at 21:05.
 
msa's Avatar
Posts: 909 | Thanked: 216 times | Joined on Nov 2009 @ Bremen, Germany
#48
Originally Posted by egoshin View Post
#!/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

Sorry for possible misguide...
thanks!

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"
author My Name

console output
and still add the #!/bin/sh to make it work. i tried different combinations also, but non worked.
 
Posts: 515 | Thanked: 266 times | Joined on Nov 2009 @ Oelsted, Denmark
#49
This worked for me (/etc/event.d/tuning):
Code:
description "System Tuning"
author "Christian Wilken"

console output

start on started rcS-late

script
        echo "30" > /proc/sys/vm/swappiness
        echo "1" > /proc/sys/vm/oom_kill_allocating_task
end script
No chmod'ing or anything else needed (look at all the other files in /etc/event.d)...
__________________
Christian Wilken - tux-POWER.dk!
... May the Source be with You ...

Last edited by DrWilken; 2010-09-22 at 09:54.
 
Posts: 166 | Thanked: 30 times | Joined on Apr 2010 @ Halifax, UK
#50
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
 
Reply

Tags
battery


 
Forum Jump


All times are GMT. The time now is 21:45.