yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] sylaan:
The real question is why the .zip in the OP didn't work, it's supposed to to everything automatically: push the script to /system/etc/init.d, setup the permissions, etc.

Coming back to the manual method, if you use vi on a Linux platform (or on the phone itself) then you won't have problems. If you use Windows then you might have problems with the EOL. After looking a bit around it seems that notepad++ can indeed take care of that by going to Edit - EOL Conversion - UNIX Format.
[Android Apps and Games] sylaan:
This is my file: http://dl.dropbox.com/u/1194449/77sdcardreadfix (2048 read ahead buffer). You can only push it to the phone if you are Soff. But if you are:

adb push 77sdcardreadfix /system/etc/init.d
adb shell chmod 755 /system/etc/init.d/77sdcardreadfix
adb shell chown 0.2000 /system/etc/init.d/77sdcardreadfix
[Android Apps and Games] nYdGeo:
I set mine to 3072 and I'm delighted with the results.

Great info!

Sent from the Evil Evo using XDA App.
[Android Apps and Games] lukesky:
i'm using a DHD with Rev HD 3.3 and even though i flashed the 2048 file and the value didn't change when I viewed it, the benchmark gave me a big increase in Read values.. Gallery seemed to be the same to me in terms of opening speed though.. weird...
[Android Apps and Games] BULL3TPR00F:
actually 777 is the HIGHEST level of access a file can have. Taken from a Linux WIKI:

"chmod 777 = change the permissions of the file to read, write, and execute for all."
[Android Apps and Games] akanishilin:
Nexus One CM7 RC3 Stock SD Card

Default cache size 128kb:

- w_3.9mb/s

- r_16.8mb/s

Set to 3072kb, pushed 77sdcardspeedfix via adb:

- before reboot:

w_5.2mb/s

r_79.8mb/s

- after reboot:

w_4.9mb/s

r_72.6mb/s

Thank you.
[Android Apps and Games] djlim4:
I ran the CWM file, and as stated before, the file still says 128.

Also, my benchmark reading scores were actually significantly lower. It was around 14-15 last night, now it's about 8-9. I've ran it many times.

I really don't care about these scores because my gallery DOES seem to load up almost instantly...

So should i just be happy and shut up? or what?

just wondering cuz I dont have the know how to do this manually

as i've had much trouble in the past with adb.

BTW this is on the verizon fascinate, Superclean ROM running a voodoo lagfix kernel, dunno if that makes a difference
[Android Apps and Games] c00ller:
I feel like this could and should be merged into CM7 (Performance settings)
[Android Apps and Games] BULL3TPR00F:
Device: Xperia X10a

ROM: FreeX10 CM7 RC2 v012a

SD Card: Stock 16gb Class 2

Results:

----------------------------------

128 (default)

1) W: 5.8 MB/s R: 16.0 MB/s

2) W: 6.0 MB/s R: 16.0 MB/s

3) W: 5.3 MB/s R: 16.5 MB/s

1024

1) W: 4.2 MB/s R: 19.4 MB/s

2) W: 4.3 MB/s R: 19.6 MB/s

(Realised I had the phone connected to my laptop charging during test 1 and 2)

3) W: 5.5 MB/s R: 20.3 MB/s

4) W: 4.1 MB/s R: 17.0 MB/s

5) W: 5.6 MB/s R: 24.2 MB/s

2048

1) W: 5.4 MB/s R: 29.7 MB/s

2) W: 3.8 MB/s R: 17.8 MB/s (WTF???)

3) W: 5.9 MB/s R: 34.5 MB/s (Thats better)

4) W: 6.7 MB/s R: 34.4 MB/s (Just to see if the last one was a fluke)

5) W: 5.7 MB/s R: 37.6 MB/s (CONFIRMATION)

3072

1) W: 5.2 MB/s R: 30.8 MB/s

2) W: 5.8 MB/s R: 30.1 MB/s

3) W: 6.3 MB/s R: 37.4 MB/s

4) W: 6.1 MB/s R: 37.8 MB/s

5) W: 5.4 MB/s R: 37.0 MB/s (So far seems the best option)

4096

1) W: 6.5 MB/s R: 29.4 MB/s

2) W: 5.8 MB/s R: 35.3 MB/s

3) W: 5.2 MB/s R: 38.1 MB/s

4) W: 5.4 MB/s R: 34.0 MB/s

5) W: 5.5 MB/s R: 33.1 MB/s

CONCLUSION: Looks like 3072 is the best option for my 16gb Class 2 SD card that came with my phone. Hope these tests help anyone else whos wondering..
[Android Apps and Games] BULL3TPR00F:
I agree it would be so much easier and helpful to others.
[Android Apps and Games] cordoni:
This is amazing! Thank you so much!
[Android Apps and Games] seboj:
Using the 2gb Class 2 that came with the phone.

Default:

W: 4.2

R: 9.3

2048kb:

W: 4

R: 26.2

3024kb:

W: 5.1

R: 33.8

Noticeable speed increase in apps like Gallery.
[Android Apps and Games] c00ller:
Suggestion to people using SD Tools:

I found it helps to increase the screen timeout while doing these tests, as the screen turning off and having to unlock the device seems to mess with the app.
[Android Apps and Games] prettypoy92:
doesn't work on my x10 :(
[Android Apps and Games] BULL3TPR00F:
works perfect on mine, couldnt get the script to load thru the init.d so i just used script manager and set the file to run as root and run at boot.

running FreeX10 CM7 RC2 v012a, this is my script:

#!/system/xbin/sh
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "[COLOR="Red"]3072[/COLOR]" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
then
fi;

Just change the number in red to whatever value you found works best with ur sd card.
[Android Apps and Games] TommyNgo215:
Awesome fix. My SD card bow performs much faster on my phone. Before it was taking forever to load my pictures. I have thousands of pictures and mp3 files. This fix worked wonderfully.

Thank you! !!
[Android Apps and Games] c00ller:
Here are my results. This is on a Sprint Hero CDMA with a Transcend 8 GB Class 6 TS8GUSDHC6E. Software used to measure was SD Tools (https://market.android.com/details?id=ales.veluscek.sdtools).

128 kB

Write (MB/s)	3.6	5.2	7.2	5.3	7.2	Average: 5.7

Read (MB/s)	8.7	9.1	9.5	8.6	8.8	Average: 8.94

1024 kB

Write (MB/s)	4.4	6.5	7.3	7.5	7.7	Average: 6.68

Read (MB/s)	13.3	15.9	14.6	14.2	13.7	Average: 14.34

2048 kB

Write (MB/s)	6	7.5	6.4	7.1	6.7	Average: 6.74

Read (MB/s)	18.7	19.7	20.6	21.9	22.6	Average: 20.7

3072 kB

Write (MB/s)	6.3	7.9	7.4	7.1	6.5	Average: 7.04

Read (MB/s)	21.7	21.3	19.7	22.1	20.7	Average: 21.1

4096 kB

Write (MB/s)	6.4	7.4	7.7	7.9	6.6	Average: 7.2

Read (MB/s)	21.5	19.7	19.1	17.2	20.4	Average: 19.58

Data from first runs (not shown) were disregarded as they were inconsistent with subsequent runs.

And in graphical representation since I was in Excel anyway:
[Android Apps and Games] Calundle:
I'm confused, I edited the file to 2048 with Root and ran SD Tools and I got 12 MB/s write speed and 117 MB/s read speed. What? >_>
[Android Apps and Games] oxide-:
Awesome fix, thank you!

Here's the results of testing my Sandisk 16gb class 6 card over 5 runs with SD tools:

128

5.2 write, 11.0 read

5.9 write, 11.3 read

5.5 write, 11.1 read

5.6 write, 11.3 read

5.6 write, 11.2 read

average

5.56 write, 11.18 read

2048

5.2 write, 24.0 read

5.7 write, 23.6 read

5.5 write, 24.2 read

5.5 write, 21.8 read

5.5 write, 22.8 read

average

5.48 write, 23.28 read

3072

5.4 write, 33.6 read

5.6 write, 28.7 read

5.5 write, 25.2 read

5.7 write, 28.7 read

5.7 write, 28.4 read

average

5.58 write, 28.92 read

haven't tested 4096 yet
[Android Apps and Games] richua:
What are your specs? Did you try running it again?
[Android Apps and Games] diimaan:
My read read speed hovers around 18-19 MB/s!

but my write speed is in the range of 9-10 MB/s.

I use a class 2 16GB card! I can see my write speeds are faster than a few class 6 cards here! but my read speed is slow.

which one will affect the performance? read or write?
[Android Apps and Games] brainmaster:
Read speed. But you can't probably get more out of the Class 2 card.
[Android Apps and Games] m4a1rifle:
My speed test result on HTC Desire CM7 RC2, Kingmax Class 10 8GB

128 default

1) 7.5, 13.5

2) 5.2, 16.2

3) 18.6, 18.7

4) 18.8, 20.9

4096

26.2, 53.9

17.5, 62.9

19.7, 59.6

26.7, 57.2

27.8, 55.7

3072 - before reboot

23.6, 46.7

17.6, 70.2

24.3, 36.5

23.6, 66.1

15.9, 67.2

3072 - after reboot

6.2, 51.6

13.5, 23.3

5.4, 17.4

11.5, 86.4

16.7, 41.6

25, 50.9

23.6, 51.7
[Android Apps and Games] richua:
Which one did you end up using? I'm trying to get a feel for class 10 cards.
[Android Apps and Games] m4a1rifle:
i'm using the 3072, because it can achieve the highest.

i think you should try a few times, and choose only based on the highest it can achieve. not the combined average score.
[Android Apps and Games] Kolorkode:
Cheers!

(tested several times after rebooting after each test. Up from 4.2 w / 24.4 r)
[Android Apps and Games] laie1472:
Great mod. Works excellent.

4096= w/s 5.6 r/s 13.7

2048= w/s 7.9 r/s 21.7

3072= w/s 6.6 r/s 20.1

1024= w/s 7.1 r/s 17.5

Class 4sd/card 16gb 1024ext2 partition.

Running Aosp's 03/26 gb build.

I went with the 2048. From the op. Thanks again.

@brainmaster. Please ckeck pm's when you have a sec thanks.

Yea it's Me Again With The

Modified Hero
[Android Apps and Games] drakedian:
With 2048 i have like 5 wr 77 rd speed. Great work, thanks.

However i tried with 3072 and the numbers was "higher" but i noticed a "lag" issue when loading from SD card, so i settled back with 2048.

Kingstone 8gb Class 6

ZTE Blade @ Cyanogen latest nightly
[Android Apps and Games] geokilla:
I noticed that while it has improved my read/write speeds, the SD tools only scans the internal SD and not external SD. Is there a way to change this?
[Android Apps and Games] TamCore:
Using this Class6 8GB SD-Card from A-Data: http://www.amazon.de/gp/product/B0026L7DG0/ref=oss_product

128: http://dl.dropbox.com/u/9441929/class6_128kb.png

2048: http://dl.dropbox.com/u/9441929/class6_2048kb.png

3072: http://dl.dropbox.com/u/9441929/class6_3072kb.png

4096: http://dl.dropbox.com/u/9441929/class6_4096kb.png

5120: http://dl.dropbox.com/u/9441929/class6_5120kb.png

8192: http://dl.dropbox.com/u/9441929/class6_8192kb.png

10240: http://dl.dropbox.com/u/9441929/class6_10240.png

I think 8192 is a good choice :)
[Android Apps and Games] aries77:
got another apps to measure sd card speed namely SD cars Speed Test (SST), already tries 2 and 3 mb but the result don't efect much as using sd tools.
[Android Apps and Games] The Gurgler:
One thing that I didn't see addressed in the first 7 pages of this thread that I think is fairly important.

777 permission should never be used in an init script. That is just an accident waiting to happen. Thankfully /system is mounted as read-only by default so you should be OK. All the other files on my CM7 RC3 install are 750 with root:shell ownership. That's what this script should also be set to. So, IMHO:

chown root:shell /system/etc/init.d/77sdcardreadfix
chmod 750 /system/etc/init.d/77sdcardreadfix

Just another thing, really just my preference, I'm using the following in /system/etc/init.d/77sdcardreadfix:

#!/system/bin/sh
#BUFFSIZE=128
BUFFSIZE=3072

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "${BUFFSIZE}" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;

This is just my preference to use a variable and then tweak the value of BUFFSIZE (I found 3072k value to work well on my Class 10 32GB card). The earlier examples certainly work, but I'm an anal retentive SA and like to keep things organized.

Hope this helps. ;)
[Android Apps and Games] piens:
HTC-Desire, used the zip method.

77sdcardspeedfix exists in etc/init.d and has correct content.

still 4 kb in /sys/devices/virtual/bdi/179:0/read_ahead_kb (after reboot) !

sd-tools gives no change 4.8 read before and after

when I manually change /sys/devices/virtual/bdi/179:0/read_ahead_kb and put 3072 in there write speed stays the same, but read speed goes from 4.8 to 39.5, so that seems to work. Why does it not stay changed when I reboot :confused:
[Android Apps and Games] sylaan:
See if you can launch the script manually first:

# cd /system/etc/init.d
# ./77sdcardspeedfix

Make sure it has the correct permissions, they have been posted in the thread.
[Android Apps and Games] motoelliot:
Ok, I have a sandisk 16g class 4. Used the 3072 and definitely see a difference! Wow! Sorry didn't benchmark it tho.... thanks man, great hack!
[Android Apps and Games] bjlg:
Is may be '/system/xbin/echo'

seach 'find / name 'echo '!!

Some rom's "echo" command is not /system/xbin directory!

try it

/bin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
[Android Apps and Games] h4kudoshi:
16GB Class 2 Micro SD @ 3072 seems to be the best for me
[Android Apps and Games] FuSiOnZ:
tweak sure works, but when i was playing a game my phone went all crazy and made a high pitch sound from the game and turned off by itself im using sony x10i, im using 2.1.0.435 with link2sd, the game i was running was on the sd card. never had this problem before the tweak, luckily i did a backup in xrecovery. i was using 3072 and got this score. no one else having problems with this tweak :eek: or is it just me 0.0 scores are great though 0.0
[Android Apps and Games] laie1472:
Great Mod All Results are from the sd/tools app posted in the op

I took the zips from the op and made them flashable for those who want them and for those who are using RA1.7,1.6 etc also for those using CWM 2.5

4069= w/s 5.6 r/s 13.7

Download zip here For Ra.1.7

http://db.tt/3Lvbazr

2048= w/s 7.9 r/s 21.7

Download Zip here For RA1.7

http://db.tt/V3mAVyV

3072= w/s 6.6 r/s 20.1

Download Zip here For RA.1.7

http://db.tt/WJDdgxB

1024= w/s 7.1 r/s 17.5

Download Zip For RA1.7 here

http://db.tt/Oss3SKD

Also if you try this mod and want to revert just flash the stock zip here

http://db.tt/nW8SVWA

The results posted from each zip are mine with with the setup posted below. Diffrent sd/cards will produce different results.

Running this on a

Class4 sd/card 16gb 1024ext2 partition

@Brainmaster Great MOD BIG THANKS
[Android Apps and Games] Johnsondr80:
Stock Phoenix Rom, for my captivate.

Question is; am I testing internal 16 gig card/ or my personally bought 8 gig external sd card
[Android Apps and Games] brainmaster:
Your external SD Card.
[Android Apps and Games] Rusty!:
Bloody hell:

Sandisk 8GB C4 with 3072KB cache.
[Android Apps and Games] log902hk:
THX for sharing:D
[Android Apps and Games] clouds5:
I'm using Android Revolution HD 3.3 ->DesireHD

Tried flashing both of the zips through CWM 3.0.0.6 installation was successful but when I look at the command line its still 128kb (i flashed the 2048kb one).

Is this because of ADRH, or am is it not compatible with cwm 3.0.0.6?
[Android Apps and Games] Dirk:
And therein lies the issue. All the test results here are from one App. There may well be a speed increase from this but until it is verified properly i'm still taking it with a pinch of salt.
[Android Apps and Games] geokilla:
Wrong. SD Tools was testing my internal SD card. Couldn't get it to test my external SD card no matter what.

Plus my results were varying hugely across the board. A lot of outliers and stuff.
[Android Apps and Games] Flo95:
How to apply this fix permanently without a init.d (don't have that file).

My device is a X10 @ 2.1

With the size of 2048kb I get a read speed increase from around 15mb/s to 35-40mb/s on my Kingmax 16GB class10!!! Write speed didn't increase.

Awesome.
[Android Apps and Games] Johnsondr80:
Ok thanks, I didnt know how to tell.

Any way my results were good and I dont guess I need to add this tweak.

Just wish I could test and tweak my external, as thats where I store all my captured camera pictures.

9.8 topscore and 17.2 bottom score.

Presented by Phoenix Ult jk4 k13d

Absolution useing xda pre app i897
[Android Apps and Games] brainmaster:
This tweak applies the values for the EXTERNAL SD Card, not internal storage.
[Android Apps and Games] Johnsondr80:
Ooooohhhhh. I thought it should be.

From the creater him self, so I must listen. So how do we test internal card or tweak it?

Sorry but im a tweak freak. Shouldve used that as my username. Lol
[Android Apps and Games] geokilla:
How do we get SD Tools to test the external SD then? It keeps on testing the internal SD. And my numbers have improved slightly with different cache settings but I guess it could just be as I said, outliers and variable results.
[Android Apps and Games] Whyt_e:
how do you know what the phone is currently using any apps to test?
[Android Apps and Games] piens:
:eek: I'm completly stunned, on my HTC desire init.d is empty now, but if I give the command ls it says ./77sdcardspeedfix: no such file or directory. Where does it get this filename, it looks like it is there somewhere after all. Tried to delete init.d, says init.d is deleted but when I look in etc it is there again, empty, but somehow it can tell me that there is no 77sdcardspeedfix. With rootexplorer I can't see this file, with es filemanager I can see it (but do nothing with it) how did i manage to create that mess?

On my other system, a tablet, there also was no init.d. I created this folder and put the file there. I can run it manually and it works then (changing the path of echo so it can use echo from betterterminalpro, the only echo found on my system) but does not run automatically after a reboot. Does the init.d need special properties to act as a startup folder?
[Android Apps and Games] boypower:
Thanks For Sharing.... :)
[Android Apps and Games] tdrussell:
the .zip actually had no effect on my DX running GB leak.

Sd tools FC if i perform the edit manually.
[Android Apps and Games] Deaks2:
I got the following results with the 8192 kb setting

9.3 MB/s write

119.7 MB/s read

nook 1.1 (rooted)

Patriot 16 GB Class 10
[Android Apps and Games] tnpapadakos:
tried em all, got some varied results, but then tried 512 and got my best results:

9.9 write

199.7 read

8GB class 6
[Android Apps and Games] buddn07:
Just out of curiosity... for 1024k how was your max speed 4.6 yet your average was 5.5? Thanks for the testing though.
[Android Apps and Games] Serious_Beans:
Does this work on N/S?
[Android Apps and Games] kojitabe:
Can this really fix my micro sd write/read speed even after i re-format it?

Thanks in advance :D
[Android Apps and Games] sylaan:
When you do a ./77sdcardspeedfix it will try to launch it from your current directory, that is what ./ means, a "." is the current directory in linux. The fact that you get "no such file or directory" simply means the file was not found.

If you tried to flash one of the .zip files in the OP then I guess it didn't work in your case. Why ? Good question.

Normally any file, no matter then name or extension, which is in init.d and has the executable bit set should be executed. Why that isn't done in some cases, I don't know, it most likely depends on your ROM. It is executed fine in my case for example.
[Android Apps and Games] sylaan:
The value of the read ahead buffer is not related to the state of the SD card, it's a value the kernel sets. You reformating the card has no impact and the "fix" will still work.
[Android Apps and Games] cavarr:
I have problem with this script, recovery:

SamdroidMod 1.3.1 - Android 2.1, kernel: qbanin
[Android Apps and Games] nanujra:
Theres an app on the market that appears to do exactly this, called SD Card Speed Booster. the creator is charging a dollar for it though...
[Android Apps and Games] piens:
Strange behaviour! I can run the command manually and in a file when there is only the echo statement, like .../.../echo "3072" > /sys/devices......etc. It works. So I decided to replace the 77SDCardSpeedFix from the zip file with mine and flash it. It does not work, cache is 4kb again after reboot. Is there another way to have the echo command be executed after reboot? Somehow a fresh init.d is created after every reboot with 77SDCardSpeedFix, I guess after the flashing of the zipfile. How and where can this be disabled again?
[Android Apps and Games] sylaan:
You might need to take this up with whoever made the ROM you use.
[Android Apps and Games] galt:
Thanks for doing this. It worked on my CM7 rom using RA.
[Android Apps and Games] jonamafun:
Am I the only one looking at these ridiculous numbers that people are posting and thinking wtf?

I don't understand how you can possibly believe such speed results when a USB 2.0 port will transfer data at a practical maximum of 35mb/s.
[Android Apps and Games] jonamafun:
I might also add that I flashed the 2048kb zipfile using CWM, but it would only install after I disabled zip file signature verification.
[Android Apps and Games] sylaan:
Those speeds have nothing to do with USB, it's just the read/write speed from/to the card FROM the phone itself. And USB 2.0 has a theoretical maximum of 480Mbps or 60 MB/s, I am pretty sure the practical maximum is higher than 35mbps.
[Android Apps and Games] daveid:
You are not alone, I have been following this thread thinking the same thing. What people are doing here is increasing the amount of read-ahead and write-back cache that the system will use when accessing the external storage. Without a clear understanding of what they are actually doing, they will see larger numbers in synthetic benchmarks and think they made it faster. With a clearer understanding of what they are doing, they may think for a second and realize the increase in speed is just because a larger portion of the read/write operation is occurring from/to cache as opposed to the actual sdcard.

The synthetic benchmark is only testing with a small amount of data, thus increasing the cache size so that the entire process (or the majority of it) is actually to/from the cache (already loaded in memory, nearly instant access speeds) showing a great increase in speed. In reality, the access speeds of the sdcard are not at all affected, only the amount of data that will be pre-cached from it for quicker access. When working with small files, this may show a drastic increase in performance - but that is not indicative of higher performance. In actuality, long-term performance may be degraded, as the cache will have to be filled/flushed when copying files that are larger than the specified cache size.

Unless I have this completely backwards.....
[Android Apps and Games] tnpapadakos:
yeah, i'd like to know too

since the default value is set at 128, i would think bumping it up to 512 wouldnt do too much harm

the benchmark (for me) using 512 was actually better than 3072 or 2048

keeping an eye on this
[Android Apps and Games] daveid:
Real world testing is needed, with large files and a stopwatch. No synthetic benchmark is going to do this unless you can specify the amount of data being tested, and use a large value.
[Android Apps and Games] Dirk:
Glad i'm not the only skeptic. Apparently my Class 2 SD can read at 140MB/s :D
[Android Apps and Games] Caiaphas:
This deffinitly worked for me! It uped my write speed by .4 and my read speed by 1.3!

Thank you!
[Android Apps and Games] -Arturo-:
Interesting there's something wrong with my rom I guess. When I execute the script it just clears the read_ahead_kb file completely to the point that it contains no characters and the size of the file is 0.
[Android Apps and Games] c00ller:
Real world "benchmark": open gallery3D, see how long it takes images to load. I have observed a noticeable increase in loading speed.
[Android Apps and Games] Serious_Beans:
Does this work on a Nexus S or any other device that has the SD card partition on the NAND?
[Android Apps and Games] daveid:
That would qualify as 'observational' not representative of real world performance. The reason the thumbnails load faster is because of the point I made regarding the size of the data being accessed. With a larger cache, those files fit in the cache, making them load faster. Real world testing has to include data of much larger filesizes. In any drive/memory benchmark there are always large file and small file copy test. The gallery stores thumbnails in 1024K chunks, with a cache of 3072K the cache can preload 3 chunks and most likely refill fast enough to keep up with the demand. However, when transferring large files, performance may actually be degraded due to wasted i/o operations.

Again, I may be completely off base here, but this is my understanding of real-world drive cache performance.
[Android Apps and Games] lukesky:
so why don't you do the real world test and post your results here? i'm sure a lot of people would be curious to know
[Android Apps and Games] daveid:
I don't have time, or really much interest in doing this. My class 10 sdcard performs quite well in my Nexus One, I have over 500 pictures and over 100 videos and the thumbnails pop right up fluidly as I scroll through them. And everything else is nice and fast.