开发者

If users are uploading images, and I need to do a lot of resizing/uploading, how should I set up my queue?

开发者 https://www.devze.com 2023-01-24 03:44 出处:网络
When the user POSTS to my server, should I store the picture in the body of the queue, and then have the \"worker\" servers pull it out and resize/upload to S3?

When the user POSTS to my server, should I store the picture in the body of the queue, and then have the "worker" servers pull it out and resize/upload to S3?

The r开发者_如何学Ceason I'm using a queue is because resizing/uploading 20 images to S3 takes a long time.


Amazon's Simple Queue Service may be used to maintain communication between your worker and frontend servers, but keep in mind that it only supports messages up to 64kb, meaning it won't be possible to keep the images in the queue. This is probably best, filesystems are designed to maintain large files, queue implementations generally aren't.

I would have the user upload directly to S3, then use the SQS to coordinate communication between your worker servers as they process the images and return them to S3.

0

精彩评论

暂无评论...
验证码 换一张
取 消