My app is built on Rails and my production server is on Heroku.
My application is mostly used for file upload and file processing and it takes more than 50 seconds f
As already mentioned, you need to process it in the background because you cannot change the timeout enforced by Heroku. This is actually a good thing, because it will allow for a much better design where the web application is responsive and it can also scale much better.
What this means is that you need to use something like for instance delayed job and you can read about it on Heroku here.
The flow of things would be something like this:
This is an idea how this can be done. You have a few different ways you can do it and delayed job is just one you can choose from.
This is not possible according to Heroku's documentation
The timeout value is not configurable. If your server requires longer than 30 seconds to complete a given request, we recommend moving that work to a background task or worker to periodically ping your server to see if the processing request has been finished. This pattern frees your web processes up to do more work, and decreases overall application response times.
You should upload your large files directly to Amazon S3 or similar and then process the file using a Heroku background worker. Typically, your web page will use some sort of polling (usually an AJAX request) to see when the processing has finished and update the front end.