I created an audio processing web application using Rails. The user uploads a song to the website. The song is broken down into individual elements and then modified and recombined.
I am using an open source command line tool that is called from the rail controller.
My problem: the processing takes between 2 and 3 minutes and consumes a lot of memory. The browser is in the loading stage for 2 to 3 minutes. And this is only for 1 request from 1 user. I am using the Amazon ec2 t1.large instance simply is not enough.
I am planning to use background processing, but I don't want several requests to work at the same time.
I want the first request to take 3 minutes. Second request to take 3 + 3 minutes. Third request to take 3 + 3 + 3 minutes. Then the website does not fall.
In addition, the audio file is around 40 mb. Is it a good idea to use amazon s3 bucket? Or simply increase the space on the hard drive and store audio files on my server?
The reason why I don't want to use the amazon s3 bucket is because I don't want to transfer each file again from my ec2 instance to the s3 bucket, since it will be added to the latency.