Right now the content conversion process (i.e. document conversion to PDF, SWF and png OR video conversion to various formats) is done by queuing the conversion process in delayed job. The delayed job instance runs on the application server, which is responsible for serving web requests. When larger files are uploaded, the conversion process uses up bulk of memory and cpu because of which the application server is not able to process the web requests.
To device a scalable solution to distribute the processing over different servers
1) To make sure that the longer running OR memory consuming jobs do not affect the web request/response process.
2) To make sure that conversion process does not require a single server with very large memory and cpu requirement. Rather the processing load should be distributed amongst multiple servers.
Refer to the diagram below
Following are the things be considered to scale up this setup -
1. Most of the large files could be videos and video conversion is CPU heavy. So, we need at least 8 Cpu or 12 CPU core machines.
2. We need to add one more slave database and scale the master if needed so that replication is smooth.
3. The distributed file system should be really scaling well to handle all the reads and writes as there will be about 5 machines hitting it at all the time. We are considering hadoop dfs as of now. This seems good and needs to be fine tuned to the best possible extent.