Overview:
I have photo paper that takes photos and sends them to my web application. Then my web application stores user data and sends the image to the user profile / user fan page.
My web application runs the Ruby on Rails @Heroku cedar stack.
Flow:
- My webapp receives a photo from photo paper through POST, as a web form.
- The stand is waiting for a server response. If the download fails, it will send the image again.
- The response from webapp will only start after the facebook download is complete.
Problems:
Webapp sends data only to the photoblock after all processing has been completed. Many times this will happen in 30 seconds. This causes Heroku to launch H12 - Timeout.
Solutions?
Save the request while downloading the file (return some response data to prevent the H12 hero from starting - https://devcenter.heroku.com/articles/http-routing#timeouts ). - Is it possible? How to achieve this in Ruby?
Change to Unicorn + Nginx and activate the download module (since dyno receives a request only after the download is completed - Unicorn + Rails + Large Uploads ). Is it really possible?
Use a timeout gem . This would cause my end-to-end downloads to fail, so the photos would never be posted to Facebook, right?
Change the architecture. Download directly to S3, run an employee to check for new images uploaded to the S3 bucket, upload them and send them to Facebook. βThis may be the best, but it takes a lot of time and effort.β I can go for it in the long run, but now I'm looking for a quick solution.
Other ...
source share