[erlang-questions] Re: Unicast 20k messages, $500-$1000 bounty

Joel Reymont <>
Thu Jul 16 21:11:15 CEST 2009


On Jul 16, 2009, at 6:18 PM, Cliff Moon wrote:

> The problem you're seeing there is process scheduling overhead.  In  
> the fun it sends a message and it's doing an ungodly amount of  
> context switching.  The way to get around this is to bump the  
> process priority level of the process which iterates the ets table.


bumping priority to high before the broadcasting list comprehension  
and lowering it after results in ~10ms broadcasting time and shaves  
~300ms off max latency. Loving it!

Mac is at ~2s (one box for everything) and ec2 is ~2.7s when bots are  
spread over 3 instances. It looks like process priority is a very  
useful tool in one's toolbox.

()4> bot:test(flashbot, 20000,  
'ip-10-244-47-97', 8081).

=INFO REPORT==== 16-Jul-2009::19:05:18 ===
setup: 69312.72ms, good: 20000, bad: 0, run: 72269.01ms
   315.0020ms | min
   500.0000ms | 2019   -  10.10%
  1000.0000ms | 3651   -  18.25%
  1500.0000ms | 4433   -  22.17%
  2000.0000ms | 5259   -  26.30%
  2500.0000ms | 4057   -  20.29%
  3000.0000ms | 581    -   2.90%
  2713.3960ms | max
ok
()5> bot:test(flashbot, 20000,  
'ip-10-244-47-97', 8081).

=INFO REPORT==== 16-Jul-2009::19:08:37 ===
setup: 65606.03ms, good: 20000, bad: 0, run: 68362.39ms
   328.4420ms | min
   500.0000ms | 1361   -   6.80%
  1000.0000ms | 4231   -  21.15%
  1500.0000ms | 4477   -  22.38%
  2000.0000ms | 4490   -  22.45%
  2500.0000ms | 4051   -  20.26%
  3000.0000ms | 1390   -   6.95%
  2716.1440ms | max
ok
()6> bot:test(flashbot, 20000,  
'ip-10-244-47-97', 8081).

=INFO REPORT==== 16-Jul-2009::19:10:45 ===
setup: 99778.01ms, good: 19953, bad: 47, run: 104700.73ms
   313.9300ms | min
   500.0000ms | 1420   -   7.12%
  1000.0000ms | 4553   -  22.82%
  1500.0000ms | 3987   -  19.98%
  2000.0000ms | 4777   -  23.94%
  2500.0000ms | 4241   -  21.25%
  3000.0000ms | 968    -   4.85%
  3500.0000ms | 0      -   0.00%
  4000.0000ms | 0      -   0.00%
  4500.0000ms | 7      -   0.04%
  4143.9490ms | max
ok

---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont



More information about the erlang-questions mailing list