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, \
|
from ispConfig import fqOrCAKE, upstreamBandwidthCapacityDownloadMbps, upstreamBandwidthCapacityUploadMbps, \
|
||||||
interfaceA, interfaceB, enableActualShellCommands, \
|
interfaceA, interfaceB, enableActualShellCommands, \
|
||||||
runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP
|
runShellCommandsAsSudo, generatedPNDownloadMbps, generatedPNUploadMbps, usingXDP, queuesAvailableOverride
|
||||||
|
|
||||||
def shell(command):
|
def shell(command):
|
||||||
if enableActualShellCommands:
|
if enableActualShellCommands:
|
||||||
@ -78,13 +78,17 @@ def tearDown(interfaceA, interfaceB):
|
|||||||
def findQueuesAvailable():
|
def findQueuesAvailable():
|
||||||
# Find queues and CPU cores available. Use min between those two as queuesAvailable
|
# Find queues and CPU cores available. Use min between those two as queuesAvailable
|
||||||
if enableActualShellCommands:
|
if enableActualShellCommands:
|
||||||
queuesAvailable = 0
|
if queuesAvailableOverride == 0:
|
||||||
path = '/sys/class/net/' + interfaceA + '/queues/'
|
queuesAvailable = 0
|
||||||
directory_contents = os.listdir(path)
|
path = '/sys/class/net/' + interfaceA + '/queues/'
|
||||||
for item in directory_contents:
|
directory_contents = os.listdir(path)
|
||||||
if "tx-" in str(item):
|
for item in directory_contents:
|
||||||
queuesAvailable += 1
|
if "tx-" in str(item):
|
||||||
print("NIC queues:\t\t\t" + str(queuesAvailable))
|
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()
|
cpuCount = multiprocessing.cpu_count()
|
||||||
print("CPU cores:\t\t\t" + str(cpuCount))
|
print("CPU cores:\t\t\t" + str(cpuCount))
|
||||||
queuesAvailable = min(queuesAvailable,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.
|
# Add 'sudo' before execution of any shell commands. May be required depending on distribution and environment.
|
||||||
runShellCommandsAsSudo = False
|
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
|
# Bandwidth Graphing
|
||||||
bandwidthGraphingEnabled = True
|
bandwidthGraphingEnabled = True
|
||||||
influxDBurl = "http://localhost:8086"
|
influxDBurl = "http://localhost:8086"
|
||||||
|
Loading…
Reference in New Issue
Block a user