Throttling a process

Ulf Wiger etxuwig@REDACTED
Wed Mar 19 13:34:27 CET 2003


On Wed, 19 Mar 2003, Francesco Cesarini wrote:

>>Anyway, what I want is to let my process run in the
>>background, when the load isn't too high. The VM doesn't
>>offer this functionality (maybe it should?) but I am
>>especially after a few processes that I don't want to
>>disturb.

>Have you looked at process priorities? You could toggle
>between low and medium for a number of processes based on
>the load. Not as bad as suspend.. Actually, priorities
>might be all you need...


Beware of the possibility of priority inversion, though. The
way priorities are currently implemented in Erlang, you may
be surprised during high load if you have a large number of
normal priority processes and one or a few low priority
processes. BEAM will schedule 8 normal priority processes,
and then schedule one low priority process. In situations
where lots of normal priority processes contend for time
slices, a lone low priority process may well get the most
CPU time. This will happen if it takes a normal priority
process more than (8 time slices * number of queued low prio
processes) to be scheduled again. Probably a are case, I
admit.

/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes




More information about the erlang-questions mailing list