OpenWrt Forum Archive

Topic: Good USB drive speed tweak

The content of this topic has been archived on 27 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

On my g300nh I was getting horrid results on writes with time dd tests, around 8 MB/sec.

I found a tweak that helped it go to 19 MB/sec after looking at some linux forums.

You can add this line to /etc/sysctl.conf and reboot or run sysctl -p.
/sys/block/sda/device/max_sectors=1024

or if you prefer to put it in a startup script or run it one time.
echo 1024 > /sys/block/sda/device/max_sectors

(Last edited by robnitro on 11 Feb 2011, 01:43)

Nice trick! Got my wr1043nd transfer speed from 11 MB/s to 13.5 MB/s.

Great tip! Drastically improved my throughput! smile

Now if it could drastically increase my samba and ftp write to router usb hdd speeds.  At most I can do is max 10 MB/sec writes on g300nh despite dd write doing 19!

Interesting. I can get ~31MB/sec both read+write on my wndr3700. Samba is still limited to about 5.5MB/sec write and 7MB/sec read though sad

EDIT: FTP has similar speeds (if anything, slightly slower) to Samba.

(Last edited by lessthanjoey on 11 Feb 2011, 22:08)

Thanks, this doubles write performance. See results for "Seagate Free Agent Desktop, 250GB" in http://wiki.openwrt.org/inbox/benchmark.usb

But I notice that going over 30MB/s transfer speeds loads the CPU to 45%
I think samba and ftp are limited by CPU. I download a 100MB file over CIFS with around 5MB/s and top show the following CPU load:

8% usr  43% sys   0% nic   0% idle  26% io   0% irq  21% sirq

See my bonnie++ results with and without the max_sectors (use bon_csv2html to convert csv to nice html):

1.96,1.96,felis-way,1,1362551860,64M,,,,15895,11,9900,25,,,26373,39,94.0,16,,,,,,,,,,,,,,,,,,,805ms,285ms,,101ms,554ms,,,,,,
1.96,1.96,felis-way,1,1362552675,64M,,,,31864,67,12645,34,,,33142,45,117.7,19,,,,,,,,,,,,,,,,,,,27761us,197ms,,25956us,532ms,,,,,,

Really hoping to get some openwrt supported routers with usb 3.0 ports soon.

tului wrote:

Really hoping to get some openwrt supported routers with usb 3.0 ports soon.

As I wrote earlier, the transfer speeds are limited to CPU, not data bus. And you can see IO speed of the only USB 3.0 router in the wiki page is not higher than 2.0
With a faster CPU and more memory things may change though.

Some routers with a tablet OMAP 5xxx CPU and USB 3.0 then :-P

tului wrote:

Some routers with a tablet OMAP 5xxx CPU and USB 3.0 then :-P

Or a Snapdragon 600, any of the high end SoCs out now. I'd really like to see an beaglebone or raspberry Pi type device(with a bit beefier CPU) and a built in 4 or 5 port switch that supports VLAN and jumbo packets.

Kickstarter anyone?

The discussion might have continued from here.