Ticket #54 (closed enhancement: fixed)

Opened 15 years ago

Last modified 15 years ago

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)

Change History

Changed 15 years ago by jerome

  • status changed from new to accepted

Changed 15 years ago by jerome

  • status changed from accepted to closed
  • resolution set to fixed

(In [3530]) Removed gettext marker for debugging messages.
Reworked bse's patch in order to fix #54 with suggestions from mhyclak.
This code is currently UNTESTED.

Note: See TracTickets for help on using tickets.