Throttling Debug Messages
When using the default logging module, debug messages will appear in the paniclog
depending on subsystem and level settings configured in Debug_Flags. Debug_Flags is
usually empty, so very few events are written to the paniclog. However, under certain circumstances, you need to get more
information about some subsystem's behavior (e.g., SMTP), then by setting Debug_Flags, you can enable more verbose logging
into paniclog. On the other hand, depending on the chosen level, paniclog may get populated with several lines of the same
message, including some that might not be of your interest.
Momentum’s debug throttling configuration allows you to suppress repeated debug messages. The throttle suppresses the logging of repeated messages beyond a specified limit during a time interval also specified. It is a global setting that applies to messages of all subsystems.
NOTE: Debug throttling global configuration DOES NOT apply to messages logged at the
CRITICAL,ERROR, orWARNINGlevels of any subsystem, due to their relevance for operation and diagnosis.
It is important to note that debug throttling is applied not necessarily to identical messages, but to messages that are considered the same after removing variable parts such as timestamps, IP addresses, or other dynamic content. In other words, if the source of the message is something like this:
<timestamp> Message received from: <mailfrom>
then all messages that match this pattern will be considered the same for throttling purposes, regardless of the actual
values of <timestamp> and <mailfrom>. This happens because the default logging module is based on printf-style
format strings, which allows variable content in log messages, and it is the format string that determines message sameness.
WARNING: Be cautious when enabling debug throttling, as it may cause some performance overhead due to the additional processing required to track and suppress repeated messages.
Configuration options
Debug throttling is configured using the following options in the global scope of your ecelerity.conf file:
- debug_throttle_max_num_same_message
- debug_throttle_period_secs
Maximum number of the same message
Name
debug_throttle_max_num_same_message
Description
Sets the maximum number of repeated debug messages to log within a specified time interval. The default is 0, which means no
throttling is applied to the logging of repeated debug messages.
Example
debug_throttle_max_num_same_message = 5
With this configuration, if the same debug message occurs 20 times within the time interval specified by debug_throttle_period_secs,
only the first 5 instances will be logged. The remaining 15 messages are suppressed.
Time interval of throttling
Name
debug_throttle_period_secs
Description
Sets the time interval in seconds during which repeated debug messages are counted for throttling purposes.
The counters are reset when starting a new interval. The default is 1 second, with a maximum of 60 seconds.
Example
debug_throttle_period_secs = 30
With this configuration, the time interval for counting repeated debug messages is set to 30 seconds. Combined with the
previous example for debug_throttle_max_num_same_message, up to 5 lines of the same debug message will be logged every
30 seconds. After that, the counter resets and other 5 instances can be logged during the next 30-second window.
Scope
Debug throttling options are valid in the global scope.