Replies: 1 comment 1 reply
-
Hi @bobwurtz I don't think this is directly related to sidecar-browsershot. The package doen't contain code to interact with a database so it never establishes a connection that could lead to a "too many connections" error. However, as you mention that you run sidecar-browsershot in a Job, this could potentially dead lock your database: Let's imagine you're dispatching 50 jobs. Each job triggers sidecar-browsershot. For unkown reasons all sidecar-browsershot executions fail after 10 seconds (maybe the timeout you've set up). If you're queue setup runs the 50 jobs in parallel (meaning you have 50 workers), all 50 jobs will fail at the same time. Laravel will then attempt to write 50 new rows into your I don't know your exact setup, so I can't share a solution directly, but here are some further questions that could help resolve the issue:
I've used this pattern in the past to limit the number of mails a project can send per minute, by using a custom rate limit and using the This is the code for my custom rate limit. In my case RateLimiter::for('sidecar-browsershot-limit', function (ShouldQueue $job) {
return Limit::perMinute(60)->by($job->yourModel->id);
}); In my job I added a middleware method and referenced the rate limit. public function middleware()
{
return [
new \Illuminate\Queue\Middleware\RateLimited('sidecar-browsershot-limit'),
];
} |
Beta Was this translation helpful? Give feedback.
-
Hello,
I recently experienced an issue and I don't know if SidecarBrowsershot is the cause, but I figure it's at least worth asking. Yesterday morning, I started receiving strange timeout errors on my site. It took me until this morning to find the cause. The issue was with availability of connections to my database (screenshot below).
Right around when these errors started, I started receiving the following error message related to browsershot:
My questions are:
I realize this is a strange question, so any feedback/comments/questions are welcome. Thank you
Beta Was this translation helpful? Give feedback.
All reactions