[rabbitmq-discuss] why run cpu_sup?

Jason Lunz jason.lunz at gmail.com
Wed Dec 7 17:33:43 GMT 2011


majek04 said:
> In rabbitmq 2.0.0 and before it was used to make sure that load is
> evenly distributed between nodes in a cluster.
>
> Check out src/rabbit_load.erl in rabbitmq 2.0.0:
>
> local_load() ->
>     LoadAvg = case whereis(cpu_sup) of
>                   undefined -> unknown;
>                   _         -> case cpu_sup:avg1() of
>                                    L when is_integer(L) -> L;
>                                    {error, timeout}     -> unknown
>                                end
>               end,
>     {{statistics(run_queue), LoadAvg}, node()}.
>
>
> But this code seems to be removed in 2.2.0 and later, so running
> cpu_sup may not be necessary now indeed.

Ah, you're right. And the only other use of os_mon in current hg is in
get_total_memory(), but only for windows. If not for that, os_mon could
be disabled entirely.

Jason



More information about the rabbitmq-discuss mailing list