开发者

testing to see how many instances of ruby script i can run

开发者 https://www.devze.com 2022-12-10 08:22 出处:网络
is it true that it is better to run multiple instances of ruby scripts than doing multiple threads for ruby < 1.9 ?

is it true that it is better to run multiple instances of ruby scripts than doing multiple threads for ruby < 1.9 ?

I would like some tools or approaches to measure how much bandwith, cpu, memory is being used by each instances of ruby script (ex. a web spider).

The goal here is trying to see the maximum number of ruby scripts that can run on my ubuntu web s开发者_高级运维erver. Multiple users will be running the script.

basically i have an app which can launch multiple instances of ruby script. multiple users use this app. so i need to figure out a threshold.


It's good to use forking if you are on Unix. As an additional benefit the OS will paralellize the separate Ruby processes for you and you don't have to think about memory usage (because every worker fork will be killed after it completes). To gauge the requirements do a smoke test (how many instances you can boot in active state at the same time).

In terms of RAM the requirement per worker will be equal to the weight of your app environment or, if you use REE with copy-on-write patches applied, sensibly less (since the workers will use the base environment of the parent process).

Threads are a no-go if you want any kind of reliability. The "tools-approaches" is benchmark.rb.

0

精彩评论

暂无评论...
验证码 换一张
取 消