DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: [Tutorial]Sysctl and you, A guide to better preformance and battery life.

  1. Developer
    Jboxen's Avatar
    Member #
    77904
    Join Date
    Jun 2010
    Location
    Rochester, NY
    Posts
    902
    Twitter
    @jakebites
    Phone
    Motorola Droid 2
    DroidForums.net Developer
    Premium Member
    #1

    Smile [Tutorial]Sysctl and you, A guide to better preformance and battery life.

    [UPDATED 2.2]
    First off I would like to say I have gotten all of my information for this mod here: imoseyon I would also like to thank the developer for posting all of his findings and for all of his hard work.

    Enabling Sysctl and changing (most) values via LIberty Settings (Update Liberty Toolbox from the market and it will work.)

    Sysctl Support: Check
    Min Free KBytes: 4096
    Dirty Ratio: 90
    Dirty Background Ratio: 70
    VFS Cache Pressure: 1
    Oom Allocating Task: Check

    Reboot your phone, go to the terminal emulator and type in:

    sysctl -a | grep vm


    Note: This will not give you all of the mods that are available, if you want the remaining mods, continue down to the next methods.

    If your settings have been saved using the App and you don't want the additional mods, then you are all done! Thanks Jrummy! Make sure you scroll down to the bottom of the post and read the IMPORTANT section as it applies to every version of this mod.

    Edit: The NEWEST version of Liberty Toolbox fixes the bugs but if your also running Droid Overclock then read below.



    Enabling Sysctl and changing (most) values via Jrummy's Droid Overclock App
    Note: If you have this and are running Liberty, you will have to change the settings in Droid Overclock too as the Liberty settings will be over-written.

    Jrummy has released an update to Droid Overclock, v.2.0.2. So go to the market and update it if you haven't already. Open up his Droid Overclock app and press Menu>Settings>Advanced Settings. Scroll down until you see Sysctl and do the following.

    Sysctl Support: Check
    Min Free KBytes: 4096
    Dirty Ratio: 90
    Dirty Background Ratio: 70
    VFS Cache Pressure: 1
    Oom Allocating Task: Check

    Reboot your phone, go to the terminal emulator and type in:

    sysctl -a | grep vm

    This version of Jrummy's Sysctl enabler and editor has worked for me so he must have squashed the bugs. Thanks Jrummy!

    Note: This will not give you all of the mods that are available, if you want the remaining mods, continue down to the next methods.



    Enabling Sysctl and changing values via Root Explorer

    So now onto the next step, enabling and changing the values manually. First off we should start by enabling sysctl. This can be done with root explorer...
    Open up root explorer and go to /data/liberty and mount the system RW. Long press on init.d.config and open it in the text editor. Now scroll down until you find SYSCTL and set that from 0 to 1.
    Sysctl is now enabled.

    Note: If for whatever reason you would like to disable this later on just use the backup file it created to do so.

    Now to set the values that Sysctl will be changing, also done with root explorer. This will be done in the /etc folder. Navigate yourself to the /etc folder and see if you already have a sysctl.conf. If not, click the menu softkey and then click more>new file. Name this new file sysctl.conf . Mount the system RW now and open the file in the text editor again. Now type exaclty these lines into the file. (It's ok to delete what's there if anything and replace it with this.)


    vm.swappiness = 0
    vm.min_free_kbytes = 4096
    vm.dirty_ratio = 90
    vm.dirty_background_ratio = 70
    vm.vfs_cache_pressure = 1
    vm.panic_on_oom = 2
    vm.oom_kill_allocating_task = 1
    kernel.panic = 5
    kernel.shmmax = 2268435456
    kernel.shmall = 16777216


    Save it and you can erase the backup that it creates as there is no original file.

    Now reboot your phone and open your terminal up. Type in this command again:

    sysctl -a | grep vm

    You should see your settings have been applied and are working as intended. If you see any errors, go back to the file and make sure you typed everything into sysctl.conf correctly. (There will be 2 permission denied errors at the very bottom when typing in this command but they aren't important.)



    Enabling Sysctl and changing values via VI commands

    After mounting the system RW, going in to terminal emulation, at the prompt:

    vi /data/liberty/init.d.conf

    Now, vi is an old school text editor so you have to maneuver around using the following keys because we have no cursor keys in droid:

    j = move cursor down one line
    k = move cursor up one line
    h = move cursor right one character
    l = mover cursor left one character

    Right now you are in vi's command mode. This allows you to move around and issue commands like save, undo, quit, etc.

    Find the line that says:

    SYSCTL=0

    Move the cursor so it is sitting right on top of 0 and press r which means to replace the character underneath the cursor and type 1.

    Save the file and quit back to the prompt by typing :wq (you will actually see this command typed at the bottom of the editor)

    Once back at the prompt, to edit the other config file:

    vi /etc/sysctl.conf

    If was easier for me to delete all the lines in there and type everything in so typing dd deletes one line at a time.

    Once all the lines are deleted, press i which means start inserting at the cursor. This puts you into edit mode in vi. Type in the following lines as detailed by Jboxen in his post:

    vm.swappiness = 0
    vm.min_free_kbytes = 4096
    vm.dirty_ratio = 90
    vm.dirty_background_ratio = 70
    vm.vfs_cache_pressure = 1
    vm.panic_on_oom = 2
    vm.oom_kill_allocating_task = 1
    kernel.panic = 5
    kernel.shmmax = 2268435456
    kernel.shmall = 16777216

    Once you are done, we need to get back into command mode by press ESC. Since the keyboard doesn't support the ESC key, we need to change a setting in terminal emulation. Hit the menu button | Preferences | Control key. I changed mine to be Vol Down. Pressing Vol Down and then 1, gets me back to command mode. Type in :wq to save and quit.

    After that reboot, go back into terminal emulation, check your work by typing:

    sysctl -a | grep vm

    If you screw up editing your files at any point and want to abandon your changes in vi, press ESC (in my settings it's Vol Down and then "1"), and type in ":q!" (minus quotes obviously)

    Anyways, you can find more info on vi commands here.

    Thank you to freezyfreaky for these instructions.

    IMPORTANT: "after a day or two your device may start getting sluggish because the amount of RAM available to the applications continue to shrink to the point where they are starved for memory."

    There's two solutions to this really, and they are very easy.

    1. Reboot your phone when you wake up and take it off the charger in the morning.(easy)
    2. Run this script in terminal emulator when you wake up in the morning:

    echo 3 > /proc/sys/vm/drop_caches

    "Tells the system to drop all file system caches"



    Now if you want to know why this works and what it does I would suggest following the link at the top of the page because he can explain it much better than I can. He also has so many more cool things that he has experimented with. I recomend reading it all.

    Well, there you go! Enjoy guys this is a great mod and should make the Communitty very happy!

    Disclaimer: I am not responisble for anything that happens to your phone as a result of this mod, anything you do to your device is your responsibility.
    Last edited by Jboxen; 02-08-2011 at 06:07 PM.
    Twitter: @jakebites

    If you like my work please consider donating!

  2.  
     
     
     
  3. Droid
    EagleStrike's Avatar
    Member #
    43298
    Join Date
    Mar 2010
    Posts
    98
    Liked
    1 times
    Phone
    Galaxy Nexus CM10
    #2
    It would be really nice to divide it up into sections. A giant wall of text is very intimidating and can be very hard to read.
  4. Junior Droid
    markhamr's Avatar
    Member #
    134226
    Join Date
    Nov 2010
    Posts
    19
    Phone
    Enter Current Phone Model Here
    #3
    This would be a lot more useful if it were organized and not a wall of text
  5. Master Droid
    teh_g's Avatar
    Member #
    126800
    Join Date
    Oct 2010
    Posts
    384
    Liked
    1 times
    Phone
    Verizon Droid X w/ rubiX
    #4
    I don't think that clearing the cache on every boot will lead to better performance or battery life, especially since you are recommending rebooting every day or two to clear up the memory for applications. The cache will have to be rebuilt on reboot, increasing the boot time, and increasing the amount of CPU cycles being used for cache writing. The Android system, is fairly intelligent about how it handles cache.
  6. Developer
    Jboxen's Avatar
    Member #
    77904
    Join Date
    Jun 2010
    Location
    Rochester, NY
    Posts
    902
    Twitter
    @jakebites
    Phone
    Motorola Droid 2
    DroidForums.net Developer
    Premium Member
    #5
    Sorry, It copied weird I'm fixing it now.
    Twitter: @jakebites

    If you like my work please consider donating!

  7. Droid
    EXQEX9's Avatar
    Member #
    94392
    Join Date
    Jul 2010
    Location
    California
    Posts
    32
    Phone
    Droid X
    #6
    <--- Anxiously waiting for OP to fix the OP so I can...read it.
  8. Droid Ninja
    want a droid's Avatar
    Member #
    84798
    Join Date
    Jul 2010
    Location
    Maryland
    Posts
    1,094
    Phone
    HTC ThunderBolt
    #7
    Quote Originally Posted by EXQEX9 View Post
    <--- Anxiously waiting for OP to fix the OP so I can...read it.
    Same post is in the Liberty D2 Rom section.

    [Tutorial]Sysctl and you, A guide to better preformance and battery life.

    Unless he posts different values for the two devices (which would be weird).
    Common Misconception:
    Leaving your GPS on drains battery.
    Truth is: GPS is only used when you open an application that requires it. You can leave GPS toggled on at all times.
  9. Droid
    EXQEX9's Avatar
    Member #
    94392
    Join Date
    Jul 2010
    Location
    California
    Posts
    32
    Phone
    Droid X
    #8
    Quote Originally Posted by want a droid View Post
    Quote Originally Posted by EXQEX9 View Post
    <--- Anxiously waiting for OP to fix the OP so I can...read it.
    Same post is in the Liberty D2 Rom section.

    [Tutorial]Sysctl and you, A guide to better preformance and battery life.

    Unless he posts different values for the two devices (which would be weird).
    Thank you kind sir!

    <---"Reading face"
  10. Developer
    Jboxen's Avatar
    Member #
    77904
    Join Date
    Jun 2010
    Location
    Rochester, NY
    Posts
    902
    Twitter
    @jakebites
    Phone
    Motorola Droid 2
    DroidForums.net Developer
    Premium Member
    #9
    Fixed!!!!
    Last edited by Jboxen; 02-05-2011 at 01:18 PM.
    Twitter: @jakebites

    If you like my work please consider donating!

  11. Droid
    gobbles23's Avatar
    Member #
    162629
    Join Date
    Jan 2011
    Posts
    75
    Phone
    Droid X
    #10
    Quick question. How can I know that the sysctl settings are active if liberty has a bug?

    Sent from my DROIDX using DroidForums App
Page 1 of 2 12 LastLast

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. SetCPU Guide/Tutorial
    By UltraLinx in forum Android Applications
    Replies: 1
    Last Post: 03-21-2012, 07:24 PM
  2. Replies: 387
    Last Post: 07-20-2011, 12:42 AM
  3. [Tutorial/Guide] Fix - Lag on 2.2 Google OS
    By myskyfalls in forum Android Tech Support
    Replies: 0
    Last Post: 01-28-2011, 05:37 PM
  4. help with D1 root using Droid-life guide
    By droidoesall in forum Droid Rooted Help
    Replies: 4
    Last Post: 10-23-2010, 07:45 AM
  5. Complete Guide to Maximizing Your Android Phone’s Battery Life
    By quaffapint in forum Android General Discussions
    Replies: 0
    Last Post: 08-11-2010, 08:07 AM

Search tags for this page

android sysctl

,
android sysctl.conf
,
edit sysctl.conf android
,

min free kbytes

,
min free kbytes android
,
minfree kbytes
,

sysctl android

,

sysctl.conf android

,
sysctl.conf permissions
,
vfs cache pressure android
Click on a term to search our site for related topics.
Find us on Google+