Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    How to set swappiness?

    Reply
    Page 6 of 9 | Prev |   4     5   6   7     8   | Next | Last
    DrWilken | # 51 | 2010-09-11, 06:38 | Report

    Originally Posted by matthew maude View Post
    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
    Or move the curser till it's over the 1 in 100 and press rw (replace word), enter 30, then esc, and then :wq

    There's a reason for creating a new event.d script though (I also edited rcS at first).

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by DrWilken; 2010-09-22 at 09:49.
    The Following User Says Thank You to DrWilken For This Useful Post:
    matthew maude

     
    matthew maude | # 52 | 2010-09-11, 08:29 | Report

    Originally Posted by DrWilken View Post
    Or move the curser till it's over the 1 in 100 and press r (replace), enter 30, then esc, and then :wq

    There's a reason for creating a new event.d script though (I also edited rcS at first).
    ah, didn't know that
    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to matthew maude For This Useful Post:
    DrWilken

     
    DrWilken | # 53 | 2010-09-11, 08:43 | Report

    Google for Vi Cheat Sheet...

    Oh, and have a nice journey...

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by DrWilken; 2010-09-11 at 08:48.

     
    kaze.daniel | # 54 | 2010-09-13, 23:15 | Report

    what about that:

    HTML Code:
    # my rcS.e fix
    
    start on started rcS-late
    
    script
           echo 30 > /proc/sys/vm/swappiness
           echo 0 > /proc/sys/vm/page-cluster
           echo 1 > /proc/sys/vm/laptop_mode
           echo 1 > /proc/sys/vm/oom_kill_allocating_task
           echo 0 > /proc/sys/vm/dirty_expire_centisecs
           echo 0 > /proc/sys/vm/dirty_writeback_centisecs
           echo 60 > /proc/sys/vm/dirty_background_ratio
           echo 95 > /proc/sys/vm/dirty_ratio
           echo 0 > /proc/sys/net/ipv4/tcp_timestamps
           echo 1 > /proc/sys/net/ipv4/tcp_no_metrics_save
    end script

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 4 Users Say Thank You to kaze.daniel For This Useful Post:
    debernardis, evad, iareraccoon, jurop88

     
    egoshin | # 55 | 2010-09-14, 01:15 | Report

    Originally Posted by kaze.daniel View Post
    what about that:

    HTML Code:
    # my rcS.e fix
    
    start on started rcS-late
    
    script
           echo 30 > /proc/sys/vm/swappiness
           echo 0 > /proc/sys/vm/page-cluster
           echo 1 > /proc/sys/vm/laptop_mode
           echo 1 > /proc/sys/vm/oom_kill_allocating_task
           echo 0 > /proc/sys/vm/dirty_expire_centisecs
           echo 0 > /proc/sys/vm/dirty_writeback_centisecs
           echo 60 > /proc/sys/vm/dirty_background_ratio
           echo 95 > /proc/sys/vm/dirty_ratio
           echo 0 > /proc/sys/net/ipv4/tcp_timestamps
           echo 1 > /proc/sys/net/ipv4/tcp_no_metrics_save
    end script
    Just add first 4 lines to be in sync with coding standards:

    Code:
    description "it is my own N900 tuning"
    author "YourName"
    
    console output
    instead of ugly line started from # (sorry for that). And please - enclose any numeric value before '>' sign into double-quotes like

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to egoshin For This Useful Post:
    evad, MasterZap

     
    allnameswereout | # 56 | 2010-09-14, 01:51 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to allnameswereout For This Useful Post:
    DrWilken, evad

     
    smackpotato | # 57 | 2010-09-14, 01:53 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to smackpotato For This Useful Post:
    SavageD

     
    SavageD | # 58 | 2010-09-14, 02:37 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by SavageD; 2010-09-14 at 02:50.

     
    allnameswereout | # 59 | 2010-09-14, 03:07 | Report

    Originally Posted by SavageD View Post
    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?
    Ehm...

    Originally Posted by
    # swappiness can be set from 1 to 100
    echo 100 > /proc/sys/vm/swappiness
    echo 2 > /proc/sys/vm/overcommit_memory
    echo 40 > /proc/sys/vm/overcommit_ratio


    No need for fugly sysvinit junk.

    On Maemo 5 just put in /etc/event.d/tuning

    Code:
    description "N900 tuning"
    author "VA"
    
    console output
    
    start on started rcS-late
    
    script
           echo "30" > /proc/sys/vm/swappiness
           echo "0" > /proc/sys/vm/page-cluster
           echo "1" > /proc/sys/vm/laptop_mode
           echo "1" > /proc/sys/vm/oom_kill_allocating_task
           echo "0" > /proc/sys/vm/dirty_expire_centisecs
           echo "0" > /proc/sys/vm/dirty_writeback_centisecs
           echo "60" > /proc/sys/vm/dirty_background_ratio
           echo "95" > /proc/sys/vm/dirty_ratio
           echo "0" > /proc/sys/net/ipv4/tcp_timestamps
           echo "1" > /proc/sys/net/ipv4/tcp_no_metrics_save
    end script
    For explanation of each of these settings see URL in my previous post.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to allnameswereout For This Useful Post:
    debernardis, jurop88, SavageD

     
    iareraccoon | # 60 | 2010-09-14, 04:18 | Report

    Originally Posted by kaze.daniel View Post
    what about that:

    HTML Code:
    # my rcS.e fix
    
    start on started rcS-late
    
    script
           echo 30 > /proc/sys/vm/swappiness
           echo 0 > /proc/sys/vm/page-cluster
           echo 1 > /proc/sys/vm/laptop_mode
           echo 1 > /proc/sys/vm/oom_kill_allocating_task
           echo 0 > /proc/sys/vm/dirty_expire_centisecs
           echo 0 > /proc/sys/vm/dirty_writeback_centisecs
           echo 60 > /proc/sys/vm/dirty_background_ratio
           echo 95 > /proc/sys/vm/dirty_ratio
           echo 0 > /proc/sys/net/ipv4/tcp_timestamps
           echo 1 > /proc/sys/net/ipv4/tcp_no_metrics_save
    end script
    I've switched to this script from the 15 swappiness I had previously and I noticed a significant speed boost! Thanks!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 6 of 9 | Prev |   4     5   6   7     8   | Next | Last
vBulletin® Version 3.8.8
Normal Logout