[Tutorial] ROMs & Sysctl.conf & other tweaks!

This is a discussion on [Tutorial] ROMs & Sysctl.conf & other tweaks! within the Droid X Hacks forums, part of the Droid X Development category; There are a few reports out there saying that this will work on the new Gingerbread including version 4.5.588 (newest leak) Read, make a backup, ...


+ Reply to Thread
Page 1 of 60 1 2 3 11 51 ... LastLast
Results 1 to 10 of 597
Like Tree42Likes

Thread: [Tutorial] ROMs & Sysctl.conf & other tweaks!

  1. #1
    *Rescue Squad*
    Supporting Member
    Points: 49,198, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 3.0%
    Achievements:
    500 Experience Points250 Experience Points7 days registered100 Experience PointsTagger Second Class
    Awards:
    Posting Award
    macpro88's Avatar
    Member #
    20491
    Join Date
    Dec 2010
    Posts
    6,938
    Liked
    320 times

    Lightbulb ROM's & sysctl.conf tweaks & other tweaks!

    There are a few reports out there saying that this will work on the new Gingerbread including version 4.5.588 (newest leak) Read, make a backup, and enjoy


    Listen up everyone! Since the release of Liberty 1.0, JRummy16 also released a new app in the market called Sysctl Config, which gave users an interface to manually edit and tweak the sysctl.conf file. Alongside this, Liberty made it easier to configure the sysctl.conf file using the integrated menu option under Liberty Settings without the use of the app.
    So what we are going to do, is explore what sysctl is how we can benefit from tweaking these settings.

    Please take special note! That any ROM can utilize these sysctl.conf tweaks, not just Liberty, and rooted stock as well.

    (You must be rooted and have busybox installed for this to work on stock)

    So what is the purpose of this thread? And what is Sysctl.conf all about?



    First of all, we are going to explore what sysctl.conf is.

    Second of all, we are going to explore what sysctl.conf does, and what it can do for your phone.

    Lastly, we are going to explore how sysctl.conf works and what kind of benefit is has on the Android OS.

    Now, before we get started, we need to clear something up! The tweaks and modifications we will discuss in this thread, WILL NOT IN ANYWAY INFLUENCE BENCHMARK SCORES SUCH AS QUADRANT! Benchmark apps are meant to measure hardware performance only and are in no way affected by these tweaks and modifications, but make no mistake! You will notice at least a slight increase in Android's performance and a possible increase in battery life as well.

    Another thing that everyone needs to know is that the Android OS is a Linux based operating system, so there will be a lot of references to Linux, just so you are not confused.

    So lets get started shall we?!?!

    Ok, so first of all, letís explore what sysctl.conf is.

    The sysctl.conf is a configuration file for "sysctl" which is an interface for dynamically changing kernel parameters in the Linux OS. The configuration file contains the following elements, vm.min_free_kbytes, vm.dirty_ratio, vm.dirty_backgroud_ratio, vm.vfs_cache_pressure, vm.oom_kill_allocating_task. There are many other elements within the file, but we will be primarily focusing on these specifically (the vm prefix stands for virtual memory). The sysctl.conf file should be located in /etc (/system/etc) by default. To enable it you need your ROM to execute "sysctl -p" somewhere during the boot process (or shortly afterward). We will also be discussing how to enable it if it is not already done so. You can also run sysctl -p manually to enable it any time after the OS is started.

    Now, letís get down to what sysctl.conf does and how it works.

    Min Free KBytes (vm.min_free_kbytes) -
    This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.

    Dirty Ratio (vm.dirty_ratio)
    and Dirty Background Ratio (vm.dirty_background_ratio) control how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.

    VFS Cache Pressure (vm.vfs_cache_pressure) -
    Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.

    Oom Allocating Task
    (vm.oom_kill_allocating_task) (enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.) -This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.

    This information has been pulled from the following sites:
    http://www.imoseyon.com/2011/05/dxd2-tweaks-new-version-man-its-been.html (newest)
    imoseyon: Sysctl tweaking for faster, longer lasting Android (deprecated)
    imoseyon: sysctl (and minfree) tweaks revisited (deprecated)
    /proc/sys/vm | LinuxInsight (deprecated)

    How to edit the values manually, follow these steps (in Liberty ROM and others set up in a similar manner):

    1) First enable sysctl from Liberty settings, if you are on Liberty
    2) Run Root Explorer
    3) Modify /data/liberty/init.d.conf to make sure that sysctl is enabled ("sysctl = 1")
    4) Go to /system/etc/, and mount it r/w
    5) Modify sysctl.conf by long pressing the sysctl.conf file and selecting "Open in Text Editor." When finished, save the file and exit
    6) Run Terminal Emulator
    7) Type "sysctl -p" (output should confirm whether you've done step 4&5 correctly)

    (Soon to come, how to enable if your ROM does not support sysctl, which will require much more tweaking.)

    If you want to check to see if your changes take hold after reboots, run this in Terminal Emulator:

    sysctl -a| grep vm

    This command will give you all the sysctl values, scroll down to find the ones you edited and verify that they are the same values you changed them to.

    Now, if you are not on Liberty, to check to see if your ROM supports sysctl, use Root Explorer (app found in the Market) to navigate to the following directory:

    /etc/


    In this directory should be a file named "sysctl.conf." If it is not there, use the search function to search for "sysctl."

    To edit this file, make sure system is r/w, then long press on the file and choose "Open in Text Editor." Now you can edit these values to your liking to see what works best and what doesn't. Root Explorer will back up the file each time you make changes, but only backs up the most current changed file, so always make sure you know what your default values where to begin with.

    After you had made your changes, reboot your phone, then open up terminal emulator and type in "sysctl -a| grep vm" to see if your changes too hold.


    ************************************************** ***********************************************



    Now, if you want the easy way out, our good friend Marius (imoseyon) has been great, and created a flash-able .zip that does all of the work for you!

    The .zip can be found here, at Marius' blog titled "imoseyon."

    When you flash the .zip file, in Bootstrap Recovery, the following will take effect, and please note, any settings you may have altered, will be overwritten!

    Now, this mod is pretty universal, but as always, make a backup. Some ROM's such as "rubiX" do not really benefit from this mod, I have tested this, and the way "rubiX" is codded, the stock "rubiX" ROM is fast enough on its own, so rubiX users, give it a try if you must, but make a back up and keep an eye on your phone on how it performs. Here is what drod2169 had to say, with much respect to Marius:
    Quote Originally Posted by drod2169 View Post
    Ok.. this is where I feel the need to step in.

    Marius is a great guy. He puts some good work into his tweak zip set.

    His zip set should be used on ANY ROM other than rubiX.
    I will not, nor can I support anything another person has made, that has been installed over my rom.

    His sysctl sets vfs_cache_pressure to 1. rubiX has it at 50. Basically, in real simple terms, it lags down the phone after a while of the cache building. The lower the value, the quicker you'll have to reboot. It handles responsiveness much smoother at a lower value, but it comes at a price. 50 gives it 2-3 days (in theory, and others results) without needing a reboot, 1 gives it a few hours.

    I have many other tweaks in rubiX that Marius doesn't include. You'd be much better just running rubiX as is. After all, these tweaks are what I've devoted my time to since September

    Applying the .zip will do the following:

    1.
    Install BusyBox 1.18.0 (in an alternate location)
    2. Enables cron, which is a Linux time-base job scheduler
    3. Tweaks certain kernel elements (vm, minfree, etc.)
    4. Tweaks build.prop (on some ROMs)
    5. Flushes system caches once a day (1AM PT)
    6. Enables new governor

    So Marius had a chance to create one zip to rule them all. No more maintaining four different versions. The new zip contains a script that runs when you flash it the first time to determine what needs to be enabled and makes the necessary changes regardless of which ROM you're on.

    Here is the change log for the universal .zip:

    What to expect - hopefully faster, more stable, and longer lasting TB/DX/D2.
    How to check if the mods are in effect: 1) Launch Terminal Emulator, 2) Type "bash /data/imoseyon/checkimosey.sh", without the quotes and hit enter.
    How to remove my mods: remove /etc/init.d/99imoseyon and reboot.

    (Keep in mind that this is a work in progress and your mileage WILL vary.)

    More details

    DownloadsChange Logs
    • v6.2.1 - fixed a bug in check script.
    • v6.2 - added swap support (if your kernel supports swap, ie thunderbolt). Run "sh /data/imoseyon/swap.sh create" to enable.Blog post on this.
    • v6.1.4 - made enable script more robust for more ROMs. No need to flash if yours is already working.
    • v6.1.3 - fixed more enable bugs for some roms. It's not easy making a zip for all ROMs for 3 devices folks!
    • v6.1 - added /tmp tmpfs support for thunderbolt
    • v6.0.5 - fixed more minor bugs, and tweaked cache_pressure slightly in an attempt to reduce/eliminate occasional sluggishness.
    • v6.0.4 - fixed a bug for stock ROMs without busybox, created /tmp if it doesn't exist.
    • v6.0.3 - fixed an unsilly bug for DX/DX
    • v6.0.2 - fixed another silly bug which prevented crond from starting up on some ROMs.
    • v6.0.1 - fixed a silly bug which prevented my mods from being enabled on ROMs that don't have init.d enabled.
    • v6.0
      • Tweaked scripts to work on thunderbolt.
      • Tweaked minfree some more (note this is still a work in progress).
      • Separated sysctl settings to a separate file (/data/imoseyon/sysctl.conf) so they are easily customizable.
      • Abandoned interactive mode - it didn't really provide much value for me. So I'm doing ondemand only for now. May look at conservative next.
    A small side note - I have a slightly crippled version for D1 users. Currently it works only on D1 ROMs that support init.d. thanks for testing, Jason! Download

    Version 7.1 is available:

    v7.1 (download)

    To verify that all the tweaks are in place:
    1. Open Terminal Emulator
    2. su
    3. checktweak.sh
    CHANGELOGS
    v7.1
    1. Latest busybox compiled by yours truly.
    2. Modified enable scripts to work on GB ROMs.
    3. Easier to run check script (see above).
    4. SD card speed boost.
    NOTE: the latest version has been tested on Gingerbread only. Should work fine on Froyo but hasn't been tested. Also, if you're running ZombieStomped there's no need to flash.
    Quote Originally Posted by macpro88 View Post
    Also guys, you need to remember, and I should add this to the OP, but different ROM's are built with different bases. Most of the DX ROM's share the same base because of the limitations of the locked bootloader.

    With this is mind, as some ROM's do have slightly different bases (the way its codded with Android), the same sysctl settings may not be appropriate for another ROM. This is why Marius had different .zips for different ROM's to begin with.

    Then a light bulb turned on and Marius magically created the universal .zip that although works on all ROM's, although each ROM will react to it differently and will have slightly different millage.

    This is why everything is explained in the OP as much as possible, so even though you flashed the magical zip, experiment with manually editing some settings and see what works best for you. This isn't really a flash and forget kinda thing.



    Please make sure you create a backup before flashing anything!

    After you flash the .zip, you can run the following command in Terminal to make sure it was applied successfully:
    pgrep -f crond

    If you get a value on the following line, the .zip has been applied successfully, don't worry about what number you, everyone may end up with a different number.

    If you are really feeling adventurous and are down for a good read, and really want to get to know the Android OS even better, please follow Marius' blog, as it is a great read!

    ************************************************** ***********************************************

    Disclaimer: I and neither are droidxforums.com or any of the other members posting in the thread are responsible for any harm YOU may cause to your device. Enjoy

    ************************************************** ***********************************************

    Last edited by macpro88; 07-16-2011 at 05:22 PM. Reason: Updates

    DroidXForums Guidelines of Conduct
    Show Your Support and Become a Supporting Member Today!


    And always remember to read, read, read, and read some more!


  2. Droid X Forums
    Ads


  3. #2
    X Lurker
    Points: 1,048, Level: 17
    Level completed: 48%, Points required for next Level: 52
    Overall activity: 0%
    Achievements:
    500 Experience Points250 Experience Points100 Experience Points31 days registered7 days registered
    SanJuan's Avatar
    Member #
    21946
    Join Date
    Dec 2010
    Posts
    4
    Liked
    0 times
    I would also like to know more about this, and the best settings.

  4. #3
    *Rescue Squad*
    Supporting Member
    Points: 49,198, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 3.0%
    Achievements:
    500 Experience Points250 Experience Points7 days registered100 Experience PointsTagger Second Class
    Awards:
    Posting Award
    macpro88's Avatar
    Member #
    20491
    Join Date
    Dec 2010
    Posts
    6,938
    Liked
    320 times
    Boy, after doing a TON of searching, I am not finding a lot on this on Android with out forums dating back since 2.0 in '09. A majority of the finding is about linux. I know that Android is a linux build, but kernals are different right? So the settings would be different? The only thing I can get out of this all is that is helps the OS manage system resources more effective and efficiently. But what values do we use and what do they represent and do? Better yet, if someone can post what values work the best without explanation, will make me happy lol.

    DroidXForums Guidelines of Conduct
    Show Your Support and Become a Supporting Member Today!


    And always remember to read, read, read, and read some more!


  5. #4
    Agent X
    Points: 9,494, Level: 65
    Level completed: 48%, Points required for next Level: 156
    Overall activity: 0%
    Achievements:
    250 Experience PointsTagger Second Class100 Experience Points31 days registered7 days registered
    skennelly's Avatar
    Member #
    17443
    Join Date
    Oct 2010
    Location
    Illinois
    Posts
    1,319
    Liked
    44 times
    +1

    Sent from my DROIDX using Droid X Forum App

  6. #5
    X Informant Achievements:
    250 Experience Points3 months registered100 Experience Points31 days registered7 days registered
    Marciz34's Avatar
    Member #
    87
    Join Date
    Jul 2010
    Location
    Newark, DE
    Posts
    43
    Liked
    2 times
    i did a fresh reboot and ran quadrant....got a 2381 then i enabled the sysctl did another reboot and ran quadrant again.....2379.....so just enabling it did not give me any difference there. i have not noticed anything else "feeling faster" either
    Droid X
    Rom: Liberty 1.0
    Theme: Gingerbread
    CPU OC: ULV 1.3ghz

  7. #6
    *Rescue Squad*
    Supporting Member
    Points: 49,198, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 3.0%
    Achievements:
    500 Experience Points250 Experience Points7 days registered100 Experience PointsTagger Second Class
    Awards:
    Posting Award
    macpro88's Avatar
    Member #
    20491
    Join Date
    Dec 2010
    Posts
    6,938
    Liked
    320 times
    Quote Originally Posted by Marciz34 View Post
    i did a fresh reboot and ran quadrant....got a 2381 then i enabled the sysctl did another reboot and ran quadrant again.....2379.....so just enabling it did not give me any difference there. i have not noticed anything else "feeling faster" either
    I don't really think it would boost your benchmark scores, as the benchmarks only test the hardware configurations, changing the sysctl.cong file affects the software configurations and how the OS handles the resources.

    Than again, I am not really too sure, this is just my thinking.

    DroidXForums Guidelines of Conduct
    Show Your Support and Become a Supporting Member Today!


    And always remember to read, read, read, and read some more!


  8. #7
    X Informant
    Points: 1,277, Level: 19
    Level completed: 77%, Points required for next Level: 23
    Overall activity: 0.3%
    Achievements:
    3 months registered250 Experience Points100 Experience Points31 days registered7 days registered
    theoilman's Avatar
    Member #
    20183
    Join Date
    Nov 2010
    Posts
    86
    Liked
    2 times
    no one seems to have an answer, sounds like we need jrummy to write a guide

  9. #8
    *Rescue Squad*
    Supporting Member
    Points: 49,198, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 3.0%
    Achievements:
    500 Experience Points250 Experience Points7 days registered100 Experience PointsTagger Second Class
    Awards:
    Posting Award
    macpro88's Avatar
    Member #
    20491
    Join Date
    Dec 2010
    Posts
    6,938
    Liked
    320 times
    Yes. That would be amazing. I am raking my brain over this! I have done more research on this than any other Android element and I still can't come up with a solid answer. I am taking a Linux class next semester, but that's too far away!

    Sent from my DROIDX using Droid X Forum App

    DroidXForums Guidelines of Conduct
    Show Your Support and Become a Supporting Member Today!


    And always remember to read, read, read, and read some more!


  10. #9
    Developer
    Developer
    Achievements:
    1000 Experience Points500 Experience Points250 Experience Points100 Experience Points7 days registered
    drod2169's Avatar
    Member #
    11469
    Join Date
    Sep 2010
    Location
    Tampa, Florida
    Posts
    250
    Liked
    159 times
    VFS Cache Pressure, go ahead and disable that. I think the stock value is 100, so enter that. At the value of "12" which is the default in Liberty (from one of my old sysctl's) causes a slowdown after a while, even though makes everything much more responsive at the get go. The slowdown is why I removed it from rubiX roms. OOM Kill Allocating Task kills off the app that caused you to run out of memory, which runs better than the stock android configuration.

    There really is NO right answer when you research sysctl. The best thing to do, would be to search VM Linux tweaks. Most of the time, you'll see sysctl values that people optimizing their linux systems use. Take a look at those, then look into the actual name of what you're tweaking, to find out what it does.
    Last edited by drod2169; 01-16-2011 at 03:31 PM.

  11. #10
    X Operative Achievements:
    3 months registered250 Experience Points100 Experience Points31 days registered7 days registered
    Marius's Avatar
    Member #
    17580
    Join Date
    Oct 2010
    Posts
    202
    Liked
    18 times
    So entering 100 for vfs cache disables it?

    Edit: oh I see it returns kernel to default behavior. I've seen systems crawl when it runs out dentries and inodes. I'll keep it at 100. Thx.

    Sent from my DROIDX using Tapatalk
    Marius, aka. Imoseyon
    http://www.imoseyon.com/

+ Reply to Thread
Page 1 of 60 1 2 3 11 51 ... LastLast

Ads

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. Nenolod's performance tweaks - sysctl.conf - effective?
    By armedmonkey in forum Droid X Hacks
    Replies: 4
    Last Post: 03-21-2011, 05:47 PM
  2. Sysctl settings
    By patrick72 in forum Droid X General Discussion
    Replies: 4
    Last Post: 02-16-2011, 01:40 PM
  3. Kernel Tweaks
    By MXDX in forum Droid X Hacks
    Replies: 4
    Last Post: 02-06-2011, 11:13 AM
  4. Kernel Tweaks
    By MXDX in forum Droid X ROMs
    Replies: 0
    Last Post: 02-04-2011, 07:23 PM
  5. X Performance / Memeory tweaks
    By DISCOSTU9 in forum Droid X General Discussion
    Replies: 9
    Last Post: 07-17-2010, 06:12 PM

Search tags for this page

android sysctl
,
dirty expire centisecs
,
fix permissions on appd
,
oom kill allocating task
,
stock sysclt.conf
,
sysctl android
,

sysctl tweaks

,

sysctl.conf android

,
sysctl.conf.zip
,
vfs cache pressure android
Click on a term to search our sites for related topics.

Tags for this Thread