<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello,</div><div><br></div><div>Yes, the main limitation factor is HW resources. 1M process can be handled both by supervisor and VM. Of course, if process does heavy lifting then you are in trouble. I've made very simple empirical experiment. </div><div>I've used simple_one_to_one supervisor to spawn 1M processes. Each process is container for data and does not perform any actions. First I've wrote 1KB of binary data to each process, there was about 100 writer. After that I was reading this data by 10, 100, and 1000 readers. Write operation took 100% CPU utilization and beam weight is 4.25GB.</div><div> </div><div>You can see some KPI of that experiment from list below.</div><div><br></div><div><div><font class="Apple-style-span" face="'Courier New'">put by 100 process 1000000 times</font></div><div><font class="Apple-style-span" face="'Courier New'">-------------------------------------------------------------------------------</font></div><div><font class="Apple-style-span" face="'Courier New'">Wclock (ms): 233895.186</font></div><div><font class="Apple-style-span" face="'Courier New'">Completed: 1000000</font></div><div><font class="Apple-style-span" face="'Courier New'">Failed: 0 (0.00%)</font></div><div><font class="Apple-style-span" face="'Courier New'">TPS: 4275.4</font></div><div><font class="Apple-style-span" face="'Courier New'">Latency (ms): 0.234</font></div><div><font class="Apple-style-span" face="'Courier New'">IO tput (MB): 4.192</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">get by 10 process 10000 times</font></div><div><font class="Apple-style-span" face="'Courier New'">-------------------------------------------------------------------------------</font></div><div><font class="Apple-style-span" face="'Courier New'">Wclock (ms): 191.787</font></div><div><font class="Apple-style-span" face="'Courier New'">Completed: 10000</font></div><div><font class="Apple-style-span" face="'Courier New'">Failed: 0 (0.00%)</font></div><div><font class="Apple-style-span" face="'Courier New'">TPS: 52141.2</font></div><div><font class="Apple-style-span" face="'Courier New'">Latency (ms): 0.019</font></div><div><font class="Apple-style-span" face="'Courier New'">IO tput (MB): 51.118</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">get by 100 process 100000 times</font></div><div><font class="Apple-style-span" face="'Courier New'">-------------------------------------------------------------------------------</font></div><div><font class="Apple-style-span" face="'Courier New'">Wclock (ms): 1455.720</font></div><div><font class="Apple-style-span" face="'Courier New'">Completed: 100000</font></div><div><font class="Apple-style-span" face="'Courier New'">Failed: 0 (0.00%)</font></div><div><font class="Apple-style-span" face="'Courier New'">TPS: 68694.5</font></div><div><font class="Apple-style-span" face="'Courier New'">Latency (ms): 0.015</font></div><div><font class="Apple-style-span" face="'Courier New'">IO tput (MB): 67.347</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">get by 1000 process 1000000 times</font></div><div><font class="Apple-style-span" face="'Courier New'">-------------------------------------------------------------------------------</font></div><div><font class="Apple-style-span" face="'Courier New'">Wclock (ms): 14794.269</font></div><div><font class="Apple-style-span" face="'Courier New'">Completed: 1000000</font></div><div><font class="Apple-style-span" face="'Courier New'">Failed: 0 (0.00%)</font></div><div><font class="Apple-style-span" face="'Courier New'">TPS: 67593.7</font></div><div><font class="Apple-style-span" face="'Courier New'">Latency (ms): 0.015</font></div><div><font class="Apple-style-span" face="'Courier New'">IO tput (MB): 66.267</font></div></div><div><br></div><div>- Dmitry</div><br><div><div>On Sep 4, 2012, at 5:43 PM, Jesper Louis Andersen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Sep 4, 2012, at 3:42 PM, Son Tran-Nguyen <<a href="mailto:esente@gmail.com">esente@gmail.com</a>> wrote:<br><br><blockquote type="cite">My question is how many event managers can the supervisor manage? My goal may<br></blockquote><blockquote type="cite">get to million of children. I see that I can create millions of processes, but<br></blockquote><blockquote type="cite">not sure whether the supervisor can manage it effectively.<br></blockquote><br>My guess would be you will run into limitations long before that. A gentle guess is that a process takes 500 bytes. One million of those is thus half a gigabyte. The supervisor can manage this number, but of course it will use more CPU time and memory managing this large amount by itself.<br><br>My best advice is: Try it and see. We don't know enough about what you are trying to build, so we cannot estimate what will work for you. You will need to set up some hard numbers and then work towards that goal. Also, what hardware do you have available? And do you plan to run distribution? Answering these questions might help you going further.<br><br>You should be able to write an attempt in a relatively short time frame. Just try spawning a million children like the ones you are seeking to run and see if that works for you.<br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></blockquote></div><br></body></html>