Hello.
I was looking at the header and structure objects that are stored in the database. It doesn't seem like the message body is stored in the object. IMAP connections are really expensive for web-based mail clients since they have to be re-established every time a php page is executed. If the message body was stored in the database you could avoid making the IMAP connection and probably shave a second or two off the time it takes to (re)read a message. You could even take is a step further and store the whole body in a blob so attachments could be read without making an imap connection. This would only really start to help when you revisit the message, the first time would take the most time.
Any input? Is this a horrible idea? You guys seem pretty smart so I am sure you've considered this.
Michael
List info: http://lists.roundcube.net/dev/
Michael wrote:
Hello.
I was looking at the header and structure objects that are stored in the database. It doesn't seem like the message body is stored in the object. IMAP connections are really expensive for web-based mail clients since they have to be re-established every time a php page is executed. If the message body was stored in the database you could avoid making the IMAP connection and probably shave a second or two off the time it takes to (re)read a message. You could even take is a step further and store the whole body in a blob so attachments could be read without making an imap connection. This would only really start to help when you revisit the message, the first time would take the most time.
This will probably bloat the database like hell. Consider thousands of users having thousands of messages with attachments. If the size of the database grows, it takes even longer to load data because of a higher seeking time. Also opening a single message is less expensive than listing hundred of headers. This is why we just cache headers.
The second reason are multipart messages. RoundCube is currently not able to parse a mulipart message and extract its parts. This is all done by the IMAP server, RoundCube just requests the structure and then loads one single part of the message on demand.
Parsing mime messages isn't that simple because most mails are malformed. IMAP servers implement that because it's part of the specification. So why re-invent the wheel?
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
On Wed, Jun 11, 2008 at 09:32:51AM +0200, Thomas Bruederli wrote:
This will probably bloat the database like hell. Consider thousands of users having thousands of messages with attachments. If the size of the database grows, it takes even longer to load data because of a higher seeking time. Also opening a single message is less expensive than listing hundred of headers. This is why we just cache headers.
Would it help if you only request the 20-some headers that are to be displayed? If the IMAP server does the sorting, RoundCube doesn't need to know about all of the messages in a folder.
I think, that could make sense, if those caches would be flushed regularly depending no how many users are there. And I don't think, mysql would be too good for that, I'd prefer some kind of serialized data in files.
On Wed, 11 Jun 2008 11:30:36 +0200 Andreas andreas@unstable.nl wrote:
On Wed, Jun 11, 2008 at 09:32:51AM +0200, Thomas Bruederli wrote:
This will probably bloat the database like hell. Consider thousands of users having thousands of messages with attachments. If the size of the database grows, it takes even longer to load data because of a higher seeking time. Also opening a single message is less expensive than listing hundred of headers. This is why we just cache headers.
Would it help if you only request the 20-some headers that are to be displayed? If the IMAP server does the sorting, RoundCube doesn't need to know about all of the messages in a folder.