Comments (11)
- initialise and enter context, that creates N connections (perhaps N=1)
Did you check if APNS will just close idle connections if they're opened but then for a while no request is made?
from aapns.
- initialise and enter context, that creates N connections (perhaps N=1)
Did you check if APNS will just close idle connections if they're opened but then for a while no request is made?
I've tested exponentially increasing delays between requests.
(so a connection has had a successful request, and now there's a long gap).
a 1024s idle period does not kill the connection.
I'll test a fresh unused connection being idle next.
from aapns.
IMHO the priorities should be:
- Stability (doesn't crash weirdly all the time).
- Throughput (doesn't crash under load and can send tons of notifications if needed).
- Latency (this library is such a small part of the overall latency that optimizing this last seems reasonable).
So I'd prefer a simple design (eg no background refresh because that seems like a prime source of trouble) sacrificing some performance if needed. If/once we have an actual reliable h2 client (which this library sadly never had) we can worry about latency etc.
from aapns.
- exit the context, all connections are closed
In Real-time use case, when or how often does it happen?
from aapns.
@ojii indicated that he'd start the connection pool at the start of the server.
It may only be closed when the server is shutting down.
(in other words, basically never)
I figure that's a common use-case for the cloud.
from aapns.
- a connection does not allow more than e.g. 10 concurrent requests
why? as in, why not use the max concurrency as advertised by the server
from aapns.
- a connection does not allow more than e.g. 10 concurrent requests
why? as in, why not use the max concurrency as advertised by the server
To ensure low latency;
Somehow latency is proportional to how "busy" a connection is.
from aapns.
As far as I can see the latency difference between them are not that significant (less than 1s) the biggest latency would be from APN Server - Mobile Device itself, which can take seconds more.
I'd be in favour of N>=2 + Many streams like the Batch-use case for general use
from aapns.
re: ↑ what throughput are you thinking of? how many requests per second?
from aapns.
re: ↑ what throughput are you thinking of? how many requests per second?
that's really hard to answer. "as much as possible"/"it depends"? we never benchmarked the v1 (my custom terrible h2 client) or v2 (httpx) so I have no baseline, and as you learned, getting good numbers is almost impossible because you need lots of real devices (with a push-enabled app installed) to do much.
from aapns.
Thank you all for your input.
I've settled on naive connection pool for now.
Hopefully the pros are:
- stability
- durability in face of network errors
- throughput
- [kinda] latency, by overprovisioning pool size
For cons, I'll open new tickets.
from aapns.
Related Issues (20)
- NPN protocol does not work HOT 3
- add support for `mutable-content` in notifications
- investigate httpx as a replacement for aapns.connection HOT 1
- RuntimeError('read() called while another coroutine is already waiting for incoming data') HOT 1
- APNS token-based authentication support (*.p8 file) HOT 6
- Auto reconnect might cause memory leak HOT 1
- Analyse competition HOT 1
- raw-h2: handle server closing connection HOT 1
- raw-h2: pool test / fixture fails HOT 3
- Handle graceful shutdown
- Add `apns-expiration` request header
- Make `click` an optional dep.
- Add readme to pypi description
- typo in interpolation
- Separate request timeout for request and pool HOT 1
- Maybe must go JWT by 2020-11 HOT 5
- Invalid input ConnectionInputs.RECV_HEADERS in state ConnectionState.CLOSED HOT 1
- Provide project metadata and description HOT 2
- Move on from circleci and custom docker image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aapns.