@karni It’s going to be hard for any one to answer because we don’t know what your application does, how heavy it uses queues, your hosting provider, or budget.
Deploying Laravel app to both app and back-end (queue) servers question
Hi guys, I've been following the forums, but this is literally my first thread here :)
I want a following setup for my Laravel app:
** on the front end:
- one (or multiple) stateless app servers
** on the back-end:
- one database server (Postgres)
- one cache server (both for session and view/etc cache)
Where should I put my queue, if I don't want another VPS for this (until my load increases)?
Should I use Redis for queue purposes as well? I'd prefer the memory to be free for the cache, but memory won't be a problem for a while I suppose. I like the idea of not having 'another thing to maintain' (beanstalkd).
Or should I use the db server for my queues, and go with beanstalkd (which is Laravel's default)?
Lastly, I will have to deploy the app updates to both app server(s) and the queue server as well - what is the recommended order of deployment? Update queue server (and restart queues), then update app servers? Or should I put app servers into maintenance, and then update both.
Thanks a lot!
Laravel workers are basically instances of the application itself, running on the CLI instead of via PHP-FPM.
The nice part about this is that you can create just another of the one (or multiple) stateless app servers and run your workers on that! (Budget permitting, of course).
My strategy for that is:
- Have a 1+ application servers behind a load balancer for web requests,
- Have 1+ other application servers NOT in the load balancer rotation, used for queue workers.
To make it simpler, I'll sometimes provision exactly the same server for workers and web (so a worker server might also have nginx/php-fpm on it, just un-used).
Please or to participate in this conversation.