View Single Post
Old 1 Dec 2017, 09:42 PM   #14
The "e" in e-mail
Join Date: Jul 2004
Location: Melbourne, Australia
Posts: 2,675

Representative of:
Originally Posted by rthomas View Post
Hi Bill,
Why most of the API call take less then 150 ms excepted one that take 4 to 10 seconds?
Why is this always the same API call, the one that contains messagesNotSpam + messageSavedOrSent + updateMailboxMessageList + mailboxCounts that is slow?

Your diagnostic is not correct.

BritTim asked me to pop in and look at this. Sorry I haven't had a chance yet.

messagesNotSpam is a pretty expensive API call, depending on the size of your bayes database and the number of messages being reported, it can take a while to update the data. Also if the report hits a web server that doesn't have the latest bayes on it yet, it needs to fetch from the backend, write the changes, and sync them back to multiple redundant copies.

It's a pain, particularly if you've done a search. We made a change just last week to reduce the lock time during the asynchronous snippets fetch, because that was holding some mailbox locks for seconds at a time and slowing down later actions. And it's spooky-action-at-a-distance when that happens. Same as deleting or moving a large set of numbers and then doing something else.

The interface will allow you to do new things using cached data, even while a long running operation is happening. Mostly that's lovely, because it means you can keep working, but if you do something else which needs to wait on the server, you could wind up with the interface freezing on something which _should_ be quick, and it's because the server is busy chugging away processing the earlier request.

No perfect answer to that. Server actions take time. When we switch the frontend to use the JMAP protocol, it will do some of these bulk actions as a set of smaller requests which can be interleaved with fetches, which will help remove the hiccups from your experience. It won't make the full task faster, just mean it doesn't block everything else!

I've had a look at all three tickets now - they seem slightly different issues might be underneath, but the problem with replying right now is that it requires both a read and a write against the server, so it winds up hitting any other lock on the account.


brong is offline   Reply With Quote