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

Fix timeout with large number of subscribers #3706

Merged
merged 1 commit into from
Jul 12, 2019
Merged

Conversation

hillale
Copy link
Contributor

@hillale hillale commented Jul 12, 2019

We have Cachet with 1499 subscribers, and this page was timing out. We troubleshot the issue and found this code running thousands of mysql queries and hitting the 60 second nginx timeout.

Where the template hits this inside a loop, triggering many queries:
https://github.com/CachetHQ/Cachet/blob/2.4/resources/views/dashboard/subscribers/index.blade.php#L43

Helpful page on optimizing code for ORM utilization:
https://laravel-news.com/eloquent-eager-loading

@welcome
Copy link

welcome bot commented Jul 12, 2019

Congratulations on opening your first Pull Request, this is a momentous day for you and us! ✨
To help us out, please make sure that you've followed the below:

@jbrooksuk jbrooksuk merged commit 3d0322d into cachethq:2.4 Jul 12, 2019
@welcome
Copy link

welcome bot commented Jul 12, 2019

Hooray! Your first Pull Request was merged, here's to many more 🚀

@jbrooksuk
Copy link
Member

Thank you, I’m sure there are a few instances where we can make use of eager loading.

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