Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3485

JMAP: Sending a message read reads too much data in Cassandra



    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0
    • None
    • None


      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.


        1. Screenshot from 2020-12-25 19-54-38.png
          229 kB
          Benoit Tellier
        2. Screenshot from 2020-12-25 19-54-22.png
          211 kB
          Benoit Tellier
        3. Screenshot from 2020-12-25 19-54-30.png
          160 kB
          Benoit Tellier



            Unassigned Unassigned
            btellier Benoit Tellier
            0 Vote for this issue
            2 Start watching this issue