Tweak Android for Performance, and increase battery by Saving Power Usage with Sysctl!
Posted on Thursday, June 11, 2009
Filed under
G1 Hacks,
Tweaks
For the last couple of days I have been looking at the android os and am trying to find a few ways to optimize performance and increase battery life on the G1. I have found a few sysctl commands that you can expiriment with and let me know the results.
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: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
Tweak virtual memory for running on Charger: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
Detecting apps/services that hog the battery/cpu:
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: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
Additional Tweaks:
By default when Linux runs out of memory it goes through the process list and starts killing off processes that it thinks are using too much memory. This sysctl makes Linux kill the runaway process that made the system run out of memory instead, which is usually what you want.(this will also reduce cpu time and increase battery usage).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.sysctl -w vm.vfs_cache_pressure=10
You may also try setting this to 200 and see if you notice a difference with battery life and app startup times.
There is an in depth discussion over these tweaks over at XDA, feel free to join in if you have any comments or suggestions Here
Comments
Categories
- Apps
- Howto
- News
- Tips and Tricks
- G1 ROMS
- Hacking The Android G1
- HTC Hero ROM
- Cupcake
- Custom Firmware for G1
- Hacking
- Root Android G1
- Tethering
- Dudes Cupcake
- G1 Hacks
- Hack the G1
- Manual OTA Update Instructions
- Misc
- Shortcuts
- Tether your android G1 phone
- Themes
- Android G1 Service Manual
- Bugs
- Change Boot Logo
- Convert video to Android G1
- Docs
- Download mp3's from your gmail account
- Factory Settings G1
- Free Calls From Android G1
- Friendfeed on your Android G1
- G1 Firmware
- Google Voice Android App
- HTC Magic
- HTC Sapphire
- Latest HTC Radio For G1
- Meebo IM on Android
- Modified Hero Rom
- QA
- RC29
- RC30
- Radio Update
- Root RC30
- Sip
- SuperHero ROM
- Tips Tricks
- Tweaks
- Unbrick
- Unroot G1
- Update Recovery Partition/IMG
- Upgrade G1 Radio
- Upgrade SPL
- Video Encoding
- Wallpapers For the G1 Phone
- Widgets
- android app search
- android apps
- android widgets
- androird irc client
- best g1 apps
- command line
- g1 pdf reader
- g1 root
- g1 widgets
- irc on android
- jailbreak g1
- mp3 player android g1
- pdf reader
- pdf viewer
- root access
- root g1











Leave a Reply