News for hackers. Stuff that matters.
Re:Handling 1M websocket connections in Go by jondubois on Wednesday February 13, 2019 @05:01PM (#19157524)
These kinds of benchmarks are not very meaningful. I think that pretty much any modern framework/language can handle at least 1 million idle WebSockets. It's much more interesting to measure performance when you start sending messages through them at regular intervals.
Re:Handling 1M websocket connections in Go by kjksf on Wednesday February 13, 2019 @06:11PM (#19158068)
When people rewrite system from X where X in (Python, Ruby, Node, Clojure) to Go they usually see at least 10x improvement.

This is just one recent example: https://www.infoq.com/articles/api-gateway-clojure-golang

The money quote:

"The end result enabled us to reduce 25 instances (c4 xlarge) running Clojure code - able to process 60 concurrent requests, to two instances (c3.2xlarge) running Go code able to support ~5000 concurrent requests a minute"

If you google around you'll find more stories like that.

To do better than Go you would have to drop to C++ or Rust.

Re:Handling 1M websocket connections in Go by karim on Wednesday February 13, 2019 @07:22PM (#19158514)
"When people rewrite system from X where X in (Python, Ruby, Node, Clojure) to Go they usually see at least 10x improvement."

Sure but how much of the performance gains come from Go and how much come from just having a better understanding of the problem the second time around?

Re:Handling 1M websocket connections in Go by zepolen on Thursday February 14, 2019 @04:42AM (#19160740)
Go is strongly typed and compiled, it literally does 10x less work than dynamic languages for most things.

Pypy leads to a near 10x speed up over cPython as well.

Re:Handling 1M websocket connections in Go by Scarbutt on Wednesday February 13, 2019 @07:19PM (#19158494)
"The end result enabled us to reduce 25 instances (c4 xlarge) running Clojure code - able to process 60 concurrent requests, to two instances (c3.2xlarge) running Go code able to support ~5000 concurrent requests a minute"

That doesn't make any sense though.

Re:Handling 1M websocket connections in Go by piranha on Wednesday February 13, 2019 @10:34PM (#19159411)
That article is anything but useful. They have spent significantly more time designing and writing app in Go than their prototype in Clojure and now it’s faster? What a surprise!
Re:Handling 1M websocket connections in Go by fulafel on Friday February 15, 2019 @01:42AM (#19168950)
Hmm, there's a slight disparity between the quote and their benchmark table, which shows Clojure and Go neck and neck in the request/sec dept. I guess all the system re-architecting explains most of the difference.

In any case, as the article text also mentions, on the Go side they are using a complete reverse-proxy library that's included with the Go stdlib, which can be a significant advantage aside from the properties of the language itself.

But then it seems they ended up reimplementing many things that the JVM provides: "In order to achieve out of the box functionality such as CPU and memory usage metrics, business logic counters and more - we needed to write basically this entire stack from scratch, which enabled us a much more rapid deep dive of the intricacies of Golang."

Re:Handling 1M websocket connections in Go by apta on Wednesday February 13, 2019 @10:58PM (#19159503)
> To do better than Go you would have to drop to C++ or Rust.

C++ and Rust yes, but also Java and .NET.

Re:Handling 1M websocket connections in Go by weberc2 on Wednesday February 13, 2019 @11:29PM (#19159629)
In my experience Java, C#, and Go are roughly on par. Go is a bit easier to optimize though.
Re:Handling 1M websocket connections in Go by basic6 on Thursday February 14, 2019 @11:07AM (#19162925)
I didn't think Go rewrites were common anymore since the results were mediocre.
Re:Handling 1M websocket connections in Go by kasey_junk on Wednesday February 13, 2019 @09:47PM (#19159242)
Or Java or C# or basically any non-interpreted language.
Re:Handling 1M websocket connections in Go by rakenodiax on Thursday February 14, 2019 @01:04AM (#19159944)
In this case, Clojure is already running on the JVM
Re:Handling 1M websocket connections in Go by kasey_junk on Thursday February 14, 2019 @07:37AM (#19161409)
The Clojure compiler does not generally produce the same byte code as the Java one.

Idiomatic clojure is routinely slower than idiomatic Java and that’s a well known and expected outcome.

Re:Handling 1M websocket connections in Go by e-r-a-n on Wednesday February 13, 2019 @05:05PM (#19157556)
They are not idling. Look at the code.