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

Migrate CacheAPI #686 #687

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

tabishnaqvi1311
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Jul 15, 2023

Deploy Preview for moodledevdocs ready!

Name Link
🔨 Latest commit fac4371
🔍 Latest deploy log https://app.netlify.com/sites/moodledevdocs/deploys/656994dda4c97f000885382e
😎 Deploy Preview https://deploy-preview-687--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@sarjona sarjona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tabishnaqvi1311!
Thanks for migrating this page. I've raised a few things that should be reviewed/improved before merging it :-)
Let me know if there is anything I can do for helping you ;-)

docs/apis/subsystems/muc/index.md Outdated Show resolved Hide resolved
docs/apis/subsystems/muc/index.md Outdated Show resolved Hide resolved
docs/apis/subsystems/muc/index.md Outdated Show resolved Hide resolved
docs/apis/subsystems/muc/index.md Outdated Show resolved Hide resolved
docs/apis/subsystems/muc/index.md Outdated Show resolved Hide resolved

This is especially important if you are scaling up and down the number of frontends quickly. If you suddenly need more horizontal scale and create a bunch of new front ends with empty caches and no shared cache they will all consume even more resources warming up and loading the shared services such as the database and filesystem.

A good rule of thumb is to pair similar types of local and shared caches together. For instance it is very common to store the Moodle string cache in APCu because it is very heavily used, so an in-memory cache is the fastest and is well paired this a shared cache like Redis. coursemodinfo on the other hand is often very large so isn't as practical to store in Redis so it is usually cached on disk, so you could have a local file cache (which could often be very fast SSD) and pair it with a shared disk cache in dataroot (often much slower over NFS or Gluster etc).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A good rule of thumb is to pair similar types of local and shared caches together. For instance it is very common to store the Moodle string cache in APCu because it is very heavily used, so an in-memory cache is the fastest and is well paired this a shared cache like Redis. coursemodinfo on the other hand is often very large so isn't as practical to store in Redis so it is usually cached on disk, so you could have a local file cache (which could often be very fast SSD) and pair it with a shared disk cache in dataroot (often much slower over NFS or Gluster etc).
A good rule of thumb is to pair similar types of local and shared caches together. For instance, it is very common to store the Moodle string cache in APCu because it is very heavily used, so an in-memory cache is the fastest and is well paired this a shared cache like Redis. `coursemodinfo` on the other hand is often very large so isn't as practical to store in Redis so it is usually cached on disk, so you could have a local file cache (which could often be very fast `SSD`) and pair it with a shared disk cache in `dataroot` (often much slower over `NFS` or `Gluster` etc).


Another consideration is the total size of your cache stores across all the front ends. As cache keys change they are never be invalidated or purged. So you should have in place some process to garbage collect stale items. This is more a concern for the cache store implementations and the configuration but worth considering. Some stores are deleted on upgrade, or have a Time-To-Live or a Least Recently Used strategy for deleting stale items.

## Using a data source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Using a data source

Another consideration is the total size of your cache stores across all the front ends. As cache keys change they are never be invalidated or purged. So you should have in place some process to garbage collect stale items. This is more a concern for the cache store implementations and the configuration but worth considering. Some stores are deleted on upgrade, or have a Time-To-Live or a Least Recently Used strategy for deleting stale items.

## Using a data source

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


## Using a data source

## Developing cache plugins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Developing cache plugins

## Using a data source

## Developing cache plugins

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@tabishnaqvi1311
Copy link
Contributor Author

Hey @sarjona, thanks for your suggesting changes, they seem rather reasonable and I appreciate it!

I have a question though, should I commit each of your suggestions individually? I'm wondering if that will create separate commits for each change.

I'm still finding my way around open source, so your guidance means a ton.

@sarjona
Copy link
Member

sarjona commented Aug 14, 2023

Hi @tabishnaqvi1311!
For the devdocs I think it's OK to squash all the changes in the original commit (so at the end, you'll have one commit). Or, if you prefer, you can create a separate commit (but just one), with all the changes you've done from the original commit, to make it easier to review them (although my recommendation would be to leave one single commit for this patch).

Thanks a lot for the quick reply :-) Let me know if you need anything from me and post a comment when you finish reviewing the raised points :-)

Co-authored-by: Sara Arjona <[email protected]>
Copy link
Contributor

github-actions bot commented Dec 1, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 52 🟠 87 🟢 92 🟢 90 🟢 100 Report
/docs/apis/commonfiles 🟠 59 🟠 85 🟢 92 🟢 100 🟢 100 Report
/general/development/gettingstarted 🟠 79 🟠 87 🟢 92 🟢 90 🟢 100 Report
/general/releases 🟠 70 🟠 87 🟢 92 🟢 100 🟢 100 Report

Copy link
Member

@sarjona sarjona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've amended the missing points and I've just approved it :-)
Thanks for your work here, @tabishnaqvi1311 :-*

@sarjona sarjona disabled auto-merge December 1, 2023 08:24
@sarjona sarjona merged commit bdefd3e into moodle:main Dec 1, 2023
7 checks passed
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.

None yet

2 participants