ipdevpoll logging system uses too many resources

Bug #1023567 reported by Morten Brekkevold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
High
Morten Brekkevold

Bug Description

The ipdevpoll framework uses the ContextLogger in several classes to have simple access to logging with context information. The ContextLogger class is a Python descriptor that can search the current execution stack for context information, creating and caching a LoggerAdapter with this context when found.

The ContextLogger uses inspect.stack() to get the stack at the current point of execution, but this function does a lot more than just retrieve the current stack frames, it also retrieves meta-information and source code context from each frame. This stack inspection occurs very often in ipdevpoll, as most data container objects have lots of debug logging going on, and each collection job can create a huge amount of these containers.

Profiling of ipdevpoll reveals that as much as 30% of ipdevpoll's execution time is spent inspecting the call stack because of logging; this is ridiculous - logging should not have this kind of impact on a system, especially when there isn't any debug level logging going on.

This is a must fix! ContextLoggers were introduced in ipdevpoll in NAV 3.11.0, the latest version with this implementation being 3.11.5.

Changed in nav:
milestone: none → 3.11.6
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: In Progress → Fix Committed
Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.