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

💸 decrease polling frequency of getGroupPinboardIds and getItemCounts from 5s to 15s #304

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

twrichards
Copy link
Collaborator

@twrichards twrichards commented Apr 16, 2024

…as they're quite expensive (and also a bit annoying in the Network tab of the Dev Tools when debugging composer, grid, workflow etc.)

This is hopefully a temporary measure that I'd like to replace with GraphQL subscriptions somehow, so they're realtime like everything else - but this is not straight forward given it requires a DB query to determine who's impacted by a change in a group mention, which can't be done directly in the mutation (so would need to be triggered as follow-up task... i.e. complexity).

Detail

EU-GraphQLInvocation makes up the majority of the cost of pinboard...

image

... and using enhanced metrics in AppSync we can see that getGroupPinboardIds and getItemCounts are the two big hitters (making up 85% and 12% respectively) , since they're polled every 5s even when pinboard is collapsed, so essentially while every user has composer, grid, MAM or workflow open...

image

... so by decreasing the polling frequency from 5s to 15s, we should expect to see AppSync cost fall from approx $15 a day to $5. So whilst not efficient as it could be with a subscription-based approach, it does represent savings of $3,650 per year... which can start the moment this PR is merged 🙏

@twrichards twrichards changed the title 💸 increase the polling frequency of getGroupPinboardIds and getItemCounts from 5s to 15s 💸 decrease polling frequency of getGroupPinboardIds and getItemCounts from 5s to 15s Apr 16, 2024
@twrichards twrichards force-pushed the reduce-expensive-polling branch from 37a2f84 to 56428a9 Compare April 16, 2024 21:15
@twrichards twrichards marked this pull request as ready for review April 16, 2024 21:15
@twrichards twrichards requested a review from a team as a code owner April 16, 2024 21:15
…ounts` from 5s to 15s as they're quite expensive - this is a temporary measure that I'd like to replace with GraphQL subscriptions somehow, so they're realtime like everything else
@twrichards twrichards force-pushed the reduce-expensive-polling branch from 56428a9 to b5a49aa Compare April 16, 2024 21:19
@twrichards twrichards merged commit 7440e83 into main Apr 17, 2024
1 check passed
@twrichards twrichards deleted the reduce-expensive-polling branch April 17, 2024 08:19
@prout-bot
Copy link
Collaborator

Seen on PROD (merged by @twrichards 4 minutes and 17 seconds ago) Please check your changes!

@twrichards
Copy link
Collaborator Author

Here we see the drop-off of approx. $10 per (weekday) kick-in when this PR was merged...
image

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

Successfully merging this pull request may close these issues.

3 participants