Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've run Go in production for a web application, and I'll say that Go is not a great choice for this task. The built in HTTP server doesn't have a way to shut down gracefully, there's not a good zero-downtime restart story, and the standard library SQL package (and abstractions on top of it) has some nasty warts that only show up under concurrent load.

If you build a webapp in Go, be prepared to spend a lot of time monkeying around with problems that are solved issues on most other platforms.



Could you share some information about the SQL warts you found under concurrent load?


My favorite – the method that determines the size of the connection pool: http://golang.org/src/pkg/database/sql/sql.go#L227


That does look pretty gross, thanks for sharing. Any other ones stick out in your mind? I've been happy using Go against postgres, but haven't had a significant enough load to run into real problems yet.


There are a few bumps and warts. The server close issue was one that made wonder if they ever tested, but I eventually discovered you can close down a server:

lis, err := net.Listen("tcp","127.0.0.1:80")

go http.Serve(lis, router)

lis.Close()


Closing the server is easy; making sure all in flight requests finish successfully, not so easy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: