Re: [PHP] Re: Scripts slowing down?
Per Jessen a écrit : They _all_ slow down after a while? How many emails are you sending in this way? Some of our mailing are +100.000 emails... There is a possibility that your filesystem is having difficulties dealing with that many files, escpecially if they are all in one directory. Which mailserver and which filesystem are you using? This is sendmail 8.13.1 (RHEL4) on ext3. We consider moving to ReiserFS. There are 50queues split on 5disks, but it is very rare to have more than a total of 3.000mails waiting in the queues. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Scripts slowing down?
Per Jessen a écrit : René Leboeuf wrote: The user sending emails is "trusted" by sendmail, and the sending program is located on the sendmail machine. No need to use SMTP then. You should just be calling sendmail to drop the emails into the queue. And that should not be slowing down. According to our tests, using SMTP is twice as fast as calling sendmail! 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. They _all_ slow down after a while? How many emails are you sending in this way? Some of our mailing are +100.000 emails... It's easily tested. Just generate a script with 1 calls to the mail() function (send to [EMAIL PROTECTED] with N = random number). If that goes through without slowing down, mail() and your sendmail daemon are not to blame. I had tried with 1000mails and noticed no slow down. I'll try with some more. But if mail() and sendmail are not the problem, what could it be??? Thanks for helping. DJL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Scripts slowing down?
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
Re: [PHP] Scripts slowing down?
Per Jessen a écrit : René Leboeuf wrote: 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. It sounds like you are using SMTP to talk directly to your sendmail daemon? Yes, SMTP code is provided by phpmailer. Restarting sendmail has no effect on these scripts. Restarting the scripts makes them run like hell for some hours, until the problem rises again. So, if there is no loop in your script, what _does_ it contain? Oops... The code can't contain a INFINITE loop... Of course, there is a loop through all the members! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Scripts slowing down?
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. 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... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php