You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: system/syslog-msg-intf-name-xlate-HLD.md
+29-10
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Syslog Message Interface Name Translation
5
5
6
6
# High Level Design Document
7
7
8
-
#### Rev 0.7
8
+
#### Rev 0.8
9
9
10
10
# Table of Contents
11
11
@@ -34,6 +34,7 @@ Syslog Message Interface Name Translation
34
34
| 0.5 | 08/03/2020 | Greg Paussa | Handle non-base breakout port alias name variations. Special-case master port references in log messages. |
35
35
| 0.6 | 08/12/2020 | Greg Paussa | Use STATE_DB update to indicate DPB change instead of CONFIG_DB. |
36
36
| 0.7 | 08/24/2020 | Greg Paussa | Added disclaimer for DPB log message translations in Section 1.1. |
37
+
| 0.8 | 09/03/2020 | Greg Paussa | Added a note regarding an inband log message as a faster alternative to SIGHUP for reloading tables. Added Section 3.6.5 describing system resource usage. |
37
38
38
39
# About this Manual
39
40
@@ -78,6 +79,9 @@ A high-level view of the operation:
78
79
79
80
5. The localhost rsyslogd is not state-aware of any context from which a syslog message is originated.
80
81
82
+
### A Note About SIGHUP Usage
83
+
84
+
This document mentions using the SIGHUP signal to notify the rsyslogd process to reload its translation tables from files. While this works and is a valid way to reload the tables, experimentation has shown that there is a quicker way to do this by sending a special log message to rsyslog that is detected by an rsyslog configuration rule and calls reload_lookup_table() as its action. This special inband log message can be discarded. From a design perspective these two techniques are equivalent, however the implementation can use either one.
- A change in the interface-naming mode *does* require restarting the rsyslog service.
276
280
- This is a rather significant, yet infrequent, config event in the system.
277
281
- It allows the /etc/rsyslog.conf file to be rewritten to add/remove the lookup table operation.
278
-
- A change in DPB configuration only requires issuing a SIGHUP signal to the rsyslog process to force a reload of the lookup table (when in use).
282
+
- A change in DPB configuration only requires that the rsyslog process reload its lookup table (SIGHUP signal or special inband log message) when in use.
279
283
- The rsyslog process remains operational and is not restarted.
280
284
- Much faster: approximately 0.5 msec for SIGHUP vs. 30 msec for rsyslog service restart.
281
-
- The implementation can trigger the SIGHUP as soon as DPB signals via the STATE_DB that the current breakout transaction has reached a certain point, which is after the old ports have been deleted, but before the new ports are created.
285
+
- The implementation can initiate the lookup table rebuild and reload as soon as DPB signals via the STATE_DB that the current breakout transaction has reached a certain point, which is after the old ports have been deleted, but before the new ports are created.
282
286
- The subsequent translation table update can proceed, since it does not rely on any CONFIG_DB PORT table updates, which may occur asynchronously.
283
287
284
288
@@ -317,15 +321,15 @@ The rsyslog service running in the switch host environment is where the interfac
317
321
- Then continues running as a daemon, subscribing to relevant CONFIG_DB and STATE_DB changes.
318
322
- Once the new rsyslog JSON files are created, the rsyslog-config.py script either:
319
323
- (Re)generates the rsyslog.conf file and restarts the rsyslog service, or
320
-
- Reloads just the mapping table from the rsyslog_port_aliases.json file via a SIGHUP signal.
321
-
- For example:
324
+
- Reloads just the mapping table from the rsyslog_port_aliases.json file via a SIGHUP signal or special inband log message.
2. The /etc/rsyslog.conf file is dynamically generated from a jinja2 template using elements from the CONFIG_DB DEVICE_METADATA|localhost configuration.
@@ -354,7 +358,7 @@ The expectation is that a given device's platform.json file contains a single ma
354
358
355
359
DPB related configuration changes do *not* require a system reboot or config reload, therefore the rsyslog translation table must be updated whenever a change in port breakout mode is detected in the STATE_DB PORT_BREAKOUT table (only interested in base port DPB status changes). The current breakout mode can be read from the CONFIG_DB BREAKOUT_CFG table 'brkout_mode' attribute listed for the base port.
356
360
357
-
For the base ports, their standard alias name is determined by reading the first 'alias_at_lanes' entry in their platform.json definition, subject to the following modification: if the port supports breakout, but is currently not broken out, then the trailing "/<breakout_port> part of the alias name is removed. Once the new translation table JSON file is built, a SIGHUP signal is used to tell rsyslog to reload its lookup table from the JSON file without restarting the process.
361
+
For the base ports, their standard alias name is determined by reading the first 'alias_at_lanes' entry in their platform.json definition, subject to the following modification: if the port supports breakout, but is currently not broken out, then the trailing "/<breakout_port> part of the alias name is removed. Once the new translation table JSON file is built, rsyslog is told to reload its lookup table from the JSON file (SIGHUP or special inband log message) without restarting the process.
358
362
359
363
360
364
### 1.2.1.2 Systemd Journal Remains Untranslated
@@ -398,7 +402,6 @@ Platforms that support standard interface naming mode.
398
402
399
403
400
404
401
-
402
405
**TBD
403
406
404
407
@@ -526,12 +529,28 @@ The rsyslog service in the localhost Debian environment is where interface name
526
529
- config reload
527
530
- interface naming mode config change
528
531
529
-
The rsyslog service will simply reload its translation table upon receipt of a SIGHUP signal for the following:
532
+
The rsyslog service will simply reload its translation table (SIGHUP signal or special inband log message) for the following:
530
533
531
534
- DPB config change
532
535
533
536
The rsyslog-config service creates the rsyslog configuration prior to (re)starting the rsyslog service. It is restarted during cold boot, warm boot, and config reload along with the rest of the system. The rsyslog-config service runs as a daemon process in the localhost environment.
534
537
538
+
### 3.6.5 Resource Usage
539
+
540
+
Interface name translation by the rsyslog service requires some translation tables and additional rules in the rsyslog.conf configuration. Although exact numbers can vary, the following incremental resource usage was observed with ```top``` on a vSONIC VS device while running in standard naming mode as compared to native mode:
541
+
542
+
- CPU Utilization: +1% (approximately)
543
+
- Memory: +80 MB
544
+
545
+
The CPU utilization was measured while sending 10000 logger messages from the swss Docker (approximately 435 messages per second on this setup).
546
+
547
+
In addition, the rsyslog-config service is now a daemon process that consumes the following system resources:
548
+
549
+
- CPU Utilization: 0%
550
+
- Memory: 56 MB
551
+
552
+
The rsyslog-config daemon metrics are not affected by the current interface-naming mode.
0 commit comments