aiocoap
aiocoap copied to clipboard
Implement deduplication relaxations and limit deduplication memory
The current strategy of aiocoap to deduplicate everything can lead to memory requirements of around bandwidth times EXCHANGE_LIFETIME; even a 10MBit Ethernet link makes that peak at 300MB plus overheads.
To mitigate that, aiocoap should
- understand codes that are idempotent, and/or[1] allow handlers to advertise that they are idempotent, and then not cache those, or
- cache them for a limited time, possibly depending on their cost, and at any rate
- allow the total deduplication memory to be limited, and throttle bandwidth if it is exceeded by 5.03 Sorry Out Of Memory.
This was inspired y #182, but right now it seems that something is worse than just the to-be-expected inefficiencies, if it regressed vs version 0.3.
[1]: "and" would be correct, but would break applications that don't tolerate that correct behavior because they do non-idempotent stuff in safe handlers. Not sure whether to cater for that or to just put in a note in the changelog.