Skip to content

Conversation

@GauravNagesh
Copy link
Contributor

Description

This PR introduces optimizations for Redis database operations through conditional field updates for the psud.

Conditional field Updates - PsuStatus class already has methods and stores vital information needed to detect when any PSU info fields change. We use this to our benefit to only write those fields which frequently change like the temp, voltage, current, power, etc while only occasionally writing fields which rarely change during daemon run like model number, serial number, revision, presence, status, is_replaceable and threshold levels

Additionally, existing tests were updated to include above change changes and to mock the FieldValuePairs constructor.

  1. test_power_threshold Updates
  • PSU power down scenario
  • PSU power up scenario
  • PSU absent scenario
  • PSU present scenario
  • Threshold invalid scenarios
  1. _construct_expected_fvp Updates - Helps accurately create the expected_fvp objects based on conditional field inclusion logic to help verify the Redis payload field.

Motivation and Context

Why Conditional field Updates :
Every 3 seconds the daemon writes full PSU info to Redis even though much of the information rarely changes like the model number, serial number, revision, presence, status, is_replaceable and threshold levels which is adding to unnecessary traffic to Redis. Rather we can write these fields only when a presence change is detected while always writing the frequently changing fields like temp, voltage, current, power, etc to ensure updated info stays in Redis.
No additional changes is required as all info needed for detecting change in already part of PsuStatus object.

Overall benefit :

  • Reduced Redis traffic in the system by writing only on change
    Before, roughly 18 fields written to Redis every 3 seconds per PSU
    After roughly 8-9 frequently-changing fields + conditional fields only when changed
    Estimated Reduction of approximately 45-50% reduction in Redis write payload volume under steady state

How Has This Been Tested?

The changes were tested locally on both virtual and physical platforms.

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants