• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [TWEAK][INIT.D] 66Citbun all-in-one optimizer[UPDATED 2.23.12] Added beta 5 'friendly' version

I uninstalled and reinstalled it and its fine. Seems to be doing that every few days. Where's the script I need to remove? I have root explorer.
 
Its in the script. Open the script with a text editor and delete the section with all the ipv4 settings, save and reboot.

Just to clarify, do we delete or comment out (#) all the entries listed below?

#internet speed tweaks
echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
echo 0 > /proc/sys/net/ipv4/tcp_tw_recycle;
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse;
echo 1 > /proc/sys/net/ipv4/tcp_sack;
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling;
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo 20 > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo 1800 > /proc/sys/net/ipv4/tcp_keepalive_time;
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;
 
Just to clarify, do we delete or comment out (#) all the entries listed below?

#internet speed tweaks
echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
echo 0 > /proc/sys/net/ipv4/tcp_tw_recycle;
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse;
echo 1 > /proc/sys/net/ipv4/tcp_sack;
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling;
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo 20 > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo 1800 > /proc/sys/net/ipv4/tcp_keepalive_time;
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;


Yes. Delete only that section, leaving the rest intact, then save your changes and reboot.
 
wouldnt it make more sense to remove the ipv4 script itself, rather than deleting those lines from this script? just seems like one script doing multiple things would be better than using one for the ipv4, and one other things. unless im missing something and/or there are additional tweaks inside the ipv4 script, and you are suggesting to remove those lines from that. (i can not find the copy of ipv4 that i downloaded, doesn't it go in /ect/init.d too?) if it does do more, those lines could just be added into this tweak.

edit: has anyone else noticed slower battery drain when you are not using the phone? (screen is off)
 
wouldnt it make more sense to remove the ipv4 script itself, rather than deleting those lines from this script? just seems like one script doing multiple things would be better than using one for the ipv4, and one other things. unless im missing something and/or there are additional tweaks inside the ipv4 script, and you are suggesting to remove those lines from that. (i can not find the copy of ipv4 that i downloaded, doesn't it go in /ect/init.d too?) if it does do more, those lines could just be added into this tweak.

edit: has anyone else noticed slower battery drain when you are not using the phone? (screen is off)


It depends on what scripts your already using and build.prop settings. Removing the ipv4 script from init.d would work, I suppose. But I know with my Rom and CTMod that most of the setting from these ipv4 script actually lower speeds. Due to the fact they have already been added to the build.prop.

Yes lord, ipv4 script should be in /system/etc/init.d. If your using a seperate script.
 
I am starting it from a half drained battery and I have to leave heytell running because its annoying to open, close, open, close.. you get it but this weekend I will have a better idea.
 
just open it with a text editor (i use es file explorer's built in one.)

Code:
#!/system/bin/sh
#
# Copyright (c) 2011 Leonard Luangga


#internet speed tweaks
echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
echo 0 > /proc/sys/net/ipv4/tcp_tw_recycle;
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse;
echo 1 > /proc/sys/net/ipv4/tcp_sack;
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling;
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo 20 > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo 1800 > /proc/sys/net/ipv4/tcp_keepalive_time;
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;


#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


#battery tweaks (vm)
echo 0 > /proc/sys/vm/laptop_mode;
echo 500 > /proc/sys/vm/dirty_expire_centisecs;
echo 1000 > /proc/sys/vm/dirty_writeback_centisecs;
echo 60 > /proc/sys/vm/dirty_ratio;
echo 45 > /proc/sys/vm/dirty_background_ratio;


#vm management tweaks
echo 0 > /proc/sys/vm/panic_on_oom;
echo 0 > /proc/sys/vm/overcommit_memory;
echo 0 > /proc/sys/vm/oom_kill_allocating_task;
echo 3 > /proc/sys/vm/page-cluster;
echo 10 > /proc/sys/vm/swappiness;
echo 50 > /proc/sys/vm/vfs_cache_pressure; #default value=100. low value can cause memory leak, high value drains more battery
echo 2896 > /proc/sys/vm/min_free_kbytes;

#default value for /proc/sys/vm/min_free_kbytes
# RAM        min_free_kbytes
# 16MB        512k
# 32MB        724k
# 64MB        1024k
# 128MB        1448k
# 256MB        2048k
# 512MB        2896k
# 1024MB    4096k
# 2048MB    5792k
# 4096MB    8192k
# 8192MB    11584k


#kernel tweaks
#echo 1 > /proc/sys/kernel/panic_on_oops;
#echo 60 > /proc/sys/kernel/panic;
echo 0 > /proc/sys/kernel/panic_on_oops;
echo 30 > /proc/sys/fs/lease-break-time;
#echo 64000 > /proc/sys/kernel/msgmni; #1024
#echo 64000 > /proc/sys/kernel/msgmax;
#echo 1000000 > /proc/sys/kernel/sched_rt_period_us;
#echo 950000 > /proc/sys/kernel/sched_rt_runtime_us;
echo 500 512000 64 2048 > /proc/sys/kernel/sem;

if [ -e /proc/sys/kernel/sched_min_granularity_ns ]
then
    echo 200000 > /proc/sys/kernel/sched_min_granularity_ns;
fi

if [ -e /proc/sys/kernel/sched_latency_ns ]
then
    echo 400000 > /proc/sys/kernel/sched_latency_ns;
fi

if [ -e /proc/sys/kernel/sched_wakeup_granularity_ns ]
then
    echo 100000 > /proc/sys/kernel/sched_wakeup_granularity_ns;
fi

if [ -e /proc/sys/kernel/hung_task_timeout_secs ]
then
    echo 45 > /proc/sys/kernel/hung_task_timeout_secs;s
#(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000);
#echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
#echo 10000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 70 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;


#optimize build.prop
#setprop ro.ril.hsxpa 2; #HSDPA/UMTS? I think this one gonna drain more and more battery
#setprop ro.ril.hsxpa 1; #HSDPA only? hmm I think this one drain more battery than UMTS only
setprop ro.ril.hsxpa 0; #UMTS only? slower but I think this one drain less battery
setprop ro.ril.gprsclass 10;
setprop ro.ril.hsupa.category 6;
setprop ro.ril.hsdpa.category 8;
setprop ro.ril.hep 1;
setprop ro.ril.enable.dtm 1;
setprop ro.ril.enable.a53 1;
setprop ro.ril.enable.3g.prefix 1;
setprop keyguard.no_require_sim true;
setprop net.tcp.buffersize.default 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.wifi 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.umts 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.edge 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.gprs 4096,87380,256960,4096,16384,256960;

setprop windowsmgr.support_rotation_270 true;
setprop ro.mot.eri.losalert.delay 1000;
setprop ro.lge.proximity.delay 25;
setprop mot.proximity.delay 25;
setprop persist.sys.use_dithering 0;
setprop persist.sys.purgeable_assets 1;
setprop ro.media.dec.jpeg.memcap 20000000;
setprop ro.media.enc.jpeg.quality 100;
setprop ro.HOME_APP_ADJ 1;
setprop ro.HOME_APP_MEM 2048;
;
setprop video.accelerate.hw 1;
setprop media.stagefright.enable-player true;
setprop ro.ril.disable.power.collapse 0;
setprop persist.adb.notify 0;
setprop pm.sleep_mode 1;
setprop debug.sf.hw 1;
setprop debug.performance.tuning 1;
setprop dalvik.vm.execution-mode int:jit
#untested
#setprop ro.kernel.android.checkjni 0; #does it really fix some apps issue? http://forum.xda-developers.com/archive/index.php/t-1253326.html
#setprop ro.mot.buttonlight.timeout 0; #force button lights on when screen is on
 
just open it with a text editor (i use es file explorer's built in one.)

Code:
#!/system/bih/sh
#
# Copyright (c) 2011 Leonard Luangga


#internet speed tweaks
echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
echo 0 > /proc/sys/net/ipv4/tcp_tw_recycle;
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse;
echo 1 > /proc/sys/net/ipv4/tcp_sack;
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling;
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo 20 > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo 1800 > /proc/sys/net/ipv4/tcp_keepalive_time;
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;


#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


#battery tweaks (vm)
echo 0 > /proc/sys/vm/laptop_mode;
echo 500 > /proc/sys/vm/dirty_expire_centisecs;
echo 1000 > /proc/sys/vm/dirty_writeback_centisecs;
echo 60 > /proc/sys/vm/dirty_ratio;
echo 45 > /proc/sys/vm/dirty_background_ratio;


#vm management tweaks
echo 0 > /proc/sys/vm/panic_on_oom;
echo 0 > /proc/sys/vm/overcommit_memory;
echo 0 > /proc/sys/vm/oom_kill_allocating_task;
echo 3 > /proc/sys/vm/page-cluster;
echo 10 > /proc/sys/vm/swappiness;
echo 50 > /proc/sys/vm/vfs_cache_pressure; #default value=100. low value can cause memory leak, high value drains more battery
echo 2896 > /proc/sys/vm/min_free_kbytes;

#default value for /proc/sys/vm/min_free_kbytes
# RAM        min_free_kbytes
# 16MB        512k
# 32MB        724k
# 64MB        1024k
# 128MB        1448k
# 256MB        2048k
# 512MB        2896k
# 1024MB    4096k
# 2048MB    5792k
# 4096MB    8192k
# 8192MB    11584k


#kernel tweaks
#echo 1 > /proc/sys/kernel/panic_on_oops;
#echo 60 > /proc/sys/kernel/panic;
echo 0 > /proc/sys/kernel/panic_on_oops;
echo 30 > /proc/sys/fs/lease-break-time;
#echo 64000 > /proc/sys/kernel/msgmni; #1024
#echo 64000 > /proc/sys/kernel/msgmax;
#echo 1000000 > /proc/sys/kernel/sched_rt_period_us;
#echo 950000 > /proc/sys/kernel/sched_rt_runtime_us;
echo 500 512000 64 2048 > /proc/sys/kernel/sem;

if [ -e /proc/sys/kernel/sched_min_granularity_ns ]
then
    echo 200000 > /proc/sys/kernel/sched_min_granularity_ns;
fi

if [ -e /proc/sys/kernel/sched_latency_ns ]
then
    echo 400000 > /proc/sys/kernel/sched_latency_ns;
fi

if [ -e /proc/sys/kernel/sched_wakeup_granularity_ns ]
then
    echo 100000 > /proc/sys/kernel/sched_wakeup_granularity_ns;
fi

if [ -e /proc/sys/kernel/hung_task_timeout_secs ]
then
    echo 45 > /proc/sys/kernel/hung_task_timeout_secs;s
#(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000);
#echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
#echo 10000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 70 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;


#optimize build.prop
#setprop ro.ril.hsxpa 2; #HSDPA/UMTS? I think this one gonna drain more and more battery
#setprop ro.ril.hsxpa 1; #HSDPA only? hmm I think this one drain more battery than UMTS only
setprop ro.ril.hsxpa 0; #UMTS only? slower but I think this one drain less battery
setprop ro.ril.gprsclass 10;
setprop ro.ril.hsupa.category 6;
setprop ro.ril.hsdpa.category 8;
setprop ro.ril.hep 1;
setprop ro.ril.enable.dtm 1;
setprop ro.ril.enable.a53 1;
setprop ro.ril.enable.3g.prefix 1;
setprop keyguard.no_require_sim true;
setprop net.tcp.buffersize.default 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.wifi 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.umts 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.edge 4096,87380,256960,4096,16384,256960;
setprop net.tcp.buffersize.gprs 4096,87380,256960,4096,16384,256960;

setprop windowsmgr.support_rotation_270 true;
setprop ro.mot.eri.losalert.delay 1000;
setprop ro.lge.proximity.delay 25;
setprop mot.proximity.delay 25;
setprop persist.sys.use_dithering 0;
setprop persist.sys.purgeable_assets 1;
setprop ro.media.dec.jpeg.memcap 20000000;
setprop ro.media.enc.jpeg.quality 100;
setprop ro.HOME_APP_ADJ 1;
setprop ro.HOME_APP_MEM 2048;
;
setprop video.accelerate.hw 1;
setprop media.stagefright.enable-player true;
setprop ro.ril.disable.power.collapse 0;
setprop persist.adb.notify 0;
setprop pm.sleep_mode 1;
setprop debug.sf.hw 1;
setprop debug.performance.tuning 1;
setprop dalvik.vm.execution-mode int:jit
#untested
#setprop ro.kernel.android.checkjni 0; #does it really fix some apps issue? http://forum.xda-developers.com/archive/index.php/t-1253326.html
#setprop ro.mot.buttonlight.timeout 0; #force button lights on when screen is on

I found a type-o in the begining of the script:
#!/system/bih/sh

Should be:
#!/system/bin/sh
So you will have to modify this line before it will work

Does this replace *all* init'd scripts?
Including default CTMod scripts?
PhoneMan: Not sure. Give it a try
 
I did but it still shows the pre-installed scripts, I was wondering if i could delete them? lol

It won't delete the others, you'll have to do that manually. After you delete them then open your terminal emulator and type:
su
cd /etc/init.d
chmod 777 66Citbun
reboot

Then your phone should reboot and the script should be active.
 
It won't delete the others, you'll have to do that manually. After you delete them then open your terminal emulator and type:
su
cd /etc/init.d
chmod 777 66Citbun
reboot

Then your phone should reboot and the script should be active.

My phone won't mess up if I delete the ones from CTMod?
So it wont do anything unless I type:
"su
cd /etc/init.d
chmod 777 66Citbun
reboot" ??
 
So it wont do anything unless I type:
"su
cd /etc/init.d
chmod 777 66Citbun
reboot" ??

Odds are no. But even before you try to use this script, open it in a text editor and edit the header from.
#!system/bih/sh
to
#!system/bin/sh

Then move it to the init.d and chmod it.
 
Odds are no. But even before you try to use this script, open it in a text editor and edit the header from.
#!system/bih/sh
to
#!system/bin/sh

Then move it to the init.d and chmod it.

ok well it doesn't show that it change directories and when i typed chmod 777 66Citbun it said no file or directory
 
ok well it doesn't show that it change directories and when i typed chmod 777 66Citbun it said no file or directory

What you wanna do is edit the header of the script first, then use your root explorer to move the script to the /etc/init.d directory and then close your root explorer. (Make sure the script now is in the /etc/init.d directory before proceeding, it will not work otherwise)

Then open the terminal emulator app and type:
su
then:
cd /etc/init.d
then:
chmod 777 66Citbun
then:
reboot

(Remember the terminal emulator is case sensitive)
 
Didn't "feel" any different... I have no service (WY sux) and ram widget shows same average ram... What do you think?
 
Back
Top Bottom