Ticket #54 (closed enhancement: fixed)
Performance in SNMP when printer is down
Reported by: | bse | Owned by: | jerome |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | pykota | Version: | development |
Keywords: | Cc: |
Description
When a printer is down, or in a error state that needs manual intervention, the SNMP requests can eat a lot of CPU (the latest patch to snmp.py made it much better though)
In this situation, it is often not that important to poll every second, since someone has to go to the printer anyway, and this can take at least minutes, often hours (or days).
By adding a larger delay in this situation, the load on the server is reduced.
I made the change by multiplying the delay, it would be much nicer to use a configuration variable from pykota.conf instead.
//Bse
diff snmp_designjet.py.work.with_extra_sleepdelay snmp_designjet.py.work.without_extra_sleepdelay
217c217,221
< time.sleep(statusstabilizationdelay)
---
dstatusAsString = deviceStatusValues.get(self.deviceStatus)
if ( self.checkIfError(self.printerDetectedErrorState) or (dstatusAsString == 'down')) :
time.sleep(statusstabilizationdelay * 15)
else :
time.sleep(statusstabilizationdelay)
249c253,256
< time.sleep(statusstabilizationdelay)
---
if ( self.checkIfError(self.printerDetectedErrorState) or (dstatusAsString == 'down')) :
time.sleep(statusstabilizationdelay * 15)
else :
time.sleep(statusstabilizationdelay)