Skip to content

Commit 8727ae5

Browse files
authored
[flex counter] Flex counter threads consume too much CPU resources sonic-net#9202 (sonic-net#2031)
* [flex counter] Flex counter threads consume too much CPU resources sonic-net#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
1 parent 103fdf0 commit 8727ae5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

orchagent/bufferorch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern sai_buffer_api_t *sai_buffer_api;
1818
extern PortsOrch *gPortsOrch;
1919
extern sai_object_id_t gSwitchId;
2020

21-
#define BUFFER_POOL_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "10000"
21+
#define BUFFER_POOL_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "60000"
2222

2323

2424
static const vector<sai_buffer_pool_stat_t> bufferPoolWatermarkStatIds =

orchagent/portsorch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ extern string gMyAsicName;
6363
#define PORT_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS 1000
6464
#define PORT_BUFFER_DROP_STAT_POLLING_INTERVAL_MS 60000
6565
#define QUEUE_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS 10000
66-
#define QUEUE_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "10000"
67-
#define PG_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "10000"
66+
#define QUEUE_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "60000"
67+
#define PG_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS "60000"
6868
#define PG_DROP_FLEX_STAT_COUNTER_POLL_MSECS "10000"
6969
#define PORT_RATE_FLEX_COUNTER_POLLING_INTERVAL_MS "1000"
7070

0 commit comments

Comments
 (0)