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

Run Internet Speed Test (From Command Line) bypassing QoS?

Discussion in 'Tomato Firmware' started by cray54, Oct 14, 2013.

  1. cray54

    cray54 Reformed Router Member

    I'm working to setup some command line tests for internet / wan performance. I would like to run them remotely to determine when the DSL connection is having or beginning to have problems (as it currently has regularly).

    My current method is to sit outside of the building, connect to wifi, login to router, disable QoS, run various online speed-tests, enable QoS, and leave. This works... but it is starting to get cold outside.

    Thanks,
    Chris
     
  2. koitsu

    koitsu Network Guru Member

    I can't help you with writing the commands/rules, but you should be able to use tc temporarily to add an "exception" rule (i.e. overrides other QoS rules) based on certain criteria (ex. your MAC address), or Search Google for linux tc mac address for some tips. You will need to figure out how to get these to work with the TomatoUSB existing tc rules.

    Alternately you could issue a tc qdisc del dev XXX root command to completely delete a QoS association with a device (where the device name is XXX, e.g. vlan2, etc.). root in this case may be wrong too, I don't know what actual TomatoUSB QoS rules look like when used. When wanting to re-enable, I believe all you'd have to do is tc qdisc add dev XXX root {lots of other params}, but you'd need to know what all the other params are in advance.

    I have literally zero experience with QoS on Tomato/TomatoUSB, so I can't help otherwise, I'm sorry. I cannot help past this point.
     
  3. Porter

    Porter LI Guru Member

    cray54:
    So this DSL connection doesn't have constant bitrates over the day, but fluctuates a lot? Is that the reason why you constantly switch QoS off and on?

    You could probably use some elaborate ping-script to determine the saturation of the connection. The Gargoyle firmware has supposedly some kind of auto-QoS, so I would go looking there for inspiration.
     
  4. cray54

    cray54 Reformed Router Member

    At this time, I am only turning QoS off is to allow a link speed test. I just happen to be doing them fairly regularly since the service seems to be inconsistent at this time.

    I am really looking for a way to determine whether problems are local or with the DSL provider. Internet speed tests with QoS disabled is currently the most effective way for me to do that.

    Once I have a solution for testing the link speed through QoS, I'll experiment with tc as suggested.
     
  5. mvsgeek

    mvsgeek Addicted to LI Member

    Perhaps you could create a script containing something like this, and run it via scheduler at suitable intervals:

    service qos stop
    logger wget starting...
    wget -O /dev/null http://cachefly.cachefly.net/10mb.test
    logger wget ended
    service qos start

    You could then examine the log and calculate the bit rate from the wget message timestamps.
     
    Madumi and Victek like this.
  6. Feliciano

    Feliciano New Member Member

    I know this thread is old. However, I would like to calculate the speed. What I am doing is:
    Code:
    sss=`date | awk '{ print $4 }'`
    wget -O /dev/null 'put here the file to download'
    eee=`date | awk '{ print $4 }'`
    elap=$sss-$eee
    logger Time for downloading XMiB: $elap
    How can I subtract the timestamps to calculate the speed?
     
  7. cloneman

    cloneman Networkin' Nut Member

  8. Feliciano

    Feliciano New Member Member

    Yep, but I'm using my only USB port for a GDI printer, so I'm looking how to do this through a script. I am trying with "let" and some changes of variables...
     
    Last edited: Oct 23, 2017
  9. Monk E. Boy

    Monk E. Boy Network Guru Member

    You could always try a USB hub.
     
  10. Feliciano

    Feliciano New Member Member

    FWIW: I created a working script without need of using the valuable USB port. The main part is:
    Code:
    ini=`date | awk '{ print $4 }' | awk -F: '{ print $1*3600+$2*60+$3 }'`
    wget -O /dev/null 'put here the file to download'
    fin=`date | awk '{ print $4 }' | awk -F: '{ print $1*3600+$2*60+$3 }'`
    let tt=$fin-$ini
    let speed='size'*8388608/$tt/1000
    logger $speed"Kbps"
    Just be careful how often you ping or download, 'cause you may get blocked (it hapened to me).
     
    Last edited: Nov 1, 2017

Share This Page