Ticket #44 (new)
Opened 2 years ago
Better BridgeWebservice Load Management
| Reported by: | martijn | Owned by: | AlexanderPico |
|---|---|---|---|
| Milestone: | Component: | REST Webservice | |
| Version: | Severity: | feature | |
| Keywords: | Cc: |
Description
We need to write something to be able to log / throttle webservice requests, to be able to manage the load.
I propose to create an interface like this:
interface LoadManager
{
boolean start(String method, String ip);
void done();
}
Calls to currentLoadManager.start() and currentLoadManager.done() will have to be added at the start and end of each webservice function.
The start() method could potentially block temporarily. Or it could return false, in which case the request is rejected due to high server load. Then we can implement several LoadManager?'s with various complexities. SimpleLoadManager? simply logs requests, but doesn't interfere. DefaultLoadManager? delays the start() method in case many requests come from the same IP address.
