mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-22 08:16:25 -06:00
Merge pull request #122 from rchac/setqueues
Allow operator to override number of queues / CPU cores utilized.
This commit is contained in:
commit
241ef4ccda
@ -20,7 +20,7 @@ import binpacking
|
||||
|
||||
from ispConfig import fqOrCAKE, upstreamBandwidthCapacityDownloadMbps, upstreamBandwidthCapacityUploadMbps, \
|
||||
interfaceA, interfaceB, enableActualShellCommands, \
|
||||
runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP
|
||||
runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP, queuesAvailableOverride
|
||||
|
||||
def shell(command):
|
||||
if enableActualShellCommands:
|
||||
@ -78,13 +78,17 @@ 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))
|
||||
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))
|
||||
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)
|
||||
|
@ -31,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"
|
||||
|
Loading…
Reference in New Issue
Block a user