Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Reading glowroot, I notice sending messages triggers many Cassandra requests.
See attached screenshots:
- [1] should overall requests. We can spot a very high number of mailboxes reads, acl reads, and message reads. The analysis of the traces entries shows that:
- [2] attachment validation leads to many reads. For each attachment, 7 Cassandra reads is performed (checking both if the attachment had been uploaded or belongs to a message the user can read). Interestingly enough, a code analysis shows that:
- messagev3 reads are uneeded upon attachment checks
- AttachmentManager already expose grouped reads for attachments, but this API is not leveraged for perfomance enhancements.
- [3] the request ends up mostly reading ACLs.
This is linked to a full account search to retrieve the message that had been answered/forwarded. By retrieving mailboxes - and thus acls, we perform many unneeded reads.
We expect a sharp drop in request count by:
- Avoiding reading messagev3 table upon attachment right checks.
- Grouping right validation for attachment at always attachments belongs to the same draft message.
- Reworking all mailbox search to less read ACLs.