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: Mark Feit <>
  • To: "Yamamoto, Miguel" <>, "" <>
  • Subject: Re: [perfsonar-user] Limit TCP Throughput Bandwidth to 500Mb
  • Date: Tue, 12 Mar 2024 23:08:09 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=internet2.edu; dmarc=pass action=none header.from=internet2.edu; dkim=pass header.d=internet2.edu; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KysgKpbCO+7V31jLxH4hevKu6YsnDzSIVZU+s0JBfPk=; b=ccB5HaCaD/LLfLrf/A/koweahhrN54mEABH7dqGJSmC0/KnJ8iHnR3fbwzBn4noEPMTp3F6Uu/x2ueubHMpC7CeYzi/yzklJHB/KU7KPwiomws9GiviIYUb10D7+8JXWo2GECL9TASuGaWqNoZOqhD8VcGDkWAYupIu9ay6+oFF9vyCj1BOLrfehUfCvelUSs4ymVWhoRUeqUI8lBtMg3F/HiheXNCUJq1Mbe5IMXwJ+rhHFR1pLsegBqS9dHi+7XL8eHWFKs5CAqcxRUnMhVrDJiCtKVSwKT40EmkWvApeqhS+9wMTcgrtTiVc8loGaVMuFTgB+xqIC8wSnXZCr7w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lynxdoGEEKi4z6uWsew9DRIBMz8VVZIFoGoPp5hNMKrOocOchjk1fZgxjuxRKm9IP0n2ocwr7fLpfk3L4IQhg+SaQvNTm0V2PgDZcyUFCW6qlTu6cfZXqojeg2DE4MVBTVLoUrLTSSQmik3Kw3DqrtCdqdXDDDhucoT696wE3TGj6zbrUb5lvje5RjW9UXvM6p+hcijUxhu1pPxIPFbZqY+JzRmEltDY3aWAcCLdhaIaOxlcvQfxRgd2W0RAoXybu0CmNaA+Ni5jcC1AHIm8HTuWf9gufv3BwLMmWTBpc4qlpEnhcPLmllRIEj4BmrL3IFKqba3OZL/v7l8ipr7oNA==

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