1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

USB Speed-up

Discussion in 'Tomato Firmware' started by Oleg Repin, Jan 30, 2012.

  1. Oleg Repin

    Oleg Repin Networkin' Nut Member

    OK, since USB hard drive is up and running for almost a week, I believe it is a good time to share my experience.

    My router is E3000, disk is Seagate FlexAgent GoFlex Desk 2TB USB3. But I think the tricks I am going to outline might also help with other hardware configurations.

    I started with stock Cisco firmware Rev. Beside other complains, I considered my USB disk speed being too slow. The disk performance was just 60 Mbps on upload and 36 Mbps on download operations for both Samba and FTP file transfer. My computer is connected to the router through 1 Gbps Ethernet and my Internet transfer speed was up-to 90 Mbps on download and 60 Mbps on upload operations. So I was sure that router to computer transfer speed is not an issue.

    A couple weeks ago I upgraded my router firmware to 7493 Toastman release. The results were quite disappointed. Firstly my USB speed dropped to 16 Mbit on Samba up/down transfer operations. After I played with some settings and eventually upgraded firmware to 7494 Toastman release, USB speed fell to 6.7/7.4 Mbps up/down and stubbornly stayed at this rate despite my attempts to do something with it.

    Then I left my router with connected USB drive running undisturbed for a half of day. When I checked the USB speed again, I discovered with amazement that it jumped to 15.7/41.3 Mbps on Samba transfer. After router reload the USB speed returned to the familiar 6.5/7.5 Mbps. That is why I realized that problem is neither with router hardware nor firmware, I just do something wrong or do not do something right. The following is what I discovered. All experiments were made with Toastman's tomato-E3000USB-NVRAM60K-1.28.7494.3MIPSR2-Toastman-RT-VPN.bin firmware.

    STEP1: Switch from USB1 to USB2

    Make sure that your USB device is connected with USB2 protocol (if your device is USB2/USB3 capable and router connector is USB2 capable, it does not mean that you actually use USB2!)

    If your USB device is not recognized while USB and NAS/USB Support/USB 1.1 Support option turned off, you have a great chance that your device is connected in USB1 mode. To make sure, open Tools/System page and type
    into Execute System Commands field and press Execute. You will see something like this:
    Find your USB device section (sections are separated with empty lines). In my case the required section includes lines
    Look at the first line of the section at the Spd= value. If it is Spd=12, then your device uses USB1 protocol. From the USB Introduction of The Linux USB sub-system by Brad Hards:
    What might you do about it? From the Linux USB Frequently Asked Questions by Stephen J. Gowdy and others:

    1. Enter USB and NAS/USB Support page, uncheck USB 1.1 Support checkbox and press Save button.

    2. Enter Administration/Scripts page, select Init field and type
    into editor area below Init and press Save button.

    3. Reboot your router with Reboot... field.

    4. After router reboot make sure (as I described above) that Spd= value of your USB device is set to Spd=480.

    5. Measure your USB device speed.

    In my case 6.7/7.4 Mbps on up/down operations increased to 15.7/41.3 Mbps for NTFS file system and 7.1/7.2 Mbps increased to 69.3/61.6 Mbps for Ext3.

    STEP2: Switch from NTFS to Ext3

    From NTFS-3G (Tomato currently uses this implementation of NTFS and, I believe, will use in the foreseeable future) article from Wikipedia:
    Both Wikipedia and Tuxera address NTFS-3G performance issues. Wikipedia:
    What might you do about it? Switch to the native Linux file system. According to the same Tuxera source, switching from NTFS to Ext3 gives you 4.5 times performance boost on write operations and 2.5 times on reads:


    1. Make sure that File System Support Ext2/Ext3 chekbox is ON at USB and NAS/USB Support configuration page.

    2. Remove your hard drive from the router and use your PC to reformat it to Ext3 file system. Router's fdisk works, but mkfs.ext3 does not. So, you should use your PC.

    a. If your PC is under Linux/Unix, use fdisk/mkfs.ext3.​

    b. If your PC is under Windows, I recommend to use MiniTool Partition Wizard Home Edition from MiniTool Solution Ltd (http://www.partitionwizard.com/free-partition-manager.html). It works and it is free!​

    c. I do not know what to use on Mac. :-(​

    3. Connect your drive to the router and measure its speed.

    In my case 15.7/41.3 Mbps on up/down operations increased to 69.3/61.6 Mbps after switch from NTFS to Ext3.
  2. Toastman

    Toastman Super Moderator Staff Member Member

    Oleg, nice article, this looks like the answer to this problem, which has been bugging people for a long time. Maybe we can finally fix this in the source code, any suggestions?

    Anyone else trying this, please report your findings!
  3. ntamas26

    ntamas26 Networkin' Nut Member

    I'm using Shibby's Tomato modifications and here are my speed measurements with an USB 3.0 WD hdd formatted to EXT3:
    (Asus RT-N16)

    -Shibby build05x-062 Samba file copy speeds approx. 4mbyte/sec
    -Shibby build05x-076V Samba file copy speeds approx. 7-7,5mbyte/sec (this was the fastest firmware according to my experience)
    -Shibby build05x-083V Samba file copy speeds approx. 6-6,5mbyte/sec

    Any Tomato Samba speed improvement would be great, as Atheros based routers posts much better speeds in this field.
  4. Oleg Repin

    Oleg Repin Networkin' Nut Member

    Hello, Toastman.
    Thank you for your warm words. It means much to me.
    At this moment it would be great to implement at least one feature: additional column to the Attached Devices table. It might be called Speed with just a copy of Spd= value from /proc/bus/usb/devices. This feature in many cases at least will allow you to give quick answer to the question "Why my stupid USB device is so slow?" :)

    Considering old_scheme_first=Y parameter, the situation is not so clear. At this moment we have only one confirmed case when two conditions meet simultaneously:
    1. USB device does not work without this parameter.
    2. The device works with it.
    May be two cases, since this option cures not just my Seagate disk, but also my Fat32 4GB SanDisk Cruzer USB stick. Anyway, I would like to have at least one more confirmation from somebody else before start to think on this subject.

    There are some other device/driver parameters like delay_use of usb_storage, inq_timeout of scsi_mod, allow_restart and max_sectors of sda, and probably many other, which might affect USB device recognition, plug-n-play and wake-up from power saving state behavior, and performance. I am still playing with them. May be some combination of them will better serve USB speed-up problem than old_scheme_first. Sorry, I do not know if I will have enough free time to finish this job.

    There is another direction of improvement of the USB behavior. It looks like Rev. 2.6.22 of Linux kernel appears right in the middle of the USB2 acceptance adventures. There is a chance that just update to later Linux kernel gives more in respect of USB stability and performance than playing with options of obviously outdated system. Has your Tomato team some ideas on this subject? OK, OK, I hold principal position in hi-tech Silicon Valley company, I know how painful this process might be. I am just asking. :)
  5. Toastman

    Toastman Super Moderator Staff Member Member

    Yep, as you probably guessed the version of kernel is dependent on the wireless drivers by Broadcom. Anyway, the info you gave will I'm sure will inspire further work on this.
  6. Oleg Repin

    Oleg Repin Networkin' Nut Member

    Hello, ntamas26.
    It looks like your best results (7-7,5mbyte/sec = 56-60 Mbps) match my measurements (62-69 Mbps). Actually it is very strange to see so many variations in the USB performance. I believe that USB implementation did not change for an epoch. Are you sure that there are no other factors that affect your data? For example, other network activity. I did not disable I-net connection (because did not notice any difference in results) while I played with USB, but I did something other.
    1. No network-active application runs on my PC but Web browser and telnet both connected to the router.
    2. I disabled performance counters, QoS, and wireless in Tomato, everything that could consume precious CPU resources of my router.

    There are also numerous factors which affect measurement results both in deterioration and improvement directions, like local file access time (if you use copy operation to measure performance) and lazywriting on both PC and router side. While PC factors might be bypassed with smart testing software, the only cure for the router deferred write can be huge transfer sizes. I hope to address this issue later in the special post.
    It looks like you have already put to use both approaches I described in my initial post. Sorry, at this moment I do not see much room for the speed improvement for you. I will let everybody know if will dig something new up.
    USB2 raw speed is 480 Mbps, the disk mentioned in my initial post connected to my PC provides 240 Mbps, E3000 gives you up-to 70 Mbps. So, any numbers in between are possible. Actually not many weak links left. My comparison Samba vs FTP (with FileZilla as client) does not give much: 62 Mbps on download with Samba vs 65 Mbps with FTP which, I believe, is implemented quite carefully. 5% increase. Effective implementation of file system (see Tuxera graph in my initial post) gives you another 10%. So, 70 Mbps + 15% = 80 Mbps. The rest are low-level modules usbcore, ehci_hcd, usb_storage, scsi_mod and USB hardware. Who of them takes 75% of the throughput I do not know. :-(
  7. tvlz

    tvlz Addicted to LI Member

    Found the way to set it in the code:D
    It is set in /src-rt/linux/linux-2.6/drivers/usb/core/hub.c#l120
  8. maurer

    maurer LI Guru Member

    guys, do you know that there is a trunk openwrt with kernel 3.2 available ?!
    if anyone has an available RT-N16/e3000/wrt610n_v2 and wants to check it out - at least for usb r/w perfromance...
    here are some recently compiled builds with kernel 3.0.18 http://openwrt.razvi.ro/attitude_adjustment_asus_rt-n16_svn_r30420/
    squashfs or any of the two jffs trx is good to go
    or you can compile it yourself with k3,2
  9. Dr Strangelove

    Dr Strangelove Networkin' Nut Member

    Linksys E4200 with a very old SanDisk U3 Titanium 1GB USB flash drive.
    Tomato Firmware v1.28.0495 MIPSR2-Toastman-RT-N K26 USB VPN

    From E4200 USB using cmd.exe ftp over 1Gb Ethernet to a 1TB WD Caviar blue using SATA 1.5GB interface(old PC) on Windows 7.

    ftp upload(write) 7649.81Kbytes/sec = ~61.192Mbps
    ftp download(read) 11253.59Kbytes/sec = ~90.024Mbps

    Pretty consistent using a 158MByte file over several read/write.

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
    D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
    P: Vendor=0781 ProdID=5408 Rev= 0.10
    S: Manufacturer=SanDisk Corporation
    S: Product=U3 Titanium
    S: SerialNumber=0000feedfeedfeedfeed
    C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
    E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
  10. tvlz

    tvlz Addicted to LI Member

  11. asterger

    asterger Network Guru Member

    Does the current Toastman 7500 build offer more USB throughput on an E3000 than stock Linksys firmware? If so, how much? On stock Linksys E3000 firmware currently see 3.05MB/sec. Need to increase this to get backups via USB port within backup window. Any additional quantitative information on SMB/Samba and USB throughput would be helpful.
  12. shibby20

    shibby20 Network Guru Member

    on E3000 you should be able to get ~7MB/s (ext2/3)
  13. shibby20

    shibby20 Network Guru Member

    do not use NTFS over router, because you will always have a 50% lower speed. If you don`t want ext2/3 filesystem, then use FAT32.
  14. shibby20

    shibby20 Network Guru Member

    no, 32GB it`s a limit of FAT32 system.

    If you want higher speed, you have to format as ext2 or ext3.
  15. M0g13r

    M0g13r LI Guru Member

  16. jeonny

    jeonny Serious Server Member

    usb transfer speed of my rt-n10u black., overclocked to 530 MHz :D Shibby build 108.

  17. philess

    philess Networkin' Nut Member

    32GB is not the limit of FAT32 system, but... usually Windows only shows the option to format it up to 32GB.
    Using other tools you can format larger partitions as FAT32.
  18. victor

    victor Network Newbie Member

    Hello Oleg,
    I am on ASUS RT-N16 Tomato Shibby 121. I have Spd=480 by default. I have Transmission P2P client on my router that downloaded a 4.7Gb (.mkv) file onto USB Trancend 16 Gb flash drive, attached to router and formatted as Ext2. My desctop runs Linux Mint 17. I see my Trancend 16 Gb flash drive as a directory shared on my LAN. When I downloaded that file from my router to my desktop, the speed was 1.6 Mb/sec. Please advise, what might be the reason! Thanks in advance!
    BTW I implemented your method - it didn't help me.

    Last edited: Oct 12, 2014
  19. motocrossmann

    motocrossmann Network Guru Member

    If anyone has an issue like this, be sure to try and plug your device directly into your router to see what speed it connects at. Long story short, my extension usb cable to my hub caused the usb stick to connect at USB1.1. When I plugged the hub directly into the router, it connected at USB2 speeds.
  20. Dreamcat4

    Dreamcat4 Network Newbie Member

    By this guide, we could also disable 'USB 2.0' for a USB 3 device. To prevent the USB 3 droping to 2.0 mode / speeds.


    On shibby/advanced tomato 1.28. When I disable USB 2.0 support. Then my usb3 enclosure device is not recognised. I have tried:

    root@tomato:/dev# echo -n Y >/sys/module/usbcore/parameters/old_scheme_first

    Which does not affect the outcome. Also: Speed=??

    root@tomato:/tmp/home/root# cat /proc/bus/usb/devices

    T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=?? MxCh= 1
    B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
    D: Ver= 3.00 Cls=09(hub ) Sub=00 Prot=03 MxPS= 9 #Cfgs= 1
    P: Vendor=1d6b ProdID=0003 Rev= 2.06
    S: Manufacturer=Linux xhci_hcd
    S: Product=xHCI Host Controller
    S: SerialNumber=0000:00:0c.0
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
    E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=12ms

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=?? MxCh= 0
    D: Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1
    P: Vendor=2537 ProdID=1066 Rev= 1.00
    S: Manufacturer=Norelsys
    S: Product=NS1066
    S: SerialNumber=0123456789ABCDE
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
    E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
    E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
    Last edited: May 25, 2015
  21. manufact

    manufact New Member Member

    my speed results of 1.5TB 2.5" USB HDD via USB 3.0 Port on R7000 Router:

    wirte speed 29MB/s (ext3)
    read speed 37MB/s (ext3)
    wirte speed 39MB/s (NTFS paragon)
    read speed 40MB/s (NTFS paragon)

    wirte speed 40MB/s
    read speed 44MB/s
    wirte speed 43MB/s (NTFS paragon)
    read speed 42MB/s (NTFS paragon)

    eventhough I have an USB 3.0 port my harddisk only gets mounted when I activate usb 2.0 support

    root@r7000:/tmp/home/root# cat /proc/bus/usb/devices

    T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=?? MxCh= 1
    B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
    D: Ver= 3.00 Cls=09(hub ) Sub=00 Prot=03 MxPS= 9 #Cfgs= 1
    P: Vendor=1d6b ProdID=0003 Rev= 2.06
    S: Manufacturer=Linux xhci_hcd
    S: Product=xHCI Host Controller
    S: SerialNumber=0000:00:0c.0
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
    E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=12ms

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=?? MxCh= 0
    D: Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1
    P: Vendor=174c ProdID=1153 Rev= 0.01
    S: Manufacturer=ASMedia
    S: Product=AS2115
    S: SerialNumber=00000000000000000000
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
    E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
    E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms

    Last edited: Feb 27, 2016
  22. DanGreen

    DanGreen New Member Member

    Like what tools?

    That's pretty good actually a speed up of 10-25% adds up pretty quick.
    Last edited: Sep 26, 2016
  23. bercerybry

    bercerybry Connected Client Member

    got the same problem as yours.

    I also got a weird speed test result

    upload to USB 3.0 disk is peaking at 20MB/s but download from NAS is like 6-8MB/s. What is going on?

Share This Page