From 8727ae5c323d99e53dddcf84102372abced94568 Mon Sep 17 00:00:00 2001 From: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Date: Wed, 17 Nov 2021 17:57:18 -0800 Subject: [PATCH] [flex counter] Flex counter threads consume too much CPU resources #9202 (#2031) * [flex counter] Flex counter threads consume too much CPU resources #9202 1. water thread flex counter will consume many cpu resouces on some platforms. change the default interval for those counters from 10 seconds to 60 seconds to workaround this issue. The performance issue of flex counter read need to be addressed separately, this is just a workaround. if it needs smaller granulatiry, the interval could be adjusted through CLI under SONIC shell. counterpoll * Increase the buffer pool watermark interval from 10 seconds to 60 seconds --- orchagent/bufferorch.cpp | 2 +- orchagent/portsorch.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/orchagent/bufferorch.cpp b/orchagent/bufferorch.cpp index 436926eb91bc..fce79fca3b08 100644 --- a/orchagent/bufferorch.cpp +++ b/orchagent/bufferorch.cpp @@ -18,7 +18,7 @@ extern sai_buffer_api_t *sai_buffer_api; extern PortsOrch *gPortsOrch; extern sai_object_id_t gSwitchId; -#define BUFFER_POOL_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "10000" +#define BUFFER_POOL_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "60000" static const vector bufferPoolWatermarkStatIds = diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 23b72dd0612c..0e3535393a6b 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -63,8 +63,8 @@ extern string gMyAsicName; #define PORT_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS 1000 #define PORT_BUFFER_DROP_STAT_POLLING_INTERVAL_MS 60000 #define QUEUE_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS 10000 -#define QUEUE_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "10000" -#define PG_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "10000" +#define QUEUE_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "60000" +#define PG_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "60000" #define PG_DROP_FLEX_STAT_COUNTER_POLL_MSECS "10000" #define PORT_RATE_FLEX_COUNTER_POLLING_INTERVAL_MS "1000"