Then maybe I'm doing something wrong but I've just reviewed my code and it doesn't look like I"m doing anything particularly aggressive.
Firstly I should correct my numbers. I've just pulled some hard data and the system does about 600 calls on startup. I think this number is lower than my initial 2K estimate partly due to the additional of the new 'and' 'or' clauses.
When using the API I'm seeing typical response times of 300ms with some queries blowing out to 1sec.
To put this in context that means if you want to display just 10 tickets on screen its going to take 3-10 seconds (assuming you don't need to pull any activity/company/contact/staff data, which is unlikely).
The result is that we came to the conclusion that we need to heavily cache the accelo api results.
The system I'm building is designed to allow me to do some quick reviews of contracts and take some specific actions.
The opening screen is designed to show a summary of all active contracts and the total work done MTD and last month.
We have 60 contacts in our system and it takes the above mentioned 600 calls to accumulate just this data.
Once this initial burst of calls is complete my system does very few calls to the accelo api due to the heavy caching.
There are two problems here:
1) During the development cycle you can see how a few restarts will quickly each into a 5k hourly budget.
2) whilst we are heavily caching the results, the cache does have a 'time to live' of 10 minutes to ensure that the data is relatively fresh. We can probably play with the cache 'time to live' but with a number of other screens we are building I'm concerned that we may get precariously close to the 5K limit just in normal production use.
So my suggestion, which is probably going to hurt my development cycles even further but will probably be fairer for every one.
Don't make it a limit 'per hour' but 'per second.
The problem with your 5K limit is two fold
1) it won't protect your system. It would be quit easy to put a client together that attempts to do the whole 5K calls within a single second.
This would most likely crash your system.
2) the hard limit will stop client applications working all together for the rest of the hour.
Instead set a limit of say 100 calls per second.
This does two things.
1) stops any single user doing ginormous no.s of calls at the start of any period which will bring your system to its knees.
2) allow any client application to pace itself but continue to operate rather than coming to a grinding halt.
My two cents worth.
Brett