Re: Scripts slowing down?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter Ford a écrit :
René Leboeuf wrote:
Hi.

I'm running a large website. I have some mailing scripts that take days
to run.

I noticed these scripts slow down with time, sometimes going to an
almost complete stop (no mail sent for several minutes).

The source code is trivial and can't contain a loop. I monitored the
memory usage and couldn't find a memory leak. Using APD, most of the
time is reported to be spent in the fgets() function (script waiting for
a sendmail reply). But sendmail still replies swiftly when this problem
occurs.

By this, I guesss you mean that other connections to sendmail reply swiftly: so the server is not just jamming up completely and refusing requests ?

Right, I can still create new connections that perform well, with no noticeable delay when talking to sendmail. The mail queue doesn't grow.



It might depend on the exact implementation of 'sendmail': for example, the Courier mail system which I use replaces the program 'sendmail' with it's own binary to do the job. Courier also has a 'tar-pitting' feature which is triggered by behaviour that looks like a spammer is trying to relay stuff: it atificially slows the response to the send requests if there is an unreasonably high rate of requests coming from a given source. At least that's how I understand the feature to work. Other mail system may implement a similar feature - it might just be that your mailing script looks like a spam engine to the mail server.

I disabled all the limiting features of sendmail without result (QUEUE_LA, REFUSE_LA, confBAD_RCPT_THROTTLE...) The user sending emails is "trusted" by sendmail, and the sending program is located on the sendmail machine.



Restarting sendmail has no effect on these scripts. Restarting the
scripts makes them run like hell for some hours, until the problem rises
again.

I'm using PHP 5.2.5

I don't know where to look next for the source of this problem...

I think you need to provide some more detail - you could start by explaining what method you use to send the messages. The next thing to do is to look at the mail logs and see if there are any messages written around the time that yourt script runs. Don't always assume that it is your code that is wrong (that's what managers are for)


Mail is sent via PHPMailer. PHPMailer offers to send mail via PHP's mail() function, or by calling the sendmail program or using SMTP. SMTP may use persistent connections or not. All these modes were tested and they all slow down after a while. I didn't notice anything special in the maillog or other logs on the machine.

Thanks for your help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux