Unicorn + Rails + Large Uploads

家住魔仙堡 提交于 2019-12-03 12:38:00

If you're uploading to S3, then you can "simply" have the user upload files direct to S3 instead of via your dynos, and get pinged when the upload is complete.

For significantly more information than this, check out something like CarrierWaveDirect

If you're using nginx as a reverse proxy in front of your unicorns, you can use the Upload Module. When configured, nginx handles the upload and stores it in a /tmp directory, then your unicorn gets request params telling it where the uploaded asset is and it's content type. No more worker tied up receiving the upload.

If you don't really want the upload on the same server as your web service, but rather store it in S3, you should follow @Neil Middleton's suggestion and set things up so the upload goes directly there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!