Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve table performance by caching 'Total Rows' using a hash #4989

Closed
TheWitness opened this issue Nov 6, 2022 · 3 comments
Closed

Improve table performance by caching 'Total Rows' using a hash #4989

TheWitness opened this issue Nov 6, 2022 · 3 comments
Labels
enhancement General tag for an enhancement resolved A fixed issue
Milestone

Comments

@TheWitness
Copy link
Member

Feature Request

Is your feature request related to a problem? Please describe

On large systems where there can be millions of rows, it's important not to have to continually calculate the number of total rows as this will slow down the Graphical User Environment.

Describe the solution you'd like

Instead, cache these values until the number of objects for the particular cache item changes. This is specifically important for objects like:

  • Graphs
  • Data Sources
  • Devices

Additional context

We should build the API, and then implement in the permission functions, and then publish the API for plugin developers.

@TheWitness TheWitness added the enhancement General tag for an enhancement label Nov 6, 2022
@TheWitness TheWitness added this to the v1.2.23 milestone Nov 6, 2022
@TheWitness TheWitness changed the title Cacti 'Total Rows' by Hash to Improve Performance Cache Cacti 'Total Rows' by Hash to Improve Performance Nov 6, 2022
TheWitness added a commit that referenced this issue Nov 6, 2022
Cache Cacti 'Total Rows' by Hash to Improve Performance
@TheWitness TheWitness added the resolved A fixed issue label Nov 6, 2022
TheWitness added a commit that referenced this issue Nov 7, 2022
* When performing maintenance, remove old rows from the row cache
* When removing a user, make sure you remove their old data.
TheWitness added a commit that referenced this issue Nov 7, 2022
* If you are calling "is_device_allowed()" don't cache the row counter
* Switch from $host_id to $device_id
@TheWitness
Copy link
Member Author

Outstanding issues:

  • Graph Permission changes should invalidate Graph rows cache for the user.
  • Ensure Poller Item has a cache entry for Utilities.
  • Ensure that is_object_allowed() calls doe not get cached.

TheWitness added a commit that referenced this issue Nov 7, 2022
* Don't cache on is_graph_template_allowed() calls.
@TheWitness
Copy link
Member Author

Covered is_graph_template_allowed. is_tree_allowed() is not impacted.

TheWitness added a commit that referenced this issue Nov 8, 2022
@TheWitness
Copy link
Member Author

Still making some changes here.

TheWitness added a commit that referenced this issue Nov 20, 2022
Add device caching options for changing state
@netniV netniV changed the title Cache Cacti 'Total Rows' by Hash to Improve Performance Improve table performance by caching 'Total Rows' using a hash Dec 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement General tag for an enhancement resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

1 participant