[horde] horde/imp migration problems, cpu bound on solaris

Vasilios Hoffman vhoffman01 at wesleyan.edu
Thu Apr 10 14:29:19 PDT 2003


So it looks like phpa accelerator DID make a big difference, but the
account I was using to test this (my account) was dogging on
IMP::flistSelect like you suggested.

I had set the folders setting to match that of the old IMP, which was
improperly set to empty years ago, and ruled it out because it was still
slow on other folks' accounts -- the login page alone used to take a
second to load and that doesn't use anything imap-related.

I changed folders to point to an empty subdirectory, and it takes 1.5
seconds on average to reload my inbox.  this is MUCH better.  login page
is pretty much instantaneous.

it's still a bit slow -- but this is what I get now:

Top of mailbox.php: 0.000136971473694, line 16
  end of function definitions: 0.000298023223877, line 85
  end require_once: 0.564681053162, line 108
  end checkAuthentication(): 1.25042200089,line 117
  initialize identities: 1.25144398212, line 159
  about to run through the action handlers: 1.25187897682, line 166
  done running through the action handlers: 1.25209105015, line 384
  begin IMP::flistSelect: 1.25223398209, line 390
  end IMP::flistSelect: 1.26253604889, line 394
  begin some inbox sorting: 1.26269495487, line 399
  end sorting: 1.26987802982, line 447
  end page logic: 1.27013897896, line 563
  end some other stuff: 1.28691506386, line 600
  done with requires of .inc: 1.34607005119, line 624
  about to build array of message info and sort order: 1.34637701511, line 628
  about to display message information: 1.37002897263, line 681
  now processing footer: 1.39535903931, line 910
  storing prefs: 1.45570099354, line 934
End of mailbox.php 1.45892906189, line 943

the includes still take ~.5 seconds:

$timestamp = getmicrotime() - $script_start;
fputs($profile,"  end of function definitions: $timestamp, line 85\n");
fflush($profile);

$set = false;
if (isset($new_lang)) {
    $language = $new_lang;
    $set = true;
}

define('IMP_BASE', dirname(__FILE__));
require_once IMP_BASE . '/lib/base.php';
require_once IMP_BASE . '/lib/Message.php';
require_once HORDE_BASE . '/lib/MIME.php';
require_once HORDE_BASE . '/lib/MIME/Part.php';
require_once HORDE_BASE . '/lib/MIME/Viewer.php';
require_once HORDE_BASE . '/config/mime_drivers.php';
require_once HORDE_BASE . '/config/mime_mapping.php';
require_once HORDE_BASE . '/config/html.php';
require_once IMP_BASE . '/config/html.php';
require_once IMP_BASE . '/config/mime_drivers.php';
require_once IMP_BASE . '/lib/Identity/IMP.php';

$timestamp = getmicrotime() - $script_start;
fputs($profile,"  end require_once: $timestamp, line 108\n");
fflush($profile);

and the checkAuthentication() still takes another .5 seconds:

$timestamp = getmicrotime() - $script_start;
fputs($profile,"  end require_once: $timestamp, line 108\n");
fflush($profile);

/* Initialize $actionID to a resonable value if it hasn't already been
set. */
$actionID = Horde::getFormData('actionID');

IMP::checkAuthentication();

$timestamp = getmicrotime() - $script_start;
fputs($profile,"  end checkAuthentication(): $timestamp,line 117\n");
fflush($profile);

which I'm assuming is another imap-related slowdown (btw imapproxy adds
another 1 second to the execution time, so I left it going straight to the
imap server).  but the require_once should be faster, and I'm guessing the
phpa accelerator might not be caching them?  I'll have to look into it.

So, in short, 1.5 seconds is much more manageable and is due to the phpa
accelerator and fixing the account I was using to test it.

I can migrate the existing system from an empty folder array in
servers.php to something more manageable.  I still would like to shave at
least another .5 seconds off that time, though, it still seems a bit slow.

But my hopes are raised.

Thanks to everybody so far, and if anybody has ideas to speed things up
further -- like replacing the require_once's with something else, etc,
I'll give it a try.

-V

On Thu, 10 Apr 2003, Eric Rostetter wrote:

> Quoting Vasilios Hoffman <vhoffman01 at wesleyan.edu>:
>
> > The 2 big, bad guys are IMP::flistSelect done here (with my code stuck
> > in, ~2.6 seconds):
>
> If you set your folder prefix wrong ('folders' parameter in
> imp/config/servers.php) it will index the whole account, or the whole
> system, rather than the user's folders, and result in slow load times.
>
> Either check what folders it is listing to make sure they are right,
> or post your servers.php info and imap software so we can check it.
>
> May not be a problem there, but it is the first thing I would check
> given your description.
>
> > and the "requires of .inc" which are from where I marked "other stuff" to
> > where I marked "done with requires of .inc" (~1.75 seconds):
>
> Including files is apparently a big hit, so Chuck has been reducing the
> number of includes recently.  But they should not be such a major hit
> as you imply, IMHO.
>
> > if (!empty($conf['hooks']['quota']) &&
> > function_exists($conf['hooks']['quota'])) {
> >     echo call_user_func($conf['hooks']['quota'], $imp);
> > }
>
> Any chance it is trying to use this hook?  Displaying quota info
> would be a performance hit.
>
> > I'm going to dig around and see what's holding those up.  If you folks,
> > who are more familiar with the code, gather any bright ideas from this...
> > please let me know.
>
> Ideas, but they don't seem so bright ;)
>
> > -V
>
> --
> Eric Rostetter
> The Department of Physics
> The University of Texas at Austin
>
> Why get even? Get odd!
>
> --
> Horde mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>




More information about the horde mailing list