Getting "unexpected EOF" when trying to connect more than 29 connections to websocket server.

81 views
Skip to first unread message

Makoto

unread,
Jul 24, 2010, 7:45:16 PM7/24/10
to golang-nuts
Hi.

I am currently trying to make very simple script to benchmark
websocket response time.

http://github.com/makoto/wsbench/tree/master/go/wsbench/

The script first makes x number of connections, then write "hello
world". A seperate websocket server does echo back, then the script
records how long it took to get response from each connection.

The script itself is working. However, I start getting "unexpected
EOF" error when I try to make more than 29 connections.

http://gist.github.com/489070

Looks "websocket.Dial" starts sending back EOF when I open too many
connections.
Does anyone know if the function have limit on max number of
connections and whether I can change the default value (if any)?
Failing to make more than 30 connections seems a bit limiting.

A few other notes.
- I first tried on OSX, then tried on Ubuntu and getting same error
(so OS difference should not be the cause).
- For both OSX and Ubuntu, I was able to make more than 1000
connections using ruby version of similar benchmarking script, so
machine config is less likely to be the cause.
- I set GOMAXPROCS = 100 on ubuntu (I did not have to set this value
in OSX)

Thanks.

Makoto

Russ Cox

unread,
Jul 24, 2010, 9:24:10 PM7/24/10
to Makoto, golang-nuts
> Looks "websocket.Dial" starts sending back EOF when I open too many
> connections.
> Does anyone know if the function have limit on max number of
> connections and whether I can change the default value (if any)?
> Failing to make more than 30 connections seems a bit limiting.

I am not aware of such a limit, and there shouldn't be one.
I encourage you to boil the example down
to a single-file program, as short as possible,
and file an issue on the Go issue tracker.

Thanks.
Russ

Makoto

unread,
Jul 25, 2010, 5:20:44 AM7/25/10
to golang-nuts
Thank you for your advice.

I filed the issue with sample single-file programme.

http://code.google.com/p/go/issues/detail?id=955&colspec=ID%20Priority%20Status%20Owner%20Reporter%20Summary

Thanks.

Makoto
Reply all
Reply to author
Forward
0 new messages