[rt-users] Huge memory leaks(httpd)

Michael van Elst mlelstv at dev.de.cw.net
Wed Aug 6 12:02:57 EDT 2003


On Wed, Aug 06, 2003, Ruslan U. Zakirov wrote:

> Questions:
>    1) Why rt-mailgate uses so much memory? Does it convert encodings?

rt-mailgate sends the raw mail via HTTP to the webserver, to do this
it has to convert it to the 'application/x-www-form-urlencoded' format.

I had a glance at the LWP modules that do this and these keep at least
6 copies of the mail in memory plus 2 copies of the converted string,
which is slightly larger. But seeing that rt-mailgate grew to 14 times
the size of the mail, as you wrote, I have probably overlooked a few
copies.


>    2) If mail size 5MB Base64 encoded(orig mail enc is ISO-8895-1) then 
> what size of data will be inserted in mySQL?

Depends. The base64 encoded part will be decoded and shrink, if it
is text inside it will be converted to UTF8 and grow slightly (depending
on the number of non-ASCII characters). If it's all non-ASCII characters
it could double in size.

But I doubt that you have 5MB _text_. It's probably more like 5MB _data_
which is therefore stored in about 3.75MB.

With Postgres the situation is worse as everything is again Base64 converted
if there is a single '\0'-Byte in the data.


>    3.1) $MaxAttachmentSize - it's UTF-8 Encoded or Base64 or original size?

AFAIK it is the size of the attachment, i.e. Base64 if the mail is
Base64 encoded.

>    3.2) Should $MaxAttachmentSize(RT) be equal to 
> max_allowed_packet(mySQL)?

Regarding MySQL, yes. I am not sure if "exactly equal" works, so I would
take the safe road and set it slightly smaller to avoid overflows.

Seeing the above issues of RT handling huge mails, I would set it much
smaller. But that depends on your requirements, if you absolutely must
handle such huge mails with RT then you have no other choice.

Greetings,
-- 
    ,eM""=.            a"-.                         Michael van Elst
   dWWMWM" -          :GM==;                        mlelstv at dev.de.cw.net
  :WWMWMw=--.          "W='  cable & wireless
   9WWMm==-.
    "-Wmw-"  CABLE & WIRELESS



More information about the rt-users mailing list