Skip to Content.
Sympa Menu

perfsonar-user - RE: [perfsonar-user] Limit TCP Throughput Bandwidth to 500Mb

Subject: perfSONAR User Q&A and Other Discussion

List archive

RE: [perfsonar-user] Limit TCP Throughput Bandwidth to 500Mb


Chronological Thread 
  • From: Brian Tehan <>
  • To: Mark Feit <>, "Yamamoto, Miguel" <>, "" <>
  • Subject: RE: [perfsonar-user] Limit TCP Throughput Bandwidth to 500Mb
  • Date: Wed, 13 Mar 2024 14:23:35 +0000

Miguel,

 

I limit bandwidth with CLI commands like this:

 

pscheduler task --archive @/home/csnadmin/local_archive.json  --slip PT1H --sliprand --repeat-cron "48 0-5 * * *" throughput --source 162.127.1.85 --dest 162.127.1.1 --duration PT30S --bandwidth 3221225472 --ip-version 4 --omit PT5S

 

Hope that helps.

 

Brian Tehan (he/him/his)

Regional Network Engineer

University of Nebraska System

EAB009 6001 Dodge St

Omaha, NE 68182-0051

Office: (402) 554-6428

university of nebraska logo lockup with campuses

 

 

From: <> On Behalf Of Mark Feit
Sent: Tuesday, March 12, 2024 6:08 PM
To: Yamamoto, Miguel <>;
Subject: Re: [perfsonar-user] Limit TCP Throughput Bandwidth to 500Mb

 

Caution: Non-NU Email

 

Yamamoto, Miguel writes:

 

I was wondering how to limit the TCP Throughput Bandwidth of a 1G to just be 500Mb. This is what I have so far (taken from perfSonar documentation:

 

The good news for you and the bad news for me is that there’s a mistake in the documentation that’s been there since 2018.  The bandwidth parameter of the throughput test is an integer in bits per second rather than a string with an SI suffix.  The CLI takes numbers with SI suffixes as a convenience.  I’ve corrected that and the next feature release will reflect it.  Sorry to have given you a bum steer.  :-)

 

In the first limit, I’ve corrected what you sent to reflect what the docs should have said:

 

{

    "name": "throughput-low-bandwidth",

    "description": "Limit throughput test bandwidth",

    "type": "jq",

    "data": {

        "script": [

            "500000000 as $max_bandwidth",

            "| if .type == \"throughput\" and .spec.bandwidth > $max_bandwidth",

            "  then",

            "    \"Bandwidth is limited to \\($max_bandwidth)\"",

            "  else true",

            "  end"

        ]

    }

}

Note that this will still allow any test where a bandwidth is not specified, which could run faster than that.  You can add some additional logic to also reject tests where .spec.bandwidth is null (unspecified).

 

The second one looks like a limit but has script intended for the rewriter, which is a different part of the limit configuration and works in a different context as far as what’s provided and what functions (like change()) are available to call.  That said, the syntax error in what you sent is in the line that says  if .test.spec. == true; there can’t be a trailing dot there.   Using  the rewriter is the way to go if you want to still allow tests but modify them so they don’t run any faster than your preferred number.  The only down side is that people might not check the diagnostics and see that the speed was limited and go looking for a 500M-wide bottleneck in the network someplace.

 

We’ve done some Webinars that are available on YouTube that might be useful to you:

 

At about 1:04:00 in the jq tutorial, there’s a brief discussion about the rewriter.  I believe what we have in the docs on that to be substantially complete and correct as well.

 

Hope that helps.

 

--Mark

 

 




Archive powered by MHonArc 2.6.24.

Top of Page