|
|||||||
| Register | FAQ | XDA-Portal | XDA-Wiki | Device database | Donate! | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Here I will post tweaks as I find them to optimize Android.
When echoing in the following sysctl settings they do not remain after reboot, so we can adb remount then create a sysctl.conf file on our pc's with these settings, then ./adb push sysctl.conf /etc/ then the kernel should apply the settings every reboot For examples of a sysctl.conf use google: Sysctl.conf Examples Open a Terminal and Execute these commands as root Tweak virtual memory to conserve power when running on battery: Code:
echo 0 > /proc/sys/vm/swappiness #can be ignored if you dont use swap echo 0 > /proc/sys/vm/dirty_expire_centisecs #can be ignored if you dont use swap echo 0 > /proc/sys/vm/dirty_writeback_centisecs #can be ignored if you dont use swap echo 60 > /proc/sys/vm/dirty_background_ratio echo 95 > /proc/sys/vm/dirty_ratio Code:
echo 0 > /proc/sys/vm/swappiness #can be ignored if you dont use swap echo 3000 > /proc/sys/vm/dirty_expire_centisecs #can be ignored if you dont use swap echo 500 > /proc/sys/vm/dirty_writeback_centisecs #can be ignored if you dont use swap echo 10 > /proc/sys/vm/dirty_background_ratio echo 40 > /proc/sys/vm/dirty_ratio Also while on battery, you should stop all applications that don't really stay idle when you're not using them, if you want to find which apps arent really staying idle you can: Code:
strace -p $(pidof yourapp) # for all your running applications
ps aux | awk '{print$10,$11}' | sort -n # will list all running softs sorted by used cpu time
Code:
sysctl -w vm.oom_kill_allocating_task=1 vfs_cache_pressure to 10 , gives more mem to cache fs dentry and inode to save cpu At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes. Code:
sysctl -w vm.vfs_cache_pressure=10 I'll be adding more tweaks for sysctl and basic cmd line tweaks as I find them, also these tweaks would be good integrated into roms, apps, and a power-save widget if anyone wants to get creative.
__________________
G1 - I switch Rom's Daily lol - RA-dream-v1.5.2 Buy me a beer Follow me on Friendfeed Visit my Ubuntu Site: Visit my Newly Redesigned Android Site(optimized for mobile)Android-Unleashed.com! Follow me on Twitter Last edited by defconoi; 9th June 2009 at 04:24 PM.. Reason: update |
| Sponsored Links |
|
#2
|
|||
|
|||
|
do i enter this into the terminal emulator? also does this only need to be entered in one time? thank you in advance for any help.
|
|
#3
|
||||
|
||||
|
great find.. will keep my eye on this thread
__________________
Tmobile G1 - Cyanogen 4.2.5 100+apps 70mb free 8gb MicroSd Class 6 (FINALLY ) 8gb MicroSd Class 4 *for dual boot gtalk: kaysesoze Follow Me on Twitter Myspace page MY Blog G1 files Donate Change Build.prop |
|
#4
|
||||
|
||||
|
Quote:
defcon
__________________
G1 - I switch Rom's Daily lol - RA-dream-v1.5.2 Buy me a beer Follow me on Friendfeed Visit my Ubuntu Site: Visit my Newly Redesigned Android Site(optimized for mobile)Android-Unleashed.com! Follow me on Twitter |
|
#5
|
||||
|
||||
|
Wow, this is cool, thank you!
Could you maybe add some more comments, I don't really understand what the single commands do. Or some place, where the function of e.g. "dirty_expire_centisecs" is explained? One more precise question though: If I don't have a swap file on sd, does the tweaking of the swappiness still change anything? Greetings!
__________________
my distro-histo: stock 1.0 - stock 1.1 - JF-uk-r9 Dudes 0.93 - JF-adp-1.5 - JF-uk-1.5 - JF-uk-1.51 - JF-cyano-1.51 - Dudes 1.2a/b Haykuros Hero - Twisted Hero - JACHero - Drizzies NewVision - Drizzies Champion - Drizzy Elite - JACsky 1.7r2 - 2.0 - Some drizzy stuff CM 4.0.x -- 4.2.5 |
|
#6
|
|||
|
|||
|
Quote:
there is no swap space on G1, so settings related to the swap can be ignored. echo 0 > /proc/sys/vm/dirty_expire_centisecs echo 0 > /proc/sys/vm/dirty_writeback_centisecs never writes out dirty pages ? Last edited by ccpp0; 8th June 2009 at 12:40 PM.. |
|
#7
|
||||
|
||||
|
Quote:
Note: The value of vm.swappiness=0 states that no swap space will be used at all, basically it can be ignored if you dont use swap though
__________________
G1 - I switch Rom's Daily lol - RA-dream-v1.5.2 Buy me a beer Follow me on Friendfeed Visit my Ubuntu Site: Visit my Newly Redesigned Android Site(optimized for mobile)Android-Unleashed.com! Follow me on Twitter Last edited by defconoi; 8th June 2009 at 12:48 PM.. |
|
#8
|
|||
|
|||
|
Quote:
set vfs_cache_pressure to 10 , gives more mem to cache fs dentry and inode to save cpu "wa". |
|
#9
|
|||
|
|||
|
how do i create a Sysctl.conf file with this script?
i tried the link of examples but all i could find was info about it. everything else works but when i try sysctl vm.block_dump=1 i get sysctl: error: 'vm.block_dump=1' is an unknown key any ideas?
__________________
Phone: T-mobile G1(White) / HTC HD2 (Leo) Network: T-mobile UK Rom: I probably dont even know Follow Me Twitter ![]() Want a new phone? MobileXpress |
|
#10
|
||||
|
||||
|
actually ya know what I think we can just disable sysctl all together in menuconfig->Filesystems->Pseudo Filesystems->Proc->Sysctl Support when compiling a new kernel and setting these tweaks right in the kernel.
Says in menuconfig"As it is generally a good thing, you should say Y here unless building a kernel for install/rescue disks or your system is very limited in memory." So I think we can gain some memory disabling this since we dont really need it
__________________
G1 - I switch Rom's Daily lol - RA-dream-v1.5.2 Buy me a beer Follow me on Friendfeed Visit my Ubuntu Site: Visit my Newly Redesigned Android Site(optimized for mobile)Android-Unleashed.com! Follow me on Twitter Last edited by defconoi; 9th June 2009 at 04:08 PM.. |
![]() |
| Tags |
| hacks, sysctl, tweaks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|