Skip to content

Commit

Permalink
[flex counter] Flex counter threads consume too much CPU resources so…
Browse files Browse the repository at this point in the history
…nic-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
  • Loading branch information
StormLiangMS authored Nov 18, 2021
1 parent 103fdf0 commit 8727ae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<sai_buffer_pool_stat_t> bufferPoolWatermarkStatIds =
Expand Down
4 changes: 2 additions & 2 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 8727ae5

Please sign in to comment.