gen_server:start - performance

Gaspar Chilingarov nm@REDACTED
Wed May 25 19:35:07 CEST 2005


Vladimir Sekissov wrote:
> Good day,
> 
> nm> Hmm, after doing some measurements, I've found that
> nm> spawning processes with gen_server:start and stopping
> nm> them takes several times much time that with spawn.
> 
> You don't need write simple short living workers as gen_server's.
> 
> If you need OTP support for them look at _plain_fsm_ module at
> Jungerl(http://jungerl.sourceforge.net/). You can convert simple
> spawn+loop FSMs with it easily to obey OTP system protocols.
> 
> It seems that _proc_reg_ module could be useful too for your
> application.
> 
> Best Regards,
> Vladimir Sekissov

ok, so it's better to write something like plain_server, which will 
provide same interface as gen_server, but implement less functionality 
than gen_server.

> 
> nm> Hmm, after doing some measurements, I've found that
> nm> spawning processes with gen_server:start and stopping
> nm> them takes several times much time that with spawn.
> nm> 
> nm> The only way to get around this was to leave some processes alive, 
> nm> cleaning their status, but not stopping them.
> nm> 
> nm> I need rate of about 2500 proc/second starting for a some time range - 
> nm> say bursts 10 seconds long with such spawn rate
> nm> 
> nm> 
> nm> 
> nm> 
> nm> -- 
> nm> Gaspar Chilingarov
> nm> System Administrator
> nm> 
> nm> t +37491 419763
> nm> w www.web.am
> nm> e nm@REDACTED
> nm> 
> 


-- 
Gaspar Chilingarov
System Administrator

t +37491 419763
w www.web.am
e nm@REDACTED



More information about the erlang-questions mailing list