buford icon indicating copy to clipboard operation
buford copied to clipboard

push: recommendation for number of goroutines / streams

Open nathany opened this issue 9 years ago • 1 comments

Apple allows between 400 to 4000 streams.

net/http2 is hard coded at 1000 streams (maxConcurrentStreams): https://github.com/golang/net/blob/313cf39d4ac368181bce6960ac9be9e7cee67e68/http2/transport.go#L409 (thanks to @sideshow for pointing this out)

In addition to streams, multiple connections can be used. From Apple docs:

You can establish multiple connections to APNs servers to improve performance. When you send a large number of remote notifications, distribute them across connections to several server endpoints. This improves performance, compared to using a single connection, by letting you send remote notifications faster and by letting APNs deliver them faster.

You can check the health of your connection using an HTTP/2 PING frame. Docs

nathany avatar Jun 16 '16 21:06 nathany

Two related issues:

https://github.com/golang/go/issues/13957 https://github.com/golang/go/issues/13774

nathany avatar Aug 12 '16 15:08 nathany