Would it make a difference versus the single core into terms of performance in Ruby on rails app
and if i have multi-core how i manage rails through multi-core
if multi-core processor same idea of distributed servers

- 2,802
- 2
- 14
- 33
-
1I am not sure, if I get your question right. Maybe this http://stackoverflow.com/questions/56087/does-ruby-have-real-multithreading helps? – benjamin Dec 19 '15 at 04:38
-
It's very simple: more cores/processors - more parallel workers. If you have only one worker, you don't need more than one core. – Sergio Tulentsev Dec 19 '15 at 20:54
-
also depends on if the ror application is built for multi processes/threads. Ruby implementations can have the capability in its architecture but the app may still lack it – agent provocateur Feb 17 '16 at 00:44
2 Answers
Basically, you specify that your rails app run "8 processes" at once and each will use one core. The way I do it is by using phusion passenger [in my case, with nginx] and you may get it to work like
passenger_max_pool_size 8
passenger_max_instances_per_app 8
If you want to make sure your cores are all busy [and have enough RAM] then possibly set them to size 16'ish

- 192
- 8
Multicore servers only boost performance if the rails app is running in multithreaded mode of in multiprocess mode. Ruby currently supports 'green' threads, which are lightweight and not true processor threads. Rails has support for multithreading, but gem support could be lacking and would probably be unstable for production. To make the best use of a multicore server, running a web server like unicorn or passenger, which can spawn rails processes per core, would provide you the best performance boost

- 2,413
- 2
- 18
- 20
-
3Ruby has real threads since 1.9. Which is 4 years old by now (1.9.3). 1.9.0 is 8 years old. Green threads were a thing only up to and including 1.8. – Sergio Tulentsev Dec 19 '15 at 20:52