[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: load average: 5,60 at 5 smtpprocesses !?



On 14-08-2003 at 04:57:53PM +0100, Alex Kiernan wrote:
> Bartek Krajnik <bartek@indigo.pl> writes:
> >   Why smtpserver need so many processor cycles?
> 
> Could be the bug I saw here - if you're hitting the maximum number of
> connects from a single host it attempts to use the output buffer to
> send the failure message, but the memory for it hasn't been allocated,
> so it ends up spinning. This seemed to fix it for me:
> 
> Index: smtpserver/smtpserver.c
> ===================================================================
> RCS file: /upstream-repositories/anoncvs.zmailer.org/zmailer/smtpserver/smtpserver.c,v
> retrieving revision 1.147
> diff -u -r1.147 smtpserver.c
> --- smtpserver/smtpserver.c     2003/06/09 13:18:22     1.147
> +++ smtpserver/smtpserver.c     2003/08/14 15:57:59
> @@ -1928,6 +1928,11 @@
>      SS->s_bufread   = -1;
>      SS->s_ungetcbuf = -1;
>      SS->s_readout = 0;
> +    /* Actually all modes use this write-out buffer */
> +    SS->sslwrbuf = emalloc(8192);
> +    SS->sslwrspace = 8192;
> +    SS->sslwrin = SS->sslwrout = 0;
> +
>   
>      fd_nonblockingmode(infd);
>      fd_nonblockingmode(outfd);
> @@ -2081,11 +2086,6 @@
>  #endif /* - HAVE_OPENSSL */
>        }
>      }
> -
> -    /* Actually all modes use this write-out buffer */
> -    SS->sslwrbuf = emalloc(8192);
> -    SS->sslwrspace = 8192;
> -    SS->sslwrin = SS->sslwrout = 0;
>   
>  #ifdef HAVE_OPENSSL
>      if (ssmtp_connected) {
> 
That's it.
Now is OK.
Thanks.

Rgrds,
  Bartek.
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi