Hi everyone,
I've made the following additions...
[API] Added selections 'newevents' and 'newmessages' which outputs only the events and messages that the player hasn't seen yet
[API] Added 'limit' URL parameter to set the number of rows received on 'events' and 'messages' (under 100)
I realised some tools are actually requesting the full most recent 100 events and 100 messages every 30 seconds just to see if any new ones have arrived, because there wasn't really an obvious alternative. If these requests are synchronised across hundreds or thousands of users, the database seems reach some limit and starts writing temporary tables to i/o, which apparently causes a backlog and slows other queries down for everyone. In the long term we'll be moving events and messages off of our servers and on to cloud hosting, like we've done with faction news and the log. I also really want to figure out a way to add socket updates to the API that tools can use instead of this inefficient process.
Ideally, it would be preferable for such tools to utilize the 'from' URL parameter to only check events / messages received since their last call (I.e. from 30 seconds ago), and not pull all 200 every time. But these new calls for 'newevents' and 'newmessages' are at least a good middle ground, this will pull all events/messages that the user hasn't seen yet (by visiting their events / messages page).
Thanks.
I've made the following additions...
[API] Added selections 'newevents' and 'newmessages' which outputs only the events and messages that the player hasn't seen yet
[API] Added 'limit' URL parameter to set the number of rows received on 'events' and 'messages' (under 100)
I realised some tools are actually requesting the full most recent 100 events and 100 messages every 30 seconds just to see if any new ones have arrived, because there wasn't really an obvious alternative. If these requests are synchronised across hundreds or thousands of users, the database seems reach some limit and starts writing temporary tables to i/o, which apparently causes a backlog and slows other queries down for everyone. In the long term we'll be moving events and messages off of our servers and on to cloud hosting, like we've done with faction news and the log. I also really want to figure out a way to add socket updates to the API that tools can use instead of this inefficient process.
Ideally, it would be preferable for such tools to utilize the 'from' URL parameter to only check events / messages received since their last call (I.e. from 30 seconds ago), and not pull all 200 every time. But these new calls for 'newevents' and 'newmessages' are at least a good middle ground, this will pull all events/messages that the user hasn't seen yet (by visiting their events / messages page).
Thanks.