News for hackers. Stuff that matters.
Re:From Python to Go and Back Again by windlep on Friday October 16, 2015 @09:51PM (#10403089)
I have to note this, because I think it deserves quite a bit more attention.

SSL is extremely expensive, on RAM (perhaps the implementations have optimized for throughput over RAM). I have yet to benchmark any SSL implementation in any language, with any binding, that can use less than 20kb per SSL connection. I mentioned in my talk here that SSL is very expensive, here's my benchmark suite that others may add to: https://github.com/bbangert/ssl-ram-testing/

I have implementations in several languages, so far both Go and Python 3.4 can get as low as the 20kb cited. If you can get your per-connection state below 20kb, then merely adding SSL means doubling or worse your RAM requirements, which is huge.

I appreciate that everyone loves obsessing on the language wars, but the SSL RAM overhead affects us regardless of language. I covered that in one of the slides near the end, it'd be great to see some movement on reducing the RAM footprint here.

Re:From Python to Go and Back Again by ssfak on Saturday October 17, 2015 @05:03AM (#10403829)
Doesn't a TLS terminator proxy solve this? E.g. I usually put my application services behind HTTPS-enabled nginx and it works wonderfully.
Re:From Python to Go and Back Again by windlep on Saturday October 17, 2015 @11:55AM (#10404787)
Nope, so, the goal here is to reduce how many machines (each with their own RAM limits) are used. The task is holding open bidirectional SSL wrapped long-lived websocket connections. They're held open for hours at a time, since we need to send notifications when we get them.

Every connection has a base cost of the TCP kernel send/recv buffer, which in our case we dropped a bit to 4kb each. So that's still 8kb per connection right there. If we terminate the SSL on a separate machine from where we handle the connection, then it means we'll be using 8kb more memory per connection. Probably even greater because nginx has its own send/recv buffers for data.

I'm sure our use-case is a unique one, most people care about raw through-put so the majority of SSL optimization has focused on lowering CPU use under high load rather than memory use under massive amounts of connections.

Re:From Python to Go and Back Again by ash on Saturday October 17, 2015 @02:12PM (#10405413)
What is your (unique) use-case about? What service do you provide to your users?
Re:From Python to Go and Back Again by icot on Saturday October 17, 2015 @03:25AM (#10403689)
Do you have any insight about the mention in the slides of Google having a 10kb solution?
Re:From Python to Go and Back Again by nulltype on Saturday October 17, 2015 @01:54AM (#10403534)
Do you have results for the different tests? I did not see any in the repo.