R
R
rusrich2018-10-22 23:41:32
Ruby on Rails
rusrich, 2018-10-22 23:41:32

How to convert video on one server and distribute content from another using Ruby on Rails?

Good afternoon.
Please advise how to accomplish this task.
There is an application that converts video, creates a database structure and allows you to watch this video through the player.
Now we need to separate the conversion to a separate server, so that when uploading, the load on the processor is low, and it is also easier for the disks.
An approximate vision is as follows:
We install the same application on two servers: server1 (for conversion) and server2 (content distribution). Server3 is used for the database.
On server1, we convert and add files via FTP to another server or via NFS
For server2, we adjust the links to the files in the database so that they can be accessed directly from server2 Tell me
, pliz who has experience.
The current php project is currently running and there the content is converted and distributed from one server and during load peaks, with simultaneous conversion, the Load Average CPU level jumps up to 140. The admins recommend keeping this level within 90.
Therefore, they wanted to split it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2018-10-27
@2ord

It seems to me that it is better to organize the upload of files that require post-processing directly to a dedicated server. Server1 can be used in order to save money simultaneously for the RoR application and serving content through a caching proxy, although it is still correct to allocate a server only for content distribution, that is, a CDN. For post-processing, you can use a microservice in Ruby or another language on server2. At the end of post-processing, notify about the end of the task and upload the processed files to the server for content delivery.
Services: Amazon CloudFront, Cloudflare Stream, Akamai CDN
Independently: ATS - https://habr.com/post/113728/ , Varnish, Nginx, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question