[erlang-questions] 20k messages in 4s but want to go faster!
Joel Reymont
joelr1@REDACTED
Mon Jul 13 09:29:42 CEST 2009
On Jul 13, 2009, at 12:37 AM, Tony Arcieri wrote:
> If this sending of 20k messages is a repeat affair, what if you had a
> process per connection you could broadcast messages to that remained
> alive
> for the duration of their TCP connections?
Under what circumstances is taking a trip through 1-2 extra gen_servers
is faster than pushing data directly to the socket?
I do have a transport (protocol handler) process and I do have a session
process that persists even while the socket is gone. I used to send
to the session which would forward to the transport and I still do this
for HTTP since the socket does not persist.
I decided to optimize away the extra trip through session and transport
for persistent Flash connections, though, by capturing gen_tcp:send
with the socket in a closure and using that to push to the socket
directly.
Thanks, Joel
---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont
More information about the erlang-questions
mailing list