I am trying to upload pictures using the paperclip gem and Ruby on Rails. Everything works great except when I try to upload larger files (~5MB), when the application times out.
I’ve set the unicorn.rb config file to have a timeout of 120, while the production database.yml file also has a timeout of 120,000 milliseconds. I’ve also restarted unicorn using service unicorn restart. However, even with these updates, the application still times out - in roughly 5 seconds.
The web application is for a very low-traffic webpage, with only one or two people uploading these types of files occasionally. So, I’m not particularly worried about the performance impact that this functionality might have. Does anyone have any idea what other choke point might be triggering a 5 second timeout error like this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!