Subject: mbx performance

From: "Thomas Smith" <[email-masked]>
Date: Tue, 25 May 2004 14:30:58 -0700 (MST)

I converted all of my mbox mailboxes to mbx. I've noticed an increase in
performance for my web-based IMAP client. However, I continue to have a
problem that existed prior to the conversion.

As I understand it, mbx is more memory efficient than mbox. This being the
case, shouldn't it consume less RAM while a mailbox is being read by an
IMAP client? This doesn't seem to be happening in my situation.

For example, I use SquirrellMail for webmail. There are system-wide
resource restrictions on RAM usage preventing any user from utilizing more
than 8 MB of RAM via SquirrellMail.

My Sent folder would always exceed this amount when I selected "View
All"--there are over 3700 emails stored there. I continue to get the error
after the conversion to mbx.

Am I missing something or did I misinterprete what I read?

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Brad Arlt <[email-masked]>
Date: Tue, 25 May 2004 15:59:14 -0600

> IMAP client? This doesn't seem to be happening in my situation.

I'd say it should use more RAM, not less.  Speed increases rarely mean
memory footprint decreases.

> Am I missing something or did I misinterprete what I read?

Me thinks you have.  PHP has a default memory limit of 8MB.  I used to
increase this to 16MB, but of late was forced to make it 20MB - after
which I have had no complaints.

In your php.ini file you will want to change or add a "memory_limit"
line to look something like:

memory_limit = 20M

Your magic number for a memory limit may vary, or you may want to
remove the memory limit.
-----------------------------------------------------------------------
   __o		Bradley Arlt			Security Team Lead
 _ \<_		[email-masked]		University Of Calgary
(_)/(_) 	Las hojas de coca no es droga. 	Computer Science

---

From: Mark Crispin <[email-masked]>
Date: Tue, 25 May 2004 15:07:43 -0700 (Pacific Daylight Time)

On Tue, 25 May 2004, Thomas Smith wrote:
> As I understand it, mbx is more memory efficient than mbox.

mbx is more memory-efficient than mbox, but that's only because there is 
no need to convert UNIX-style LF-only strings to Internet standard CRLF 
strings since mbx is native CRLF.

With the exception of very large message texts, the resulting memory (and 
CPU) savings is generally too small to notice.

> There are system-wide

In a best case scenario, 8MB means that there is only about 2K of 
per-message memory for a 3700 message mailbox.  Of course, there is no 
such thing as a best case scenario, since there are more users of memory 
that per-message memory.

You were able to open the mailbox since the basic per-message data 
(message status, sizes, internal dates) isn't that big.  But the "view 
all" probably did an RFC2822/MIME parse of all 3700 messages, and that 
amount of data is much more than 8MB.

Don't forget, once the IMAP server does an RFC2822/MIME parse, it 
remembers those results instead of re-doing the parse over and over again.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: "Jason Munro" <[email-masked]>
Date: Tue, 25 May 2004 17:16:03 -0500

On 4:30:58 pm 05/25/04 "Thomas Smith" <[email-masked]> wrote:
> I converted all of my mbox mailboxes to mbx. I've noticed an increase
> in performance for my web-based IMAP client. However, I continue to
> have a problem that existed prior to the conversion.
>
> As I understand it, mbx is more memory efficient than mbox. This
> being the case, shouldn't it consume less RAM while a mailbox is
> being read by an IMAP client? This doesn't seem to be happening in my
> situation.
> resource restrictions on RAM usage preventing any user from utilizing
> more than 8 MB of RAM via SquirrellMail.
>
> All"--there are over 3700 emails stored there. I continue to get the
> error after the conversion to mbx.
>

The 8MB restriction in squirrelmail is the PHP limit for script execution
(php.ini setting). In the case of "show all" on 3700 messages squirrelmail
is building a header list in memory of all messages, which combined with
the other memory requirements of squirrelmail, pops the limit. Remember
that in this case the IMAP client  does not care what kind of mailbox the
IMAP server uses, it uses the same commands to retrieve information. A
mailbox type with a zero memory footprint (in terms of the IMAP server
memory usage) would still not alter the amount of memory the PHP script
needs to store the fetched header values. I recommended to the squirrelmail
developers not so long ago that they remove the "show all" links when the
IMAP folder is over 500 messages, specificly to address this type of issue.

\__ Jason Munro
 \__ [email-masked]
  \__ http://hastymail.sourceforge.net/

---

From: Mark Crispin <[email-masked]>
Date: Tue, 25 May 2004 15:11:47 -0700 (Pacific Daylight Time)

> memory footprint decreases.

Actually, in the case of traditional UNIX -> mbx there is a modest memory 
improvement as well as a speed gain.

-- Mark --