简体   繁体   中英

Sidekiq - Processes or threads? Whats most effective?

I have a 20 core droplet on DO. I have a rake task that creates images. The images is converted with paperclip/imagemagick. I've added paperclip_delayed which uses delayed_job and as a background worker I've added Sidekiq.

So with sidekiq I can add additional workers or set multiple threads.

What is best in terms of performance? Is it better to have a low amount of processes and add a lot of threads or vice versa? Or does it not matter as long as I dont overstep the amount of cores?

"Worker" is a nebulous term: use process or thread.

With image processing, your limiting factor is likely Disk I/O unless you have some fantastic SSDs on that droplet. Threads limit you to a single core unless the image processing routines are shelling out to something like mini_magick . If that is the case, a single process with 25 threads should be sufficient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM