Proper executing of sysctl.conf during boot - Galaxy S I9000 Q&A, Help & Troubleshooting

Edit: For some strange reason it suddenly works after posting this topic.. :') Delete please
Ok so this is the deal, I'm currently working on broodKernel v1.2 (yes not 1.1 but 1.2) and I've noticed that sysctl.conf isn't loaded in any way, I tried loading it with "sysctl -p" and also with su -c "sysctl -p", both tried it in the kernel itself and in init.d scripts, for some reason it doesn't load on boot, but when I load it myself with "su -c "sysctl -p" it works correctly :silly:
mode is: 644, also tried to chown it to system and/or root, both didn't work. then I question myself. is my init.d method correct? Is it running in root mode? I use this:
Code:
service initd /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
oneshot
doesn't it need a "user root" at the bottom?, I feel kinda like this emoticon ":silly:" to ask such question, but I really don't know why it's not running correctly, anyhow the sysctl values from the latest thunderbolt seem so unrealistic?:
Code:
vm.dirty_expire_centisecs = 3000
vm.dirty_writeback_centisecs = 500
But ok that's the thunderbolt settings, also I'm not sure if this really improves the system, I've noticed that the first few benchmarks score pretty high but then suddenly the sdcard read/write speed gets screwed by something.
Anyway, here are the scripts (so far):
/system/etc/init.d/00broodkernel:
Code:
#!/system/bin/sh
# Created by broodplank1337
# broodKernel v1.2
# =================================== #
# broodKernel v1.2 Configuration File #
# =================================== #
# =================================== #
# >>> Available Settings <<< #
# =================================== #
#
# - Set I/O Scheduler
# - Set SDCARD Readahead
# - Enable/Disable Error Reporting
# - Enable/Disable sysctl.conf file
# - See 01screenstatescaling for (advanced) CPU Settings / Tweaks
#
# =================================== #
# =================================== #
#
# >>> I/O Scheduler <<<
#
SCHEDULER="noop"; # noop/cfq
#
# =================================== #
#
# >>> Set SDCard Read Ahead <<<
#
SDCARDREADAHEAD="1024"; # 128/256/512/1024/2048/3072/4096
#
# =================================== #
#
# >>> Google Error Reporting <<<
#
ERRORREPORTING="disabled"; # enabled/disabled
#
# =================================== #
#
# >>> Sysctl.conf Support <<<
#
SYSCTLSUPPORT="enabled"; # enabled/disabled
#
# =================================== #
# Execute Settings:
echo $SCHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SCHEDULER > /sys/block/mmcblk1/queue/scheduler
# Error Reporting
if [[ "$ERRORREPORTING" == "enabled" ]]
then
setprop profiler.force_disable_err_rpt 0
setprop profiler.force_disable_ulog 0
setprop ro.config.nocheckin 0
else
setprop profiler.force_disable_err_rpt 1
setprop profiler.force_disable_ulog 1
setprop ro.config.nocheckin 1
fi;
# Sysctl.conf
if [[ "$SYSCTLSUPPORT" == "enabled" ]]
then
sysctl -p
else
busybox mv /system/etc/sysctl.conf /system/etc/sysctl.conf.disabled
fi;
# Readahead
echo $SDCARDREADAHEAD > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "256" > /sys/devices/virtual/bdi/179:32/read_ahead_kb;
echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb;
/system/etc/init.d/01screenstatescaling: (really like this one )
Code:
#!/system/bin/sh
# Credits to pikachu01 and FloHimself for governor tweaks / screenstatescaling script
# Edited by broodplank1337 to fit broodKernel v1.2
# Mount
mount -o remount rw /system
# =====================================================================================
# >>> broodKernel v1.2 CPU Configuration File / Screenstatescaling Script >>> #
# =====================================================================================
# >>> Notes <<<
#
# - This script manages the cpu settings for awake and sleep state.
# - Be sure not to set the max frequency lower then the min frequency.
# - Please only use existing governors to prevent boot problems.
# - Additional governor tweaks can be enabled for a better battery life,
# the governor tweaks may lower performance (only theoretical, like cpu score in Antutu)
# - You can choose to use this file only for CPU Settings,
# this will modify the /system/etc/init.qcom.post_boot.sh file to not set a governor,
# when enabled and 01screenstatescaling is absent, your system will not boot properly
# settings can be restored by place this line:
# =====================================================================================
# >>> Basic CPU Settings <<< # Please only use the values below as settings
# =====================================================================================
# Awake CPU Settings
AWAKE_GOVERNOR="ondemand"; # ondemand/performance/conservative/userspace
MIN_SPEED_AWAKE="245760"; # 122880/245760/368640
MAX_SPEED_AWAKE="1401600"; # 768000/806400/1024000/1200000/1401600
# Sleep CPU Settings
SLEEP_GOVERNOR="ondemand"; # ondemand/conservative/powersave
MIN_SPEED_SLEEP="122880"; # 122880/245760/368640
MAX_SPEED_SLEEP="245760"; # 122880/245760/368640
# Governor Tweaks
ENABLE_ONDEMAND_TWEAKS="no"; # yes/no
ENABLE_CONSERVATIVE_TWEAKS="no"; # yes/no
# =====================================================================================
# =====================================================================================
# >>> Advanced CPU Settings << # Use at own risk, don't change if inexperienced.
# =====================================================================================
# Use 01screenstatescaling as primary CPU Management script
DISABLE_POSTBOOT_CPU="no"; # yes/no (only enable if you know what you're doing!)
# =====================================================================================
# Execute Settings
# Disable Postboot CPU Management
if [[ "$DISABLE_POSTBOOT_CPU" == "no" ]]
then
if [ -e /system/etc/init.qcom.post_boot.sh.bak ]; then
busybox cp -f /system/etc/init.qcom.post_boot.sh.bak /system/etc/init.qcom.post_boot.sh
else
sleep 1
fi;
else
if [ -e /system/etc/init.qcom.post_boot.sh.bak ]; then
sleep 1
else
busybox cp -f /system/etc/init.qcom.post_boot.sh /system/etc/init.qcom.post_boot.sh.bak
sed '33d' /system/etc/init.qcom.post_boot.sh > /sdcard/temp.sh # Remove line that sets governor
busybox mv -f /sdcard/temp.sh /system/etc/init.qcom.post_boot.sh
chmod 644 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
fi;
fi;
# Ondemand Tweaks
if [[ "$ENABLE_ONDEMAND_TWEAKS" == "yes" ]]
then
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo "5" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential;
#echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
fi;
if [ -e /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold;
echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential;
#echo "0" > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate;
fi;
else
sleep 1
fi;
# Conservative Tweaks
if [[ "$ENABLE_CONVERVATIVE_TWEAKS" == "yes" ]]
then
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold;
echo "90" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "20" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate;
fi;
if [ -e /sys/devices/system/cpu/cpufreq/conservative/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold;
echo "90" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "20" > /sys/devices/system/cpu/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate;
fi;
else
sleep 1
fi;
# Screenstatescaling loop
(while [ 1 ];
do
# ==============================================================
# settings for while the screen is on / usage
# ==============================================================
AWAKE=`cat /sys/power/wait_for_fb_wake`;
if [ $AWAKE = "awake" ]; then
sleep 2
log -p i -t screenstate_scaling "State: Awake, switching CPU governor to -> $AWAKE_GOVERNOR"
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $MIN_SPEED_AWAKE > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $MAX_SPEED_AWAKE > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
fi;
# ==============================================================
# settings for while the screen is off
# ==============================================================
SLEEPING=`cat /sys/power/wait_for_fb_sleep`;
if [ $SLEEPING = "sleeping" ]; then
sleep 2
log -p i -t screenstate_scaling "State: Sleeping, switching CPU governor to -> $SLEEP_GOVERNOR"
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $MIN_SPEED_SLEEP > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $MAX_SPEED_SLEEP > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
fi;
done &);
/system/etc/sysctl.conf:
Code:
vm.page-cluster = 3
vm.laptop_mode = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_writeback_centisecs = 500
vm.dirty_background_ratio = 40
vm.dirty_ratio = 80
vm.vfs_cache_pressure = 10
vm.overcommit_memory = 1
vm.oom_kill_allocating_task = 0
vm.min_free_kbytes = 4096
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_dsack = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_moderate_rcvbuf = 1
kernel.sem = "500 512000 100 2048"
kernel.shmmax = 268435456
kernel.msgmni = 1024

Related

Init.d Scripts

I've been talking with a few people and I've received different info for each. What is wrong with this script? I want to set the new build.prop values via init.d scripts but some think that the way I did it is wrong/i need to correct things. Thanks in advance
Edit: looked up setprop and these are my questions
kifno said:
Looked on google and xda and found nothing about mounting before applying setprop ro.* values using the script I looked at about 8 scripts and they just place setprop ro.* or whatever line they wanted a value applied to. So I still can't figure out why you and say it won't work because the line is read only or already found in the build.prop because again I saw and read plenty of scripts with setprop ro.* and other lines with different values set with setprop that were already in their rom's init.rc or build.prop....so why wouldn't it work?
Click to expand...
Click to collapse
Code:
#!/system/bin/sh
#!/xbin/sh
#
#kifno tweaks
# Network Speed
setprop net.tcp.buffersize.default 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.wifi 4095,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.umts 4094,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.edge 4093,262140,770880,4096,30643,770880;
setprop net.tcp.buffersize.gprs 4094,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.wimax 4094,87380,256960,4096,16384,256960;
setprop ro.ril.hsxpa 2;
setprop ro.ril.gprsclass 8;
setprop ro.ril.hep 1;
setprop ro.ril.enable.dtm 1;
setprop ro.ril.hsdpa.category 24;
setprop ro.ril.enable.a53 1;
setprop ro.ril.enable.3g.prefix 1;
setprop ro.ril.htcmaskw1.bitmask 4294967295;
setprop ro.ril.htcmaskw1 14449;
setprop ro.ril.hsupa.category 3;
setprop wifi.supplicant_scan_interval 200;
echo 256960 > proc/sys/net/core/wmem_max;
echo 256960 > proc/sys/net/core/rmem_max;
echo 256960 > proc/sys/net/core/wmem_default;
echo 256960 > proc/sys/net/core/rmem_default;
echo 4096 16384 256960 > /proc/sys/net/ipv4/tcp_wmem;
echo 4096 87380 256960 > /proc/sys/net/ipv4/tcp_rmem;
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout;
echo 30 > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse;
# Memory Threshold (Process Killing)
setprop ro.FOREGROUND_APP_MEM 1536;
setprop ro.VISIBLE_APP_MEM 3072;
setprop ro.SECONDARY_SERVER_MEM 4096;
setprop ro.BACKUP_APP_MEM 4096;
setprop ro.HOME_APP_MEM 4096;
setprop ro.HIDDEN_APP_MEM 21000;
setprop ro.CONTENT_PROVIDER_MEM 23000;
setprop ro.EMPTY_APP_MEM 25000;
# VM parameters
echo 0 > /proc/sys/vm/swappiness;
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 10 > /proc/sys/vm/vfs_cache_pressure;
echo 1652 > /proc/sys/vm/min_free_kbytes;
#Boot
MMC=`ls -d /sys/block/mmc*`;
# Optimize NRS
for i in $MMC;
do
echo 0 > $i/queue/rotational;
done;
# Optimize I/O Scheduler
for i in $MMC;
do
echo $IO_SCHEDULER > $i/queue/scheduler;
case $IO_SCHEDULER in
"noop")
echo 1 > $i/queue/iosched/fifo_batch;;
"cfq")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 0 > $i/queue/iosched/slice_idle;;
"bfq")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 0 > $i/queue/iosched/slice_idle;;
esac;
done;
# Set "No-op" scheduler for mtdblocks and mmc
for i in `ls -1 /sys/block/mtdblock*` /sys/block/mmcblk0
do
echo "noop" > $i/queue/scheduler
done
# Less Lag When Making Phone Calls
setprop ro.telephony.call_ring.delay 1000;
setprop ro.mot.eri.losalert.delay 1000;
MAX_PHONE()
{
pidphone=`pidof com.android.phone`;
if [ $pidphone ]; # Wait for com.android.phone to start;
then
echo -17 > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
(while [ 1 ];
do
sleep 10;
MAX_PHONE;
done &);
# DF MODs
setprop ro.media.dec.vid.wmv.enabled 1;
setprop ro.media.dec.aud.wma.enabled 1;
setprop ro.media.dec.aud.flac.enabled 1;
setprop ro.media.dec.aud.ape.enabled 0;
setprop ro.media.dec.vid.avi.enabled 1;
setprop ro.media.dec.vid.flv.enabled 0;
setprop ro.media.dec.vid.qt.enabled 0;
setprop ro.media.dec.vid.rm.enabled 0;
setprop video.accelerate.hw 1;
setprop debug.performance.tuning 1;
# miscellaneous
setprop dalvik.vm.startheapsize 8m;
setprop windowsmgr.max_events_per_sec 60;
setprop ro.product.multi_touch_enabled true;
setprop ro.product.max_num_touch 2;
setprop keyguard.no_require_sim true;
setprop debug.sf.hw=1;
setprop ro.opengles.version=131072;
setprop ro.default_usb_mode 2;
setprop ro.qualcomm.proprietary_obex false;
setprop ro.display.width 320;
setprop ro.display.height 960;
As I already mentioned to you several times, you can't overwrite a value that starts with "ro." once it has already been set, no matter the method. And as I've already mentioned to you, half of the properties you're trying to set don't actually do anything. You should really try finding documentation of these properties (or their location in the source code if you can't find that) if you're going to be changing them.
Please don't PM me anymore if you're not even going to listen to my responses. I appreciate that you're trying to do something productive, but you need to spend more time researching and less time "jumping the gun" to make changes.
jasonmaloney said:
As I already mentioned to you several times, you can't overwrite a value that starts with "ro." once it has already been set, no matter the method. And as I've already mentioned to you, half of the properties you're trying to set don't actually do anything. You should really try finding documentation of these properties (or their location in the source code if you can't find that) if you're going to be changing them.
Please don't PM me anymore if you're not even going to listen to my responses. I appreciate that you're trying to do something productive, but you need to spend more time researching and less time "jumping the gun" to make changes.
Click to expand...
Click to collapse
I've been researching A LOT and I've read lots of scripts and I.m learning along the way but I'm working with uncorrupted now on this and I did jump the gun just a tad lol but I'm taking it slow now again thanks for the information you did supply me with

Tweak init.d script prevents boot

Hello everyone!
I made this script for myself from stuff I found online. But when I put it into init.d the phone stops booting before the cyanogen logo comes up (on the second LG logo). I can't figure out why... However it works (the settings are applied) if I run it with adb once the phone is booted.
This is the script:
Code:
#!/system/bin/sh
echo "0,1,2,4,6,15" > /sys/module/lowmemorykiller/parameters/adj;
echo "1536,2048,4096,10240,12800,15360" > /sys/module/lowmemorykiller/parameters/minfree;
# vm management tweaks:
echo "4096" > /proc/sys/vm/min_free_kbytes;
echo "1" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness;
echo "70" > /proc/sys/vm/vfs_cache_pressure;
echo "15" > /proc/sys/vm/dirty_ratio;
echo "3" > /proc/sys/vm/dirty_background_ratio;
# misc kernel tweaks:
echo "8" > /proc/sys/vm/page-cluster;
#echo "64000" > /proc/sys/kernel/msgmni;
#echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
#echo "500,512000,64,2048" > /proc/sys/kernel/sem;
# CPU scheduler tweaks:
#echo "1000000" > /proc/sys/kernel/sched_latency_ns;
#echo "25000" > /proc/sys/kernel/sched_wakeup_granularity_ns;
#echo "100000" > /proc/sys/kernel/sched_min_granularity_ns;
echo "-1" > /proc/sys/kernel/sched_rt_runtime_us ;
echo "100000" > /proc/sys/kernel/sched_rt_period_us;
echo "95000" > /proc/sys/kernel/sched_rt_runtime_us;
# battery tweaks:
echo "3000" > /proc/sys/vm/dirty_expire_centisecs;
echo "500" > /proc/sys/vm/dirty_writeback_centisecs;
echo "500" > /proc/sys/vm/dirty_expire_centisecs;
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs;
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
tune2fs -o journal_data_writeback /dev/block/mmcblk0p1;
tune2fs -O ^has_journal /dev/block/mmcblk0p1;
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2;
tune2fs -O ^has_journal /dev/block/mmcblk0p2;
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p8;
tune2fs -f -O ^has_journal /dev/block/mmcblk0p8;
mount -o remount,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,nobh /system;
mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data;
mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache;
rm -f /data/system/userbehavior.db;
chmod 400 /data/system/usagestats/;
chmod 400 /data/system/appusagestats/;
rm -f /dev/log/main;
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;
setprop net.dns1 8.8.8.8;
setprop net.dns2 8.8.4.4;
setprop windowsmgr.support_rotation_270 true;
setprop persist.service.pcsync.enable 0;
setprop persist.service.lgospd.enable 0;
setprop user.feature.flex true;
setprop user.feature.lgdrm false;
setprop user.feature.lgresource false;
setprop user.feature.lgpoweroff false;
setprop user.feature.ls_event false;
setprop user.feature.ls_normal false;
setprop user.feature.sui false;
setprop media.stagefright.enable-player false;
setprop media.stagefright.enable-meta true;
setprop media.stagefright.enable-scan true;
setprop media.stagefright.enable-http true;
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
MAX_PHONE()
{
pidphone=`pidof com.android.phone`;
if [ $pidphone ];
then
/system/xbin/echo "-17" > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
exit;
else
MAX_PHONE;
fi;
}
MAX_ACORE()
{
pidacore=`pidof android.process.acore`;
if [ $pidacore ];
then
/system/xbin/echo "-17" > /proc/$pidacore/oom_adj;
renice -3 $pidacore;
exit;
else
MAX_ACORE;
fi;
}
MAX_MEDIA()
{
pidmedia=`pidof android.process.media`;
if [ $pidmedia ];
then
/system/xbin/echo "-17" > /proc/$pidmedia/oom_adj;
renice -20 $pidmedia;
exit;
else
MAX_MEDIA;
fi;
}
MAX_UI()
{
pidui=`pidof com.android.systemui`;
if [ $pidui ];
then
/system/xbin/echo "-17" > /proc/$pidui/oom_adj;
renice -20 $pidui;
exit;
else
MAX_UI;
fi;
}
Thanks!
user.feature.lgdrm=false disable DRM Service, so you can not use the default phone ringtones and notifications but if you are planning to use your custom files without DRM then there are no problems.
Regards.

[Q] How to improve 3D of i9000?How to get more than 5000 in antutu

How can I overclock GPU by 400MHz?I have heart about that the SGX540 may actually clocked at 400MHZ。http://forum.xda-developers.com/showthread.php?p=15107363
How to improve 3D performance ?How to get more than 5000 in antutu?
Does the below sript have any proplem?
#!/system/bin/sh
###
##
#
busybox cp /system/.nomedia /d/
busybox cp /system/.nomedia /data/
busybox cp /system/.nomedia /dbdata/
busybox cp /system/.nomedia /dev/
busybox cp /system/.nomedia /etc/
busybox cp /system/.nomedia /lib/
busybox cp /system/.nomedia /mnt/
busybox cp /system/.nomedia /sys/
insmod /lib/modules/deadline-iosched.ko
mmc=`ls -d /sys/block/mmc*`; stl=`ls -d /sys/block/stl*`
for a in $mmc $stl; do
echo deadline > $a/queue/scheduler
echo 8 > $a/queue/iosched/fifo_batch
echo 400 > $a/queue/iosched/read_expire
echo 4 > $a/queue/iosched/writes_starved
echo 0 > $a/queue/iostats
echo 4 > $a/queue/nr_requests
echo 0 > $i/queue/rotational
done
busybox sysctl -w kernel.sched_latency_ns="600000"
busybox sysctl -w kernel.sched_wakeup_granularity_ns="3000000"
#busybox sysctl -w kernel.sched_min_granularity_ns="1500000"
#echo "2048" > /proc/sys/kernel/msgmni;
#echo "64000" > /proc/sys/kernel/msgmax;
#echo "10" > /proc/sys/fs/lease-break-time;
#echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features
#echo "NO_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
#echo "NO_GENTLE_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
#echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
#echo "1000" > /proc/sys/vm/dirty_expire_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "60" > /proc/sys/vm/dirty_background_ratio
echo "1" > /proc/sys/vm/vfs_cache_pressure
echo "0" > /proc/sys/vm/swappiness
echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
setprop debug.sf.hw 1; # HARDWARE RENDERING (GPU)
setprop video.accelerate.hw 1;
setprop debug.performance.tuning 1;
if [ -e /sys/module/pm_hotplug/parameters/loadl ]; then
echo 40 > /sys/module/pm_hotplug/parameters/loadl;
echo 90 > /sys/module/pm_hotplug/parameters/loadh;
echo 50 > /sys/module/pm_hotplug/parameters/loadl_scroff;
echo 100 > /sys/module/pm_hotplug/parameters/loadh_scroff;
echo 200 > /sys/module/pm_hotplug/parameters/rate;
echo 800 > /sys/module/pm_hotplug/parameters/rate_cpuon;
echo 800 > /sys/module/pm_hotplug/parameters/rate_scroff;
echo 500000 > /sys/module/pm_hotplug/parameters/freq_cpu1on;
fi;
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/smooth_target ]; then
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_target;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_offset;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_step;
fi;
if [ -e /sys/devices/system/cpu/sched_mc_power_savings ]; then
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings;
fi;
if [ -e /sys/module/cpuidle/parameters/enable_mask ]; then
echo 3 > /sys/module/cpuidle/parameters/enable_mask;
fi;
if [ -e /sys/class/misc/brightness_curve/min_bl ]; then
echo 20 > /sys/class/misc/brightness_curve/min_bl;
echo 1 > /sys/class/misc/brightness_curve/min_gamma;
echo 24 > /sys/class/misc/brightness_curve/max_gamma;
fi;
#echo 4 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_cpulevel;
#echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_buslevel;
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "0 0 0 0 0 0 0 " > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo "1 1 1 1 1 1 " > /sys/devices/system/cpu/cpu0/cpufreq/states_enabled_table
echo "300 400 300 400 300 400 300 300 267 267 200 100 " > /sys/devices/system/cpu/cpu0/cpufreq/gpu_clock_table
echo 85 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
# CFS options moved elsewhere!
#if [ -e /proc/sys/kernel/rr_interval ];
#then
# BFS;
# echo 6 > /proc/sys/kernel/rr_interval;
# echo 75 > /proc/sys/kernel/iso_cpu;
#else
# CFS
# following 2 settings are to be handled with care - could lead to bootlooping phone or other issues if too low !
#echo 100000 > /proc/sys/kernel/sched_latency_ns; # 1000000 # 18000000 # 1000000 # 100000 ## new
#echo 500000 > /proc/sys/kernel/sched_wakeup_granularity_ns ; # 500000 # 3000000 # 25000 # 0 (?)
#echo 750000 > /proc/sys/kernel/sched_min_granularity_ns; # 1000000 # 1500000 # 100000 # 1000000 ## 750000 (upstream)
#echo 200000 > /proc/sys/kernel/sched_min_granularity_ns; # 1000000 # 1500000 # 100000 # 1000000 ## 750000 (upstream)
#echo 400000 > /proc/sys/kernel/sched_latency_ns; # 1000000 # 18000000 # 1000000 # 100000 ## new
#echo 100000 > /proc/sys/kernel/sched_wakeup_granularity_ns ; # 500000 # 3000000 # 25000 # 0 (?)
#echo -1 > /proc/sys/kernel/sched_rt_runtime_us;
#echo 100000 > /proc/sys/kernel/sched_rt_period_us;
#echo 95000 > /proc/sys/kernel/sched_rt_runtime_us; # default: 950000; very small values in sched_rt_runtime_us can result in an unstable system when the runtime is so small
# the system has difficulty making forward progress (the migration thread and kstopmachine both are real-time processes)
#fi;
insmod /lib/modules/deadline-iosched.ko
mmc=`ls -d /sys/block/mmc*`; stl=`ls -d /sys/block/stl*`; bml=`ls -d /sys/block/bml*`; tsfr=`ls -d /sys/block/tfsr*`;
for a in $mmc $stl $bml $tsfr; do
echo deadline > $a/queue/scheduler
echo 8 > $a/queue/iosched/fifo_batch
echo 400 > $a/queue/iosched/read_expire
echo 4 > $a/queue/iosched/writes_starved
echo 0 > $a/queue/iostats
echo 4 > $a/queue/nr_requests
echo 0 > $i/queue/rotational
done
#echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
#echo "1000" > /proc/sys/vm/dirty_expire_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "55" > /proc/sys/vm/dirty_background_ratio
echo "1" > /proc/sys/vm/vfs_cache_pressure
echo "0" > /proc/sys/vm/swappiness
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo 1 > /sys/class/misc/backlightnotification/enabled
sync
echo 3 > /proc/sys/vm/drop_caches
setprop ro.ril.disable.power.collapse = 1
#MAX_PHONE()
#{
#pidphone=`pidof com.android.phone`;
#if [ $pidphone ]; # Wait for com.android.phone to start;
#then#
# echo -17 > /proc/$pidphone/oom_adj; # exclude com.android.phone from oom-killer;
# renice -20 $pidphone; # set highest nice level for com.android.phone;
## log -p i -t SSSwitch_v0.8 "*** MAX phone *** set oom_adj(-17) and nice(-20) for com.android.phone";
# exit;
#else
# sleep 5;
# MAX_PHONE;
#fi;
#}
echo 1 > /sys/class/misc/backlightnotification/enabled
sleep 10
sync
echo 3 > /proc/sys/vm/drop_caches
Sorry for my weak English。

[TWEAKS][SCRIPTS] Collection build.prop and init.d tweaks. Now with tweaks combo

Original Thread: http://forum.xda-developers.com/showthread.php?t=1709836
I've been collecting some tweaks and scripts and seems to me it's now time to share it. While some values in terms of optimization might be different from device to device, I've found these pretty consistent throughout many.
I didn't tested all of them, and i don't assume any risk!!! Use them at you own risk!!!
Some useful tips on how to use them at the end of the post
This thread will be updated when new/better things come out
Superuser, Busybox install/update
1. Easily install Busybox (YOU NEED ROOT FIRST)
Code:
https://play.google.com/store/apps/...DEsImNvbS5qcnVtbXkuYnVzeWJveC5pbnN0YWxsZXIiXQ..
2. UPDATE SuperUser (root app)
Code:
http://goo.im/superuser/
Build.prop
(edit your /system/build.prop with a file manager with root access)
Careful for already existing settings. In this case, just change the values.
1. Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
2. Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
3. VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
4. Render UI with GPU
Code:
debug.sf.hw=1
5. Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6. Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
7. Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
8. Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
9. Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=12000000
ro.media.enc.hprof.vid.bps=12000000
11. Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
12. Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
13. Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
14. Fix some application issues
Code:
ro.kernel.android.checkjni=0
15. Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
16. Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
17. Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
18. Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
19. Specifics to some LG devices
Code:
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
user.feature.flex=true
user.feature.lgdrm=false
user.feature.lgresource=false
user.feature.lgpoweroff=false
user.feature.ls_event=false
user.feature.ls_normal=false
user.feature.sui=false
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
7. Flags blocks as non-rotational and increases cache size
Code:
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Auto-zipalign on boot
(needs zipalign bin)
Code:
http://forum.xda-developers.com/showthread.php?t=860586
13. Loopy Smoothness tweak
Code:
http://forum.xda-developers.com/show....php?t=1137554
http://forum.xda-developers.com/show....php?t=1205744
14. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
15. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
16. OOM groupings and priorities tweaks - SuperCharger
Code:
http://forum.xda-developers.com/showthread.php?t=991276
GPS.conf
(create or edit your /system/etc/gps.conf with a file manager with root access)
For improving GPS lock time and signal.
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Other tweaks or guidelines
1. Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
Code:
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
2. Use CyanogenMOD's APN list file - it's one of the most complete.
Code:
It's located in /system/etc/apns-conf.xml
3. Use UOT kitchen for basic theming on your device.
Code:
http://uot.dakra.lt/
4. Use Google's dns servers
Code:
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
5. Update Superuser and su binary to latest version (3.0 beta)
Code:
http://goo-inside.me/superuser/
6. Disable sync feature in sqlite
(author: ownhere - needs a source for your device so you can compile the /system/lib/libsqlite.so)
Code:
Patch file here: http://forum.xda-developers.com/showthread.php?t=903507
7. Do not use task killers.
sysctl_tweaks and sysctl.conf tweaks
added by krabappel2548 Thank him
To make them work:
1. make a new file in /system/etc/init.d, name it sysctl_tweaks
2. make a new file in /system/etc, name it sysctl.conf
3. Paste the right code in the right file
1. sysctl_tweaks
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
/etc/init.d/02vm:# Load /sys/etc/sysctl.conf
/etc/init.d/02vm:sysctl -p
2. sysctl.conf
Code:
#sysctl.conf file
############################
# Battery life tweaks #
############################
sysctl -w vm.dirty_writeback_centisecs=3000;
sysctl -w vm.dirty_expire_centisecs=500;
############################
# kernel tweaks #
############################
sysctl -w kernel.sched_features=15834233;
sysctl -w kernel.msgmni=1024;
sysctl -w kernel.msgmax=64000;
sysctl -w kernel.shmmax=268435456;
sysctl -w kernel.shmall=2097152;
sysctl -w kernel.sem="500 512000 100 2048";
sysctl -w kernel.hung_task_timeout_secs=0;
sysctl -w kernel.sched_latency_ns=18000000;
sysctl -w kernel.sched_compat_yield=1;
sysctl -w kernel.sched_shares_ratelimit=256000;
sysctl -w kernel.sched_child_runs_first=0;
sysctl -w kernel.threads-max=10000;
sysctl -w kernel.panic=30;
sysctl -w kernel.panic_on_oops=1;
sysctl -w kernel.sched_features=24189;
sysctl -w kernel.sched_min_granularity_ns=1500000;
sysctl -w kernel.sched_wakeup_granularity_ns=3000000;
############################
# CPU tweaks #
############################
# Queue size modifications
sysctl -w net.core.optmem_max=20480;
sysctl -w net.unix.max_dgram_qlen=50;
# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288;
sysctl -w net.core.rmem_max=524288;
sysctl -w net.core.rmem_default=256960;
sysctl -w net.core.wmem_default=256960;
############################
# VM & Filesystem tweaks #
############################
sysctl -w fs.lease-break-time=10;
sysctl -w fs.file-max=65536;
sysctl -w vm.overcommit_memory=1;
sysctl -w vm.min_free_order_shift=4;
sysctl -w vm.block_dump=0;
sysctl -w vm.oom_dump_tasks=1;
sysctl -w vm.page-cluster=3;
############################
# Net Speed tweaks #
############################
# UnderUtilized Networking Tweaks below as recommended by avgjoemomma (from XDA)
sysctl -w net.ipv4.tcp_congestion_control=cubic;
# Hardening the TCP/IP stack to SYN attacks
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
# Don't accept source routing
sysctl -w net.ipv4.conf.default.accept_source_route=0 ;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
# Don't accept redirects
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;
This is another init.d tweak It's a battery calibration script
3. This is my battery calibration tweak
Code:
#!/system/bin/sh
# ========================================
# init.d script for KA Xperia SSpeed
# made by krabappel2548
# ========================================
SLEEP=120
if [ -e /data/.battery-calibrated ] ; then
exit 0
fi
(
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
) &
#Disable normalize sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug
Tips Combined twaks and apps
Still testing better values to add!
1. incredibile fast browsing in zoomed pages with no shutters!
♦ VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
♦ Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=250
♦ Opera Mobile Browser
2. Faster internet speed
♦ Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
♦ Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
Alright, I think this is it for now.
If you have any other tweaks or better values, you can PM me and I'll include them
thanks to
kenzo
krabappel2548
its really usefull .. will try it
Sent from my Xperia Arc S using Tapatalk 2
great work, really really great work man! Especially that with the bootanimation! Has it taken much time to gather them all?
Master of Bisaster said:
great work, really really great work man! Especially that with the bootanimation! Has it taken much time to gather them all?
Click to expand...
Click to collapse
you bet..
of course a lot of time man
good job!these will be helpful..
Sent from my ST18i using xda premium
Is this work for Arc S with custom ROM,,,??? coz I saw the "htc" word on 3G tweak script
Sent from my LT18 using xda premium
it would be helpfull know which improove and which deprove specific Rom.
Im using JS 6.1 and for example i dont know if for example this random row:
- wifi.supplicant_scan_interval=180
could improove this rom or it has some better settings somehow
deniel said:
it would be helpfull know which improove and which deprove specific Rom.
Im using JS 6.1 and for example i dont know if for example this random row:
- wifi.supplicant_scan_interval=180
could improove this rom or it has some better settings somehow
Click to expand...
Click to collapse
guys this is for all roms man...plz press thanx
AndriyeZ said:
Is this work for Arc S with custom ROM,,,??? coz I saw the "htc" word on 3G tweak script
Sent from my LT18 using xda premium
Click to expand...
Click to collapse
dude
its a command not really htc company lol....
XtremeSilencer said:
dude
its a command not really htc company lol....
Click to expand...
Click to collapse
hahaha..just wondering mate
I'Ve been used this tweaks
"ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5"
but without the two lines of "htcmaskw1.bitmask=...."
so what the different ??
AndriyeZ said:
hahaha..just wondering mate
I'Ve been used this tweaks
"ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5"
but without the two lines of "htcmaskw1.bitmask=...."
so what the different ??
Click to expand...
Click to collapse
Actually htcmaskw1 command sets the perbit mask tranfer means that when u r on ur data conncetion in no wifi u get the max speed by the value
so the most optimized value has to be said there
XtremeSilencer said:
Actually htcmaskw1 command sets the perbit mask tranfer means that when u r on ur data conncetion in no wifi u get the max speed by the value
so the most optimized value has to be said there
Click to expand...
Click to collapse
Got it...thanks mate..
Sent from my Xperia Arc using xda premium
XtremeSilencer said:
I've been collecting some tweaks and scripts and seems to me it's now time to share it. While some values in terms of optimization might be different from device to device, I've found these pretty consistent throughout many.
I didn't tested all of them, and i don't assume any risk!!! Use them at you own risk!!!
Some useful tips on how to use them at the end of the post
This thread will be updated when new/better things come out
Superuser, Busybox install/update
1. Easily install Busybox (YOU NEED ROOT FIRST)
Code:
https://play.google.com/store/apps/...DEsImNvbS5qcnVtbXkuYnVzeWJveC5pbnN0YWxsZXIiXQ..
2. UPDATE SuperUser (root app)
Code:
http://goo.im/superuser/
Build.prop
(edit your /system/build.prop with a file manager with root access)
Careful for already existing settings. In this case, just change the values.
1. Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
2. Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
3. VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
4. Render UI with GPU
Code:
debug.sf.hw=1
5. Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6. Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
7. Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
8. Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
9. Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=12000000
ro.media.enc.hprof.vid.bps=12000000
11. Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
12. Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
13. Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
14. Fix some application issues
Code:
ro.kernel.android.checkjni=0
15. Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
16. Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
17. Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
18. Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
19. Specifics to some LG devices
Code:
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
user.feature.flex=true
user.feature.lgdrm=false
user.feature.lgresource=false
user.feature.lgpoweroff=false
user.feature.ls_event=false
user.feature.ls_normal=false
user.feature.sui=false
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
7. Flags blocks as non-rotational and increases cache size
Code:
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Auto-zipalign on boot
(needs zipalign bin)
Code:
http://forum.xda-developers.com/showthread.php?t=860586
13. Loopy Smoothness tweak
Code:
http://forum.xda-developers.com/show....php?t=1137554
http://forum.xda-developers.com/show....php?t=1205744
14. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
15. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
16. OOM groupings and priorities tweaks - SuperCharger
Code:
http://forum.xda-developers.com/showthread.php?t=991276
GPS.conf
(create or edit your /system/etc/gps.conf with a file manager with root access)
For improving GPS lock time and signal.
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Other tweaks or guidelines
1. Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
Code:
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
2. Use CyanogenMOD's APN list file - it's one of the most complete.
Code:
It's located in /system/etc/apns-conf.xml
3. Use UOT kitchen for basic theming on your device.
Code:
http://uot.dakra.lt/
4. Use Google's dns servers
Code:
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
5. Update Superuser and su binary to latest version (3.0 beta)
Code:
http://goo-inside.me/superuser/
6. Disable sync feature in sqlite
(author: ownhere - needs a source for your device so you can compile the /system/lib/libsqlite.so)
Code:
Patch file here: http://forum.xda-developers.com/showthread.php?t=903507
7. Do not use task killers.
sysctl_tweaks and sysctl.conf tweaks
added by krabappel2548 Thank him
To make them work:
1. make a new file in /system/etc/init.d, name it sysctl_tweaks
2. make a new file in /system/etc, name it sysctl.conf
3. Paste the right code in the right file
1. sysctl_tweaks
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
/etc/init.d/02vm:# Load /sys/etc/sysctl.conf
/etc/init.d/02vm:sysctl -p
2. sysctl.conf
Code:
#sysctl.conf file
############################
# Battery life tweaks #
############################
sysctl -w vm.dirty_writeback_centisecs=3000;
sysctl -w vm.dirty_expire_centisecs=500;
############################
# kernel tweaks #
############################
sysctl -w kernel.sched_features=15834233;
sysctl -w kernel.msgmni=1024;
sysctl -w kernel.msgmax=64000;
sysctl -w kernel.shmmax=268435456;
sysctl -w kernel.shmall=2097152;
sysctl -w kernel.sem="500 512000 100 2048";
sysctl -w kernel.hung_task_timeout_secs=0;
sysctl -w kernel.sched_latency_ns=18000000;
sysctl -w kernel.sched_compat_yield=1;
sysctl -w kernel.sched_shares_ratelimit=256000;
sysctl -w kernel.sched_child_runs_first=0;
sysctl -w kernel.threads-max=10000;
sysctl -w kernel.panic=30;
sysctl -w kernel.panic_on_oops=1;
sysctl -w kernel.sched_features=24189;
sysctl -w kernel.sched_min_granularity_ns=1500000;
sysctl -w kernel.sched_wakeup_granularity_ns=3000000;
############################
# CPU tweaks #
############################
# Queue size modifications
sysctl -w net.core.optmem_max=20480;
sysctl -w net.unix.max_dgram_qlen=50;
# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288;
sysctl -w net.core.rmem_max=524288;
sysctl -w net.core.rmem_default=256960;
sysctl -w net.core.wmem_default=256960;
############################
# VM & Filesystem tweaks #
############################
sysctl -w fs.lease-break-time=10;
sysctl -w fs.file-max=65536;
sysctl -w vm.overcommit_memory=1;
sysctl -w vm.min_free_order_shift=4;
sysctl -w vm.block_dump=0;
sysctl -w vm.oom_dump_tasks=1;
sysctl -w vm.page-cluster=3;
############################
# Net Speed tweaks #
############################
# UnderUtilized Networking Tweaks below as recommended by avgjoemomma (from XDA)
sysctl -w net.ipv4.tcp_congestion_control=cubic;
# Hardening the TCP/IP stack to SYN attacks
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
# Don't accept source routing
sysctl -w net.ipv4.conf.default.accept_source_route=0 ;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
# Don't accept redirects
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;
This is another init.d tweak It's a battery calibration script
3. This is my battery calibration tweak
Code:
#!/system/bin/sh
# ========================================
# init.d script for KA Xperia SSpeed
# made by krabappel2548
# ========================================
SLEEP=120
if [ -e /data/.battery-calibrated ] ; then
exit 0
fi
(
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
) &
#Disable normalize sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug
Tips Combined twaks and apps
Still testing better values to add!
1. incredibile fast browsing in zoomed pages with no shutters!
♦ VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
♦ Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=250
♦ Opera Mobile Browser
2. Faster internet speed
♦ Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
♦ Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
Alright, I think this is it for now.
If you have any other tweaks or better values, you can PM me and I'll include them
thanks to
kenzo
krabappel2548
Click to expand...
Click to collapse
sorry for the whole quoted msg but please have a look here before you thanx to starter of this thread
As you prolly see there is EXACTLY same post as here but with wrapped codes on each tweak
XtremeSilencer said:
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
Click to expand...
Click to collapse
That seems very strict for a 512mb Ram device. Have you tested this one on arc/s?
Nooby Arc S User said:
That seems very strict for a 512mb Ram device. Have you tested this one on arc/s?
Click to expand...
Click to collapse
tested in arc s mate
Turn Off LTE on Boot Init.d Script
On my LG Optimus G, even though I can select "GSM / WCDMA preferred" to disable LTE after a reboot it defaults back to "GSM / WCDMA / LTE".
I don't live anywhere near LTE and would like to have LTE turned off after powering up my phone. Is there anyway to create an init'd script for that?
I have done so much research and came up empty. This is actually a greatly wanted feature in the LGOG forums. Any help would be greatly appreciated. Thanks.
Thank you very Much! Very Awesome!
new performance tweaks!
us them in your rom but give credits!
XtremeSilencer said:
Original Thread: http://forum.xda-developers.com/showthread.php?t=1709836
I've been collecting some tweaks and scripts and seems to me it's now time to share it. While some values in terms of optimization might be different from device to device, I've found these pretty consistent throughout many.
I didn't tested all of them, and i don't assume any risk!!! Use them at you own risk!!!
Some useful tips on how to use them at the end of the post
This thread will be updated when new/better things come out
Superuser, Busybox install/update
1. Easily install Busybox (YOU NEED ROOT FIRST)
Code:
https://play.google.com/store/apps/...DEsImNvbS5qcnVtbXkuYnVzeWJveC5pbnN0YWxsZXIiXQ..
2. UPDATE SuperUser (root app)
Code:
http://goo.im/superuser/
Build.prop
(edit your /system/build.prop with a file manager with root access)
Careful for already existing settings. In this case, just change the values.
1. Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
2. Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
3. VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
4. Render UI with GPU
Code:
debug.sf.hw=1
5. Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6. Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
7. Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
8. Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
9. Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=12000000
ro.media.enc.hprof.vid.bps=12000000
11. Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
12. Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
13. Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
14. Fix some application issues
Code:
ro.kernel.android.checkjni=0
15. Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
16. Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
17. Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
18. Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
19. Specifics to some LG devices
Code:
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
user.feature.flex=true
user.feature.lgdrm=false
user.feature.lgresource=false
user.feature.lgpoweroff=false
user.feature.ls_event=false
user.feature.ls_normal=false
user.feature.sui=false
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
7. Flags blocks as non-rotational and increases cache size
Code:
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Auto-zipalign on boot
(needs zipalign bin)
Code:
http://forum.xda-developers.com/showthread.php?t=860586
13. Loopy Smoothness tweak
Code:
http://forum.xda-developers.com/show....php?t=1137554
http://forum.xda-developers.com/show....php?t=1205744
14. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
15. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
16. OOM groupings and priorities tweaks - SuperCharger
Code:
http://forum.xda-developers.com/showthread.php?t=991276
GPS.conf
(create or edit your /system/etc/gps.conf with a file manager with root access)
For improving GPS lock time and signal.
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Other tweaks or guidelines
1. Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
Code:
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
2. Use CyanogenMOD's APN list file - it's one of the most complete.
Code:
It's located in /system/etc/apns-conf.xml
3. Use UOT kitchen for basic theming on your device.
Code:
http://uot.dakra.lt/
4. Use Google's dns servers
Code:
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
5. Update Superuser and su binary to latest version (3.0 beta)
Code:
http://goo-inside.me/superuser/
6. Disable sync feature in sqlite
(author: ownhere - needs a source for your device so you can compile the /system/lib/libsqlite.so)
Code:
Patch file here: http://forum.xda-developers.com/showthread.php?t=903507
7. Do not use task killers.
sysctl_tweaks and sysctl.conf tweaks
added by krabappel2548 Thank him
To make them work:
1. make a new file in /system/etc/init.d, name it sysctl_tweaks
2. make a new file in /system/etc, name it sysctl.conf
3. Paste the right code in the right file
1. sysctl_tweaks
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
/etc/init.d/02vm:# Load /sys/etc/sysctl.conf
/etc/init.d/02vm:sysctl -p
2. sysctl.conf
Code:
#sysctl.conf file
############################
# Battery life tweaks #
############################
sysctl -w vm.dirty_writeback_centisecs=3000;
sysctl -w vm.dirty_expire_centisecs=500;
############################
# kernel tweaks #
############################
sysctl -w kernel.sched_features=15834233;
sysctl -w kernel.msgmni=1024;
sysctl -w kernel.msgmax=64000;
sysctl -w kernel.shmmax=268435456;
sysctl -w kernel.shmall=2097152;
sysctl -w kernel.sem="500 512000 100 2048";
sysctl -w kernel.hung_task_timeout_secs=0;
sysctl -w kernel.sched_latency_ns=18000000;
sysctl -w kernel.sched_compat_yield=1;
sysctl -w kernel.sched_shares_ratelimit=256000;
sysctl -w kernel.sched_child_runs_first=0;
sysctl -w kernel.threads-max=10000;
sysctl -w kernel.panic=30;
sysctl -w kernel.panic_on_oops=1;
sysctl -w kernel.sched_features=24189;
sysctl -w kernel.sched_min_granularity_ns=1500000;
sysctl -w kernel.sched_wakeup_granularity_ns=3000000;
############################
# CPU tweaks #
############################
# Queue size modifications
sysctl -w net.core.optmem_max=20480;
sysctl -w net.unix.max_dgram_qlen=50;
# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288;
sysctl -w net.core.rmem_max=524288;
sysctl -w net.core.rmem_default=256960;
sysctl -w net.core.wmem_default=256960;
############################
# VM & Filesystem tweaks #
############################
sysctl -w fs.lease-break-time=10;
sysctl -w fs.file-max=65536;
sysctl -w vm.overcommit_memory=1;
sysctl -w vm.min_free_order_shift=4;
sysctl -w vm.block_dump=0;
sysctl -w vm.oom_dump_tasks=1;
sysctl -w vm.page-cluster=3;
############################
# Net Speed tweaks #
############################
# UnderUtilized Networking Tweaks below as recommended by avgjoemomma (from XDA)
sysctl -w net.ipv4.tcp_congestion_control=cubic;
# Hardening the TCP/IP stack to SYN attacks
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
# Don't accept source routing
sysctl -w net.ipv4.conf.default.accept_source_route=0 ;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
# Don't accept redirects
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;
This is another init.d tweak It's a battery calibration script
3. This is my battery calibration tweak
Code:
#!/system/bin/sh
# ========================================
# init.d script for KA Xperia SSpeed
# made by krabappel2548
# ========================================
SLEEP=120
if [ -e /data/.battery-calibrated ] ; then
exit 0
fi
(
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
) &
#Disable normalize sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug
Tips Combined twaks and apps
Still testing better values to add!
1. incredibile fast browsing in zoomed pages with no shutters!
♦ VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
♦ Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=250
♦ Opera Mobile Browser
2. Faster internet speed
♦ Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
♦ Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
Alright, I think this is it for now.
If you have any other tweaks or better values, you can PM me and I'll include them
thanks to
kenzo
krabappel2548
Click to expand...
Click to collapse
I wish someone could turn this into a flashable zip. I'm a noob so it would be great!
great collections of script..
but on newer kitkat some of this script is not found?

What's the fastest ROM to date?

Finally got a new battery after over a year of not using my Droid 4.
Flashed latest CM13 nightly, 1.4ghz OC. Everything seems slow.
My 512mb ram single core $19 cheapo runs smoother.
Anything I do has a half-second or so delay, clean install with nothing running in the background.
Ideally I would just go back to some minimal 2.3.7 ROM, but compatiblity for new programs is getting iffy.
So, as of 2016, what has the smoothest ROM to do date been?
azkay said:
Finally got a new battery after over a year of not using my Droid 4.
Flashed latest CM13 nightly, 1.4ghz OC. Everything seems slow.
My 512mb ram single core $19 cheapo runs smoother.
Anything I do has a half-second or so delay, clean install with nothing running in the background.
Ideally I would just go back to some minimal 2.3.7 ROM, but compatiblity for new programs is getting iffy.
So, as of 2016, what has the smoothest ROM to do date been?
Click to expand...
Click to collapse
I'm running very, very debloated, overclocked stock JB 4.1.2 with Greenify and ram manager and it works pretty well. Even most of new games and emulators rund good.
Cyanogenmod 11 is quite good. One thing I noticed is that the virtual ROM slots are extremely slow, due to the loopback devices.
One way to go is to install the ROM to the virtual ROM slots to test if they are working correctly and then install it into stock slot for real use.
Up, same question here
I use cm11 or cm12 (i find cm13 extremely slow) But with the following tweaks made from my daily experience feel free to try it
Add those lines on boot
swapoff /dev/block/zram0
echo 1 > /sys/block/zram0/reset
#
# setting zram size to 140 mb
echo 396286400 > /sys/block/zram0/disksize
#
# making zram swapable
mkswap /dev/block/zram0
#
# starting swap on zram
swapon /dev/block/zram0
sysctl -w vm.overcommit_ratio=2
sysctl -w vm.swappiness=100
sysctl -w vm.vfs_cache_pressure=70
swapoff /dev/block/zram0
swapon /dev/block/zram0
echo "0" > /sys/kernel/mm/ksm/run
chmod 755 /sys/kernel/dyn_fsync/Dyn_fsync_active
echo "1" > /sys/kernel/dyn_fsync/Dyn_fsync_active
#----------------------------------I/O------------------------------------
A=`ls -d /sys/block/mmcblk1` ;
B=`ls -d /sys/block/mmcblk0` ;
C=`ls -d /sys/block/mmcblk0/mmcblk0boot0` ;
D=`ls -d /sys/block/mmcblk0/mmcblk0boot1` ;
E=`ls -d /sys/block/mmcblk1/mmcblk0boot0` ;
F=`ls -d /sys/block/mmcblk1/mmcblk0boot1` ;
for i in $A $B $C $D $E $F;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "16" > $i/queue/iosched/fifo_batch;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "128" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "1" > $i/queue/rq_affinity;
echo "3" > $i/queue/iosched/writes_starved;
echo "16" > $i/queue/iosched/quantum;
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
#---------------------------ReadAhead------------------------------
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb #SD CARD
done
G=`ls -d /sys/class/bdi/7:0` ;
H=`ls -d /sys/class/bdi/7:1` ;
I=`ls -d /sys/class/bdi/7:2` ;
J=`ls -d /sys/class/bdi/7:3` ;
L=`ls -d /sys/class/bdi/7:4` ;
M=`ls -d /sys/class/bdi/default` ;
N=`ls -d /sys/class/bdi/7:5` ;
O=`ls -d /sys/class/bdi/7:6` ;
P=`ls -d /sys/class/bdi/7:7` ;
for i in $G $H $I $J $L $M $N $O $P;
do
chmod 755 $i/read_ahead_kb
echo "512" > $i/read_ahead_kb
echo "512" > /sys/class/bdi/default/read_ahead_kb
done
echo "512" > /sys/class/bdi/253:0/read_ahead_kb
#----------------------------------I/O--FOR SD AND INTERNAL----------------------------------
AA=`ls -d /sys/block/mmcblk1` ;
BB=`ls -d /sys/block/mmcblk0` ;
for i in $AA $BB;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "16" > $i/queue/iosched/quantum;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "1" > $i/queue/rq_affinity;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "256" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "16" > $i/queue/iosched/fifo_batch;
echo "3" > $i/queue/iosched/writes_starved;
#echo "1" > $i/queue/iosched/quantum;
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
done
sysctl -w kernel.panic_on_oops=0
#sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.vfs_cache_pressure=70
sysctl -w vm.swappiness=100
sysctl -w vm.drop_caches=0
sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.page-cluster=3
#setsd speeds
chmod 666 /sys/block/mmcblk0/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 666 /sys/block/mmcblk1/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
######sd card
chmod 666 /sys/devices/virtual/bdi/179:24/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:16/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:16/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:8/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:8/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:32/read_ahead_kb
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 2 > /sys/devices/system/cpu/cpufreq/interactive/boost
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo 70 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 300000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 15000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 60 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 666 /sys/module/lowmemorykiller/parameters/minfree
echo '7936,16384,37120,57088,58880,65536' > /sys/module/lowmemorykiller/parameters/minfree
giannhs_n said:
I use cm11 or cm12 (i find cm13 extremely slow) But with the following tweaks made from my daily experience feel free to try it
Add those lines on boot
Click to expand...
Click to collapse
Thank you man, this script made my droid 4 a whole lot more responsive and it does not reboot every few hours anymore.
Quite a few commands in that script don't work, probably due to different paths (sio plus as io scheduler and stock rom boot slot), but those that work, really seem to help a lot.
Oh and you should update the comment in that script about the zram size.
Milp said:
Thank you man, this script made my droid 4 a whole lot more responsive and it does not reboot every few hours anymore.
Quite a few commands in that script don't work, probably due to different paths (sio plus as io scheduler and stock rom boot slot), but those that work, really seem to help a lot.
Oh and you should update the comment in that script about the zram size.
Click to expand...
Click to collapse
Was testing on different Kernels that's why the paths are wrong.. Please replace the sio plus with cfq or bfq (i forgot to change that)
I am glad that those tweaks help you
Regards john
What about this one? Mentor's ROM http://forum.xda-developers.com/showthread.php?t=2122709
That's what I found on my used Droid 4... should I give it a try?
giannhs_n said:
Was testing on different Kernels that's why the paths are wrong.. Please replace the sio plus with cfq or bfq (i forgot to change that)
I am glad that those tweaks help you
Regards john
Click to expand...
Click to collapse
why replace sio plus? I used bfq before, but when i googled for sio plus i only found people saying that sio plus was the best of them all.
Milp said:
why replace sio plus? I used bfq before, but when i googled for sio plus i only found people saying that sio plus was the best of them all.
Click to expand...
Click to collapse
If your kernel support sio plus, of course use it.. else cfq or bfq is a good alternative
giannhs_n said:
I use cm11 or cm12 (i find cm13 extremely slow) But with the following tweaks made from my daily experience feel free to try it
Add those lines on boot
swapoff /dev/block/zram0
echo 1 > /sys/block/zram0/reset
#
# setting zram size to 140 mb
echo 396286400 > /sys/block/zram0/disksize
#
# making zram swapable
mkswap /dev/block/zram0
#
# starting swap on zram
swapon /dev/block/zram0
sysctl -w vm.overcommit_ratio=2
sysctl -w vm.swappiness=100
sysctl -w vm.vfs_cache_pressure=70
swapoff /dev/block/zram0
swapon /dev/block/zram0
echo "0" > /sys/kernel/mm/ksm/run
chmod 755 /sys/kernel/dyn_fsync/Dyn_fsync_active
echo "1" > /sys/kernel/dyn_fsync/Dyn_fsync_active
#----------------------------------I/O------------------------------------
A=`ls -d /sys/block/mmcblk1` ;
B=`ls -d /sys/block/mmcblk0` ;
C=`ls -d /sys/block/mmcblk0/mmcblk0boot0` ;
D=`ls -d /sys/block/mmcblk0/mmcblk0boot1` ;
E=`ls -d /sys/block/mmcblk1/mmcblk0boot0` ;
F=`ls -d /sys/block/mmcblk1/mmcblk0boot1` ;
for i in $A $B $C $D $E $F;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "16" > $i/queue/iosched/fifo_batch;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "128" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "1" > $i/queue/rq_affinity;
echo "3" > $i/queue/iosched/writes_starved;
echo "16" > $i/queue/iosched/quantum;
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
#---------------------------ReadAhead------------------------------
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb #SD CARD
done
G=`ls -d /sys/class/bdi/7:0` ;
H=`ls -d /sys/class/bdi/7:1` ;
I=`ls -d /sys/class/bdi/7:2` ;
J=`ls -d /sys/class/bdi/7:3` ;
L=`ls -d /sys/class/bdi/7:4` ;
M=`ls -d /sys/class/bdi/default` ;
N=`ls -d /sys/class/bdi/7:5` ;
O=`ls -d /sys/class/bdi/7:6` ;
P=`ls -d /sys/class/bdi/7:7` ;
for i in $G $H $I $J $L $M $N $O $P;
do
chmod 755 $i/read_ahead_kb
echo "512" > $i/read_ahead_kb
echo "512" > /sys/class/bdi/default/read_ahead_kb
done
echo "512" > /sys/class/bdi/253:0/read_ahead_kb
#----------------------------------I/O--FOR SD AND INTERNAL----------------------------------
AA=`ls -d /sys/block/mmcblk1` ;
BB=`ls -d /sys/block/mmcblk0` ;
for i in $AA $BB;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "16" > $i/queue/iosched/quantum;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "1" > $i/queue/rq_affinity;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "256" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "16" > $i/queue/iosched/fifo_batch;
echo "3" > $i/queue/iosched/writes_starved;
#echo "1" > $i/queue/iosched/quantum;
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
done
sysctl -w kernel.panic_on_oops=0
#sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.vfs_cache_pressure=70
sysctl -w vm.swappiness=100
sysctl -w vm.drop_caches=0
sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.page-cluster=3
#setsd speeds
chmod 666 /sys/block/mmcblk0/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 666 /sys/block/mmcblk1/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
######sd card
chmod 666 /sys/devices/virtual/bdi/179:24/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:16/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:16/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:8/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:8/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:32/read_ahead_kb
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 2 > /sys/devices/system/cpu/cpufreq/interactive/boost
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo 70 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 300000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 15000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 60 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 666 /sys/module/lowmemorykiller/parameters/minfree
echo '7936,16384,37120,57088,58880,65536' > /sys/module/lowmemorykiller/parameters/minfree
Click to expand...
Click to collapse
What am I supposed to do with these lines? And can somebody please explain what they are doing specifically?
I was trying to find a way to enable zram to cope with the small amount of memory. swap ram is an alternative, but i heard zram is faster and not stressing the storage like swap ram would.

Categories

Resources