Gen_server and Gen_fsm questions

Fredrik Linder fredrik.linder@REDACTED
Tue Jan 4 10:10:02 CET 2005


> On Tue, Jan 04, 2005 at 01:54:38PM +0600, Casper wrote:
> }  
> }  Gen_fsm:
> }  If I have one/two process for each call, then if I 
> maintain let's say
> }  100,000 simultaneous calls, I will have to create 200,000 
> gen_fsm, ie.
> }  Processes. Is that a Good method? Will that create 
> unnecessary system
> }  overhead?
> 
> Eranga,
> 
> It's fine.  If there's 200K call terminations there are just that many
> concurrent activities and each should have it's own process.  When you
> get hundreds of thousands running you might want to start tuning how 
> memory is allocated but it's certainly not too many processes 
> to handle.
> 
> 	-Vance

One thing you might want to look at is erlang:hybernate/3. If memory still is a problem you might want to store the call state on disk and kill the process while it is inactive and spawn a new that loads the state when it should become active. (If I don't remember incorrectly has Ulf written such a module for public use).

/Fredrik



More information about the erlang-questions mailing list