Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.
The impression that I get about Go is that it's excellent at concurrency and bad at parallelism, somewhat like a strongly-typed NodeJS. Am I wrong? I've been looking for a chance to do some real work using Golang but the project I'm about to start has a serious need for parallel computation so I'm thinking I'll just try C# on .NET Core or Kotlin.

Adbot
ADBOT LOVES YOU

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.

skul-gun posted:

I guess that depends on how you mean "bad at parallelism." Go programs aren't stuck to being single-threaded as with node. There is a setting (GOMAXPROCS) that controls how many OS threads can be used to execute goroutines. GOMAXPROCS used to default to 1, but now defaults to the logical number of CPUs.

But if you're looking for built-in utilities like java.util.concurrent, no, go doesn't have those.

I hope that helps.

Well, thanks for opening my eyes guys. I had found some older documentation that indicated that GOMAXPROCS defaulted to 1 and best practice was to leave it there. I'm certainly more familiar with multithreaded C# / Java and using Goldman Sachs Collections from Kotlin looked like a simple solution, but I'm going to take a look at Go before I write it off.

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.
I'm having mysteriously bad HTTPS serving performance, specifically TLS handshakes. Real applications are using the http.ListenAndServeTLS, right? I profiled my application and... it's spending all of its time doing TLS handshakes on a simulated load that we believe represents realistic traffic.

This is running on AWS, in ECS behind an ALB, but I'm under a contractual requirement to encrypt all traffic end to end, so the service needs its own self-signed cert. Any suggestions before I bolt on a sidecar proxy that will terminate SSL inside the same ECS task? That sounds like more headache than I want right now, and I'm disappointed that NodeJS seems to be able to TLS handshake significantly more efficiency than Go's built in http server.

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.
All of this is helpful, thanks.

I'll definitely move to an ECDSA key for the cert. I had read they were faster at some point, but didn't realize that optimizations on one path but not the other mean it's an order of magnitude.

The other issue that I've noticed contributing is that the ALB is demuxing HTTP/2 connections onto a much higher number of HTTP/1.1 connections between ALB and backend. I hadn't read the docs yet, and assumed that "HTTP/2" support on ALBs meant both client-facing and backend, but it's client-facing only. I'm going to turn up the keep-alive timeout in hopes of re-using connections more often. The traffic to this is spiky, and the default 60s timeout isn't long enough.

Twerk from Home fucked around with this message at 16:17 on Dec 15, 2019

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply