Aaron Stone wrote:
It simply fills up a block of size READ_BLOCK_SIZE, inserts it, then start
filling another one.

Doesn't that break searching messages? Breaking up messages on a fixed char width is easiest of all, but then single words in messages could span messageblks. But then, READ_BLOCK_SIZE is .5 MB, and mails larger than that tend to be mime-encoded anyway.

<snip>

If GMIME has a callback architecture, we might be able to ask it to parse
messges in blocks of READ_BLOCK_SIZE, so we'd be able to retrieve rows from
the database one at a time and pass it on to GMIME.

Such callbacks probably can be only be implemented if messageblks are logical mime units, such as a full message or a mime-part. Or at the very least such logical mime parts would have to be reassembled before initializing a gmime object.

I'm not sure what the best way to handle this is, though. My thinking has
always revolved around handling huge messages without causing resource
starvation. So a gigabyte email should be parsed in pieces and not all
allocated into memory at once.

GB sized emails seem to me to be not-of-this-world at present. I'm quite certain most if not all isp have a cap on the max mailmessage size that's quite a lot smaller than that. Still, a valid guideline though.

But a four megabyte email might as well go into
memory. You'd have to get a heck of a lot of people each reading a four meg
email at once for that to be a major problem. But, since we want DBMail to be
properly scalable to really large installations, it is a distinct possibility
to have that many people each reading an email that large (scenario: the CEO
sounds out his latest crazy plan in a four meg powerpoint, and everyone in the
whole company starts pounding on the mail server to retrieve their copy.)

I guess only a real-world test can expose the actual bottlenecks involved. You got me thinking ...


--
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to