JohnnyW2001
1 year ago
892
1
Laravel

Using Amazon SQS with Laravel

Posted 1 year ago by JohnnyW2001

I've configured Laravel to queue email messages which are being sent by my site using Amazon SQS. The service itself seems to work fine. I can see all the messages appears in the SQS queue in my AWS account, but the problem is that the queue just seems to be getting bigger and bigger.

I can't find any decent tutorials or guides that explain how to read the SQS screen written in plain English, so everything MAY be fine. That said, I'd like to make sure.

Consider what SQS is currently saying:

Messages available: 310
Messages in Flight: 4
Messages delayed: 0

When I tested it when it first went live, messages were being sent immediately. The queue was empty and they arrived in my inbox without issue.

Today the queue ("Message available") appears to be 310 and it's only going up! (Edit: Ok, it's hovering around 300 now, but also going up to 302 at times.) Now it's taking several hours for messages to appear in my inbox... In fact, I'm still waiting for some to appear from several hours ago.

Is this normal? I've checked my server. I've now added five processes running php artisan queue:work, each consuming ~5% of the CPU.

If I manually run the same command (instead of as nohup) I see constantly updating list:

[2018-04-04 20:09:59] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:09:59] Processing: App\Notifications\CompetitionVIP
[2018-04-04 20:10:00] Processing: App\Notifications\CompetitionVIP
[2018-04-04 20:10:00] Processing: App\Notifications\CompetitionVIP
[2018-04-04 20:10:00] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:00] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:00] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:02] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:02] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:02] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:02] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:02] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:02] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:03] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:03] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:03] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:03] Processing: App\Notifications\CompetitionAll
[2018-04-04 20:10:03] Processing: App\Notifications\CompetitionAll

Only every so often does one change to Processed, most of the time it's an endless list of yellow Processing, changing every second.

Any help understand what's going on would be greatly appreciated!

Please sign in or create an account to participate in this conversation.