[imp] Hardware request ( RAM ) of WebMail System

Matus UHLAR - fantomas uhlar at fantomas.sk
Tue Jan 9 03:21:44 PST 2007


On 05.01.07 21:55, Paul Holt wrote:
> On Friday 05 January 2007 19:44, Matus UHLAR - fantomas wrote:
> > imp takes up much memory when displaying some messages, especially those
> > with big image attachments. for processing 10MB attachments, PHP may take
> > even 60 MB of RAM, and with images it's even worse (they are often
> > decompressed in server's memory). If you plan to have many concurrent
> > users, you may need much more of RAM.
> 
> Argh. We had these problems too. You see there are points in IMP and Pear
> MIME where the entire message is handled up to three times, and therefore
> there are briefly three copies in memory. If the attachment is base64
> encoded, add another 40%, so you get 10*3*1.4=42MB just for the
> attachment.

looking at the code some time before (or at least, looking at logs, seeing
which functions try to allocate memory over limit) it seems that main
problem is (un)escaping the data in mime functions.

> I went through the IMP 2.* code at one stage, and cut it back to having
> only two copies in memory at a time maximum. I also did a version trying
> to do all message manipulations in a temporary file, I was able to have
> just one string in memory at a time, but this proved unstable... though it
> could be done again.

I think that having binary modules for encoding and decoding MIME messages
would help most of problems - it even would be faster, which would decrease
the total server's memory usage.
-- 
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Remember half the people you know are below average. 


More information about the imp mailing list