instead of creating a lingering connection for every push.
Doing this greatly reduces the number of open connections for GCM, and the number of connections. It also decreases CPU usage noticeably when there are active GCM PSPs, and should decrease latency.
Previously, uniqush-push was creating http.Clients every time a push request was made. Each http.Client has its own instance of a connection pool.
instead of creating a lingering connection for every push.
Doing this greatly reduces the number of open connections for GCM, and the number of connections. It also decreases CPU usage noticeably when there are active GCM PSPs, and should decrease latency.
Previously, uniqush-push was creating http.Clients every time a push request was made. Each http.Client has its own instance of a connection pool.
https://golang.org/pkg/net/http/#pkg-overview
Add a timeout of 10 seconds for pushes to GCM servers. It's undesirable to wait forever for a request to finish if there are network errors.