Skip to content

Commit 2ef93c5

Browse files
Fix rsyslogd memory growth in syncd swss containers
Signed-off-by: Hemanth Kumar Tirupati <[email protected]>
1 parent b0dd6a2 commit 2ef93c5

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

files/scripts/swss.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ TSA_TSB_SERVICE="startup_tsa_tsb.service"
1414

1515
function debug()
1616
{
17-
/usr/bin/logger $1
17+
# Use --id=$$ so all messages from this script share the parent shell's PID,
18+
# preventing rsyslog imuxsock ratelimiter memory growth.
19+
/usr/bin/logger --id=$$ -- "$1"
1820
/bin/echo `date` "- $1" >> ${DEBUGLOG}
1921
}
2022

files/scripts/syncd_common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
function debug()
1717
{
18-
/usr/bin/logger $1
18+
# Use --id=$$ so all messages from this script share the parent shell's PID,
19+
# preventing rsyslog imuxsock ratelimiter memory growth.
20+
/usr/bin/logger --id=$$ -- "$1"
1921
/bin/echo `date` "- $1" >> ${DEBUGLOG}
2022
}
2123

platform/mellanox/docker-syncd-mlnx/phcsync.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ while :; do
6060

6161
if [[ "$clock_name" != "mlx5_ptp" ]]; then
6262
# set CLOCK_REALTIME
63-
"$PHC_CTL" "$dev" set 2>/dev/null
63+
# Keep successful syncs silent to avoid rsyslogd ratelimit memory issue due to PID churn.
64+
"$PHC_CTL" -q -Q "$dev" set >/dev/null
6465
PHC_CTL_EXIT_CODE=$?
6566
if [[ $PHC_CTL_EXIT_CODE -ne 0 ]]; then
6667
echo "Error: Failed to sync clock for $dev (phc_ctl exit code: $PHC_CTL_EXIT_CODE)" >&2

0 commit comments

Comments
 (0)