kevsmith / gemini
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
Makefile | ||
| |
README.markdown | ||
| |
src/ |
Description
Demonstration of quasi-efficient message broadcast using Erlang's concurrency over TCP/IP sockets.
This code was inspired by Joel Reymont's bounty to optimize his message delivery server (see here for more details). This server does less than Joel's but has demonstrably better performance, at least as Joel has measured it. There are some differences in Joel's technique and mine in that he also measures set up time while I only measure the time it takes to deliver the broadcast message to all clients.
Note: I was seeing total delivery times in the 48 - 50 millisecond range for 5K clients. I stopped benchmarking after that due to lack of access to suitable hardware.
Take from this code what you will. I hope it helps shed some light on writing networked servers in Erlang for someone.
--Kevin
Instructions
run make
In one terminal window run the server: erl +K true -pz gemini/ebin -s gemini
In one or more additional terminals, start the client shells: erl +K true -pz gemini/ebin
In each client shell, initialize the clients:
C = gemini_stress:init(8081, 1000).
Pick one shell to initiate the broadcast. In that shell run:
gemini_stress:send(C).
The total time to send the message to all connected clients (in milliseconds) will display in the server window.

