Re: [Exim] High Load

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Philip Hazel
Data:  
Para: Christopher Curtis
CC: Exim Users Mailing List
Assunto: Re: [Exim] High Load
On Thu, 6 Dec 2001, Christopher Curtis wrote:

> The message isn't that large. I have both sender and recipient verify, as
> well as some system filters installed. Immediately after the process gets
> unstuck, ltrace continues with:
>
> mail:~# ltrace -p 7733
> strchr("_", '_')                                  = "_"
> strncmp("message_body", "header_", 7)             = 5
> strncmp("message_body", "h_", 2)                  = 5
> strcmp("message_body", "primary_hostname")        = -3
> strcmp("message_body", "message_age")             = 1
> strcmp("message_body", "n4")                      = -1
> strcmp("message_body", "message_precedence")      = -14
> strcmp("message_body", "message_body_size")       = -95
> strcmp("message_body", "message_body_end")        = -95
> strcmp("message_body", "message_body")            = 0


This shows that it is expanding the variable $message_body. That loop is
searching the list of variable names (by binary chop). So, this means
that the tight loop is happening when processing some expansion string
containing $message_body.

Do you have any such strings in your Exim configuration? Or in your Exim
filter? If so, what are they? What comes immediately before
$message_body?

Just a thought: are you using any regular expressions?

> Just from looking at this, exim appears to enter some sort of really tight
> loop with no system calls being made. Hopefully the trace will show which
> one.


Unfortunately, that information doesn't show where that code has been
called from.

> Also, I haven't looked at the source (obviously), but might I
> suggest replacing code that may look like this:
>
> for( index = 0; index < length; index++, ptr++ )
>    strncpy( ptr, char, 1 );


I'd never write that! I wouldn't call a function to copy just one character.
So what is causing this trace?

> malloc(8192)                                      = 0x080d9260


That's a malloc call.

> memcpy(0x080d9268, "", 0)                         = 0x080d9268


The code for that is
      body[0] = 0;
Is your Exim compiled in some kind of debugging mode? I would have
expected a compiler to compile inline code for that statement.


> strncpy(0x080d9268, "This is a multi-part message in "..., 5000) =
> 0x080d9268


The code for that is (presumably)

      lseek(deliver_datafile, start_offset, SEEK_SET);
      len = read(deliver_datafile, body, len);


> strncpy(0x080da5f8, "a", 1)                       = 0x080da5f8
> strncpy(0x080da5f9, "\\", 1)                      = 0x080da5f9
> strncpy(0x080da5fa, "s", 1)                       = 0x080da5fa
> strncpy(0x080da5fb, "h", 1)                       = 0x080da5fb
> strncpy(0x080da5fc, "r", 1)                       = 0x080da5fc
> strncpy(0x080da5fd, "e", 1)                       = 0x080da5fd


No idea what all that is.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.