[erlang-questions] Timers for hibernated processes

ori brost <>
Tue Nov 22 12:29:53 CET 2011


I have 300000 processes, each process has a timer that fires once in
25 secs and tells it to send a small TCP message. I have noticed that
in this version, I get more gen_server call timeouts and errors from
the underlying cowboy server. When I implement the same with less
timers, instead having a single timer that broadcasts a message to all
processes, these errors disappear.

On Tue, Nov 22, 2011 at 12:58 PM, Ahmed Omar <> wrote:
> Hi Ori,
> Can you be a bit more specific how it hurts your performance? Is there only
> one process responsible for creating timers? What does your app do in the
> first place?
>
> On Tue, Nov 22, 2011 at 2:32 AM, ori brost <> wrote:
>>
>> I tried hibernation alone and it did not help, only
>> hibernationcombined with reducing timer amount did the trick
>> On Mon, Nov 21, 2011 at 9:25 PM, Joel Reymont <> wrote:
>> > Are you sure that creating these timers is what's hurting performance?
>> >
>> > My bet is on your processes, try hibernating them.
>> >
>> > Let us know if that helps.
>> >
>> > On Nov 21, 2011, at 7:22 PM, ori brost wrote:
>> >
>> >> We have an erlang program which creates many (300000) timers using
>> >> erlang:start_timer. We have noticed in tests that creating these
>> >> timers hurts our performance. For each such timer we have a process
>> >> that gets a message from it once every 25 seconds, except for waiting
>> >> for these messages, the processes are mostly idle. We are working on
>> >> reducing the number of timers, but we would also like to know whether
>> >> these timers may hurt performance less if the processes would
>> >> hibernate until they get a message. Furthermore, is there any
>> >> documentation explaining why creating many timers can hurt erlang
>> >> performance?
>> >
>> >
>> > --------------------------------------------------------------------------
>> > - for hire: mac osx device driver ninja, kernel extensions and usb
>> > drivers
>> >
>> > ---------------------+------------+---------------------------------------
>> > http://wagerlabs.com | @wagerlabs |
>> > http://www.linkedin.com/in/joelreymont
>> >
>> > ---------------------+------------+---------------------------------------
>> >
>> >
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> --
> Best Regards,
> - Ahmed Omar
> http://nl.linkedin.com/in/adiaa
> Follow me on twitter
> @spawn_think
>



More information about the erlang-questions mailing list