# Ruby multi-CPU threading

**URL:** <https://meta.discourse.org/t/ruby-multi-cpu-threading/248433>\
**Category:** Migration\
**Tags:** rails-console, drupal\
**Created:** [December 9, 2022, 10:41pm UTC](https://meta.discourse.org/t/ruby-multi-cpu-threading/248433 "2022-12-09T22:41:51Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)\
**Post date:** [December 15, 2022, 5:22pm UTC](https://meta.discourse.org/t/ruby-multi-cpu-threading/248433/13 "2022-12-15T17:22:49Z")

</div>

Hmmm. I’m testing another import of my production forum data, this time on a fairly powerful VPS with 8 virtual cores and 16GB of RAM. I set:  
`UNICORN_SIDEKIQS=4`  
`DISCOURSE_SIDEKIQ_WORKERS=20`  
`UNICORN_WORKERS=16`

With this it doesn’t seem to be taking advantage of all the cores during the `import_topics` stage:

 ![Screenshot from 2022-12-15 12-16-30](https://global.discourse-cdn.com/meta/original/4X/a/6/c/a6c9bc3501c72f1d26d16cc1771418263281fef0.png)

 ![Screenshot from 2022-12-15 12-17-58](https://global.discourse-cdn.com/meta/original/4X/7/d/1/7d1203defedf7491c0869af4e725cf813a945fab.png)

Although it’s interesting that the CPU graph was pegged at over 600% (so ~6 out of 8 cores used at 100%) during the `user_import` stage.

I also noticed this `env` variable: `RUBY_GLOBAL_METHOD_CACHE_SIZE=131072` would that be too small?

---

_[View the full topic](https://meta.discourse.org/t/ruby-multi-cpu-threading/248433)._
