<div>
<div>
<span>Hi,</span></div><div><span><br></span></div><div>First, i'm running on Mac 10.6.7 with FreeSWITCH Version 1.0.head (git-765908f 2011-05-22 19-10-52 -0500)</div><div><br></div><div>I found erlang receives events really slow so I did some tests.</div><div><br></div><div>I use two custom erl to receive events, the file is on github:</div><div><br></div><div><a href="https://gist.github.com/1024808">https://gist.github.com/1024808</a></div><div><br></div><div>The only difference of fse.erl and fse2.erl is that the following line in fse.erl was commented (line 16).</div><div><br></div><div>{blah, 'freeswitch@localhost'} ! {blah}, % comment this line will be slow</div><div><br></div><div>I run the scripts at about the same time, so they should can get the same events. The problem is that fse2.erl runs fast ( 1000 events in 6s ) while fse.erl is slow (1000 events in 2 min).</div><div><br></div><div><br></div><div><div>(s2@localhost)1> fse2:start().</div><div>start {{2011,6,14},{20,21,41}}</div><div>end {{2011,6,14},{20,21,47}}</div><div>ok</div><div><br></div><div>(s@localhost)1> fse:start().</div><div>start {{2011,6,14},{20,21,36}}</div><div>end {{2011,6,14},{20,23,24}}</div><div>ok</div><div><br></div></div><div>It's like fse.erl can only get 10 events per sec, so I guess there's some sleep(100) things in code, but sending a message(what ever) to FS breaks the sleep.</div><div><br></div><div><span>the {blah} message can be anything, while a valid msg can get ok, an invalid one gets {error, undef} etc.</span></div><div><br></div><div><span><br></span></div><div>I use the simple shell script to generate many events:</div><div><br></div><div><div>#!/bin/bash</div><div>IP=192.168.7.7</div><div><br></div><div>for f in `seq 1 8`; do</div><div>for f in `seq 1 20`; do</div><div>fs_cli -x "bgapi originate sofia/internal/load_test@$IP:5080 9664"</div><div>done</div><div>sleep 2</div><div>done</div><div><br></div></div><div><span><br></span></div><div>
<span><br>-- <br>Seven Du<br><div>About: http://about.me/dujinfang</div><div>Blog: http://www.dujinfang.com</div><div>Proj: http://www.freeswitch.org.cn</div>Sent with <a href="http://www.sparrowmailapp.com">Sparrow</a><br></span>
</div>
</div>