I am planning to set up a queue service to process user uploaded images for my app. The app will be hosted on an EC2 AWS instance, use an S3 bucket for image storage and SQS for queues.
When a user uploads an image it is stored on S3 and then a queue job is registered. The queue will then retrieve the image, resize, re-scale and save the final image back onto S3.
My question is: Is there a way to run a 'queue worker' on a separate EC2 instance away from the web app instance so the image processing backend jobs will not effect the front end web app's performance?
Any advice or guidance on this will be useful as this is my first time working with AWS and queues in general.
So if I have an EC2 instance dedicated to processing queued jobs, will I have to install laravel on that instance but only add the methods relative to queue processing? Then keep laravel and the main app code on a separate instance?
Or would I just use standard php files for queue processing?
I am mainly confused about the architecture of the app and the best approach for building this solution with 2 EC2 (1 small for app hosting, 1 large for queue processing) instances, 1 S3 instance and 1 SQS instance.
I don't like the idea of replicating the entire app when only a handful of classes will be required - so I will see if I can create a script to automatically transfer "queue worker" files when they are committed to the repository.