R
R
rusrich2019-02-27 22:48:00
Ruby on Rails
rusrich, 2019-02-27 22:48:00

When uploading a file through Carrierwave weighing more than 4 GB, it heavily loads the system. Why?

Greetings.
There was a problem in production when uploading large files with Carrierwave.
Uploading video files. They are background-converted using Sidekiq.
A small load on the processor is observed at the time of downloading a video ranging in size from 1 GB to 4.2 GB (I haven’t loaded it heavier yet) and very large during subsequent copies to STORE and CACHE.
Please tell me how to get rid of unnecessary copy and move operations.
The methods below do not fix the situation.

def move_to_cache
    true
  end

  def move_to_store
    true
  end

By and large, I do not need the source code. I would gladly get rid of all copies altogether, with the exception of one, so that the source remains for conversion.
The project works through NGINX + PUMA.
I don't see this problem locally. Possibly due to the SSD.
On the server, the system is on SSD, storage in raid 5 from HDD.
The server itself is not weak. The virtual machine has 20 cores and 30 GB of RAM.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question