From 239763f2f5f1fddb66e124291fcc89018b0493e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Mon, 26 Sep 2022 18:28:33 -0600 Subject: [PATCH 1/6] Update LibreQoS.py --- v1.2/LibreQoS.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/v1.2/LibreQoS.py b/v1.2/LibreQoS.py index b8fa8473..3ced00a1 100755 --- a/v1.2/LibreQoS.py +++ b/v1.2/LibreQoS.py @@ -20,7 +20,7 @@ import binpacking from ispConfig import fqOrCAKE, upstreamBandwidthCapacityDownloadMbps, upstreamBandwidthCapacityUploadMbps, \ interfaceA, interfaceB, enableActualShellCommands, \ - runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP + runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP, queuesAvailable def shell(command): if enableActualShellCommands: @@ -78,16 +78,16 @@ def tearDown(interfaceA, interfaceB): def findQueuesAvailable(): # Find queues and CPU cores available. Use min between those two as queuesAvailable if enableActualShellCommands: - queuesAvailable = 0 - path = '/sys/class/net/' + interfaceA + '/queues/' - directory_contents = os.listdir(path) - for item in directory_contents: - if "tx-" in str(item): - queuesAvailable += 1 - print("NIC queues:\t\t\t" + str(queuesAvailable)) - cpuCount = multiprocessing.cpu_count() - print("CPU cores:\t\t\t" + str(cpuCount)) - queuesAvailable = min(queuesAvailable,cpuCount) + #queuesAvailable = 0 + #path = '/sys/class/net/' + interfaceA + '/queues/' + #directory_contents = os.listdir(path) + #for item in directory_contents: + # if "tx-" in str(item): + # queuesAvailable += 1 + #print("NIC queues:\t\t\t" + str(queuesAvailable)) + #cpuCount = multiprocessing.cpu_count() + #print("CPU cores:\t\t\t" + str(cpuCount)) + #queuesAvailable = min(queuesAvailable,cpuCount) print("queuesAvailable set to:\t" + str(queuesAvailable)) else: print("As enableActualShellCommands is False, CPU core / queue count has been set to 16") From c40dbe16e9ce8749d56ac5779406434fe6325783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Mon, 26 Sep 2022 18:28:56 -0600 Subject: [PATCH 2/6] Update ispConfig.example.py --- v1.2/ispConfig.example.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v1.2/ispConfig.example.py b/v1.2/ispConfig.example.py index b0e8db43..abc61757 100644 --- a/v1.2/ispConfig.example.py +++ b/v1.2/ispConfig.example.py @@ -4,6 +4,8 @@ # fqOrCAKE = 'fq_codel' fqOrCAKE = 'cake diffserv4' +queuesAvailable = 16 + # How many Mbps are available to the edge of this network upstreamBandwidthCapacityDownloadMbps = 1000 upstreamBandwidthCapacityUploadMbps = 1000 From 51a64904ed4602bf834fc06e85976ade925a483e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Tue, 27 Sep 2022 07:00:02 -0600 Subject: [PATCH 3/6] Update ispConfig.example.py --- v1.2/ispConfig.example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v1.2/ispConfig.example.py b/v1.2/ispConfig.example.py index abc61757..f161432e 100644 --- a/v1.2/ispConfig.example.py +++ b/v1.2/ispConfig.example.py @@ -4,7 +4,7 @@ # fqOrCAKE = 'fq_codel' fqOrCAKE = 'cake diffserv4' -queuesAvailable = 16 +queuesAvailableOverride = 0 # How many Mbps are available to the edge of this network upstreamBandwidthCapacityDownloadMbps = 1000 From ed2d5c61cb4987f3aaa0b7fa49c7d8b18cf7db0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Tue, 27 Sep 2022 07:02:11 -0600 Subject: [PATCH 4/6] Update LibreQoS.py --- v1.2/LibreQoS.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/v1.2/LibreQoS.py b/v1.2/LibreQoS.py index 3ced00a1..b4033e32 100755 --- a/v1.2/LibreQoS.py +++ b/v1.2/LibreQoS.py @@ -20,7 +20,7 @@ import binpacking from ispConfig import fqOrCAKE, upstreamBandwidthCapacityDownloadMbps, upstreamBandwidthCapacityUploadMbps, \ interfaceA, interfaceB, enableActualShellCommands, \ - runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP, queuesAvailable + runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP, queuesAvailableOverride def shell(command): if enableActualShellCommands: @@ -78,16 +78,19 @@ def tearDown(interfaceA, interfaceB): def findQueuesAvailable(): # Find queues and CPU cores available. Use min between those two as queuesAvailable if enableActualShellCommands: - #queuesAvailable = 0 - #path = '/sys/class/net/' + interfaceA + '/queues/' - #directory_contents = os.listdir(path) - #for item in directory_contents: - # if "tx-" in str(item): - # queuesAvailable += 1 - #print("NIC queues:\t\t\t" + str(queuesAvailable)) - #cpuCount = multiprocessing.cpu_count() - #print("CPU cores:\t\t\t" + str(cpuCount)) - #queuesAvailable = min(queuesAvailable,cpuCount) + if queuesAvailableOverride == 0: + queuesAvailable = 0 + path = '/sys/class/net/' + interfaceA + '/queues/' + directory_contents = os.listdir(path) + for item in directory_contents: + if "tx-" in str(item): + queuesAvailable += 1 + print("NIC queues:\t\t\t" + str(queuesAvailable)) + cpuCount = multiprocessing.cpu_count() + print("CPU cores:\t\t\t" + str(cpuCount)) + queuesAvailable = min(queuesAvailable,cpuCount) + else: + queuesAvailable = queuesAvailableOverride print("queuesAvailable set to:\t" + str(queuesAvailable)) else: print("As enableActualShellCommands is False, CPU core / queue count has been set to 16") From bf5ced45a813a4d294319340de310ea974dcede4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Tue, 27 Sep 2022 08:38:22 -0600 Subject: [PATCH 5/6] Update LibreQoS.py --- v1.2/LibreQoS.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v1.2/LibreQoS.py b/v1.2/LibreQoS.py index b4033e32..b18f90b3 100755 --- a/v1.2/LibreQoS.py +++ b/v1.2/LibreQoS.py @@ -86,11 +86,12 @@ def findQueuesAvailable(): if "tx-" in str(item): queuesAvailable += 1 print("NIC queues:\t\t\t" + str(queuesAvailable)) - cpuCount = multiprocessing.cpu_count() - print("CPU cores:\t\t\t" + str(cpuCount)) - queuesAvailable = min(queuesAvailable,cpuCount) else: queuesAvailable = queuesAvailableOverride + print("NIC queues (Override):\t\t\t" + str(queuesAvailable)) + cpuCount = multiprocessing.cpu_count() + print("CPU cores:\t\t\t" + str(cpuCount)) + queuesAvailable = min(queuesAvailable,cpuCount) print("queuesAvailable set to:\t" + str(queuesAvailable)) else: print("As enableActualShellCommands is False, CPU core / queue count has been set to 16") From b5953ea80a12ca3be21605cc3d0fb1b28607ae3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Tue, 27 Sep 2022 09:11:53 -0600 Subject: [PATCH 6/6] Update ispConfig.example.py --- v1.2/ispConfig.example.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/v1.2/ispConfig.example.py b/v1.2/ispConfig.example.py index f161432e..269b94f1 100644 --- a/v1.2/ispConfig.example.py +++ b/v1.2/ispConfig.example.py @@ -4,8 +4,6 @@ # fqOrCAKE = 'fq_codel' fqOrCAKE = 'cake diffserv4' -queuesAvailableOverride = 0 - # How many Mbps are available to the edge of this network upstreamBandwidthCapacityDownloadMbps = 1000 upstreamBandwidthCapacityUploadMbps = 1000 @@ -33,6 +31,9 @@ enableActualShellCommands = True # Add 'sudo' before execution of any shell commands. May be required depending on distribution and environment. runShellCommandsAsSudo = False +# Allows overriding queues / CPU cores used. When set to 0, the max possible queues / CPU cores are utilized. Please leave as 0. +queuesAvailableOverride = 0 + # Bandwidth Graphing bandwidthGraphingEnabled = True influxDBurl = "http://localhost:8086"