php-general Digest 12 Jan 2008 17:38:15 -0000 Issue 5231

Topics (messages 267137 through 267154):

Re: SMTP vs mail()
        267137 by: Per Jessen
        267138 by: Per Jessen
        267139 by: Richard Heyes
        267140 by: Per Jessen
        267141 by: Richard Heyes
        267142 by: Per Jessen
        267144 by: Richard Heyes
        267145 by: Scott Wilcox

Re: Posting Summary for Week Ending 11 January, 2008: [EMAIL PROTECTED]
        267143 by: Scott Wilcox
        267152 by: David Giragosian

Re: PHP shell commands
        267146 by: Lucas Prado Melo

XML Data merging
        267147 by: Naz Gassiep
        267153 by: Eric Butera
        267154 by: Steve Edberg

Re: Posting Summary for Week Ending 11 January, 2008:
        267148 by: tedd
        267149 by: tedd
        267150 by: Zoltán Németh
        267151 by: Nathan Nobbe

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Richard Heyes wrote:

>> Assuming you're talking delivery to a local MTA (which will
>> subsequently do the remote delivery), is speed really important?
> 
> For the amount of email I'm looking at (1000s, growing), yes.
> 

Hmm, that's not quite what I was thinking of.  The amount of emails to
be delivered does not in my opinion affect how fast it needs to happen. 
Your local MTA will take a while to deliver those emails anyway, so the
time from script to user is mostly dependent on that, which means
you're left with reducing the time from script to MTA.  If you need to
finish the script fast (in order for some user-intercation to continue
perhaps), I would would just detach the script and carry on. 


/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
Manuel Lemos wrote:

> Still if you want the fastest delivery in the world, you can skip
> queueing and talk directly to the final SMTP server. That is what the
> direct_delivery mode of this SMTP class does. I use it for deliverying
> really urgent messages. It uses PHP only, there is no sendmail or any
> MTA in the middle. That is why it is the fastest solution. 

Unless you're running on the mail-server or being NAT'ed through the
same, this is not advisable.  You run a significant risk of getting
your emails caught as spam. 

> TCP connections are not a good idea for local connections. That is why
> under Linux/Unix there are Unix domain sockets which are basically
> pipes for inter-program communication.

TCP connections are just fine for local connections.  And on some
platforms/setups they're even faster than Unix domain sockets. 


/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
Assuming you're talking delivery to a local MTA (which will
subsequently do the remote delivery), is speed really important?
For the amount of email I'm looking at (1000s, growing), yes.


Hmm, that's not quite what I was thinking of.  The amount of emails to
be delivered does not in my opinion affect how fast it needs to happen. Your local MTA will take a while to deliver those emails anyway, so the
time from script to user is mostly dependent on that, which means
you're left with reducing the time from script to MTA.  If you need to
finish the script fast (in order for some user-intercation to continue
perhaps), I would would just detach the script and carry on.

Sorry, yes the time of delivery is not so important as the time to pump the messages to the MTA. As long as the MTA has them and they get delivered in a reasonable time frame I'm happy. The application is all about mail delivery and the script has to return immediately, so I'll be launching a separate process to insert the addresses into a minimal "mail_queue" table in my db, and then a 5 minutely cron script which will pass them to the MTA.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

--- End Message ---
--- Begin Message ---
Richard Heyes wrote:

> Bearing in mind I haven't yet done any benchmarks, which do you think
> is faster - SMTP with multiple RCPT commands or the PHP mail()
> function (with it launching a separate sendmail process for each
> mail() function call)?
> 

I've done some rough benchmarking - 

1. Using mail(), same email sent to 1000 users.

Script finished in 200ms (1000 emails delivered to local MTA). 
Delivery to target MTA over 100Mbit LAN took about 6s.

2. Using mail(), same email sent to 10000 users (in blocks of 1000
recipients).

Script finished in 2.6s (10000 emails delivered to local MTA). 
Delivery to target MTA over 100Mbit LAN took about 4m20s.

3. Using mail(), but individual emails sent to 1000 users.

Script finished in 59s (1000 emails delivered to local MTA). 
Delivery to target MTA over 100Mbit LAN took about 60s.

4. I didn't bother with 10000 individual emails.

5. Repeat case 3, but actual calls of mail() forked using pcntl_fork. 

50ms.  I didn't bother timing the delivery to target MTA, but I estimate
the same as in case 3.

6. Same email to 1000 users sent by piping to "sendmail -oi -t"

60ms. I didn't bother timing the delivery to target MTA.

7. Same email to 10000 users sent by piping to "sendmail -oi -t"

230ms.  I didn't bother timing the delivery to target MTA.

8. Same email to 100000 users sent by piping to "sendmail -oi -t"

2.4s. I didn't bother timing the delivery to target MTA.

Hardware was a plain P4, 2.4GHz running openSUSE.


You might be able to beat cases 6-7-8 by doing direct SMTP, but I doubt
if it'll be worth your effort. 



/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
1. Using mail(), same email sent to 1000 users.

Script finished in 200ms (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 6s.

That settles it then. The mail() command will be more than fast enough for my needs.

Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

--- End Message ---
--- Begin Message ---
Richard Heyes wrote:

>> 1. Using mail(), same email sent to 1000 users.
>> 
>> Script finished in 200ms (1000 emails delivered to local MTA).
>> Delivery to target MTA over 100Mbit LAN took about 6s.
> 
> That settles it then. The mail() command will be more than fast enough
> for my needs.
> 
> Thanks.

Note - this was one call to mail():  

mail("<user1>,<user2>,<user3> ......",subject,text);


/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
Note - this was one call to mail():
mail("<user1>,<user2>,<user3> ......",subject,text);

Granted, but as long as the email stays the same size when you compare mail() and something like SMTP, I wouldn't imagine the relative speeds varying significantly. Or maybe they would, I'll compare and see.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

--- End Message ---
--- Begin Message ---


Per Jessen wrote:
Richard Heyes wrote:

Bearing in mind I haven't yet done any benchmarks, which do you think
is faster - SMTP with multiple RCPT commands or the PHP mail()
function (with it launching a separate sendmail process for each
mail() function call)?


I've done some rough benchmarking -
1. Using mail(), same email sent to 1000 users.

Script finished in 200ms (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 6s.

2. Using mail(), same email sent to 10000 users (in blocks of 1000
recipients).

Script finished in 2.6s (10000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 4m20s.

3. Using mail(), but individual emails sent to 1000 users.

Script finished in 59s (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 60s.

4. I didn't bother with 10000 individual emails.

5. Repeat case 3, but actual calls of mail() forked using pcntl_fork.
50ms.  I didn't bother timing the delivery to target MTA, but I estimate
the same as in case 3.

6. Same email to 1000 users sent by piping to "sendmail -oi -t"

60ms. I didn't bother timing the delivery to target MTA.

7. Same email to 10000 users sent by piping to "sendmail -oi -t"

230ms.  I didn't bother timing the delivery to target MTA.

8. Same email to 100000 users sent by piping to "sendmail -oi -t"

2.4s. I didn't bother timing the delivery to target MTA.

Hardware was a plain P4, 2.4GHz running openSUSE.


You might be able to beat cases 6-7-8 by doing direct SMTP, but I doubt
if it'll be worth your effort.


/Per Jessen, Zürich

Per's results were pretty much as i'd expected :)

--- End Message ---
--- Begin Message ---
well thats just no good is it :P

Thats pretty funky, congrats on the concept and implementation :)

Daniel Brown wrote:
On Jan 11, 2008 4:11 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
Hate to shot a hole in your script Dan... But my posts aren't
listed :P and I had a few on Jan 8 :)

Where should I file a bug report?

    Well, that's the other interesting thing.  As Tedd and David from
the list know, on the morning of 8 January, there was a total disk
failure, which was immediately followed by some sort of
miscommunication at the datacenter.  The server just finally had the
drive replaced and the server placed back online this afternoon.  So
we'll apparently have to wait until next week to see accurate weekly
results.


--- End Message ---
--- Begin Message ---
On 1/12/08, Scott Wilcox <[EMAIL PROTECTED]> wrote:
>
> well thats just no good is it :P
>
> Thats pretty funky, congrats on the concept and implementation :)
>
> Daniel Brown wrote:
> > On Jan 11, 2008 4:11 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
> >
> >> Hate to shot a hole in your script Dan... But my posts aren't
> >> listed :P and I had a few on Jan 8 :)
> >>
> >> Where should I file a bug report?
> >>
> >
> >     Well, that's the other interesting thing.  As Tedd and David from
> > the list know, on the morning of 8 January, there was a total disk
> > failure, which was immediately followed by some sort of
> > miscommunication at the datacenter.  The server just finally had the
> > drive replaced and the server placed back online this afternoon.  So
> > we'll apparently have to wait until next week to see accurate weekly
> > results.
> >
> >
>

It will be interesting to see what effect the statistical reporting of posts
will have on the number of posts, individually and collectively, made to the
list.

"Heisenberg's Uncertainty Principle" anyone?

David

--- End Message ---
--- Begin Message ---
On Jan 12, 2008 4:12 AM, Andrés Robinet <[EMAIL PROTECTED]> wrote:
> I guess what you are looking for is mod_suphp. STFW or ask the list, someone
> will give you good hints for sure (sorry, have little time right now).
>
> Rob
Thanks, I will take a look.

--- End Message ---
--- Begin Message --- I'm using simplexml to fetch data from a set of data files. If I have two files, and one is an update to the other, is there an easy way to merge the two files together, rather than having write logic that checks one and then the other?

Both files conform to the same DTD and thus the data in the update will perfectly eclipse the data in the main file. If I can do this it would save me writing a whole bunch of logic.

Thanks,
- Naz.

--- End Message ---
--- Begin Message ---
On 1/12/08, Naz Gassiep <[EMAIL PROTECTED]> wrote:
> I'm using simplexml to fetch data from a set of data files. If I have
> two files, and one is an update to the other, is there an easy way to
> merge the two files together, rather than having write logic that checks
> one and then the other?
>
> Both files conform to the same DTD and thus the data in the update will
> perfectly eclipse the data in the main file. If I can do this it would
> save me writing a whole bunch of logic.
>
> Thanks,
> - Naz.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

diff!

--- End Message ---
--- Begin Message ---
At 12:10 PM -0500 1/12/08, Eric Butera wrote:
On 1/12/08, Naz Gassiep <[EMAIL PROTECTED]> wrote:
 I'm using simplexml to fetch data from a set of data files. If I have
 two files, and one is an update to the other, is there an easy way to
 merge the two files together, rather than having write logic that checks
 one and then the other?

 Both files conform to the same DTD and thus the data in the update will
 perfectly eclipse the data in the main file. If I can do this it would
 save me writing a whole bunch of logic.

 Thanks,
 - Naz.

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



diff!


...Although your standard diff wouldn't account for files that parse identically but have slightly different but functionally identical XML (eg; differing case/whitespace in tags, different order of attributes). That's what tools like XMLdiff (python) -

        http://www.logilab.org/project/xmldiff

- xmldiff (perl) -

        http://www.xml.com/pub/r/1354

- xmldiffpatch (MS executable) -

        http://msdn2.microsoft.com/en-us/library/aa302294.aspx

- and probably numerous others are for. Here's a possibly-useful article:

        http://www.xmlhack.com/read.php?item=1681

Disclaimer: I've never used any of those tools, so YMMV, IANAL, RTFM, LOL, etc...

        steve


--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg                                http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center                            [EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin             (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+

--- End Message ---
--- Begin Message ---
At 4:00 PM -0500 1/11/08, PostTrack [Dan Brown] wrote:
        Posting Summary for PHP-General List
        Week Ending: Friday, 11 January, 2008

        Messages        | Bytes           | Sender
        ----------------+-----------------+------------------
        226 (100%)         255776 (100%)      EVERYONE
81 (0.36%) 43996 (0.17%) "PostTrack [Dan Brown]" <[EMAIL PROTECTED]> 20 (0.09%) 23643 (0.09%) "Daniel Brown" <[EMAIL PROTECTED]> 11 (0.05%) 5291 (0.02%) "PostTrack [Dan Brown]" <[EMAIL PROTECTED]>
        8    (0.04%)      11635    (0.05%)      tedd <[EMAIL PROTECTED]>

If I flood the list with post, can I get the top position?  :-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
At 4:10 PM -0500 1/11/08, Daniel Brown wrote:
    THAT was the way it was supposed to work.  Though in all of the
chaos, I forgot to fix the percentage factoring.

It might be interesting to see how "focused" the posts are.

For example, two people answering the same thread make the same comment. However, one trims the amount of the previous post to what's relevant and the other doesn't.

In that example, the first reply is more "focused" and thus should receive a higher "focused-score".

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
2008. 01. 12, szombat keltezéssel 10.25-kor tedd ezt írta:
> At 4:00 PM -0500 1/11/08, PostTrack [Dan Brown] wrote:
> >     Posting Summary for PHP-General List
> >     Week Ending: Friday, 11 January, 2008
> >
> >     Messages        | Bytes           | Sender
> >     ----------------+-----------------+------------------
> >     226 (100%)         255776 (100%)      EVERYONE
> >     81    (0.36%)      43996    (0.17%)      "PostTrack [Dan 
> >Brown]" <[EMAIL PROTECTED]>
> >     20    (0.09%)      23643    (0.09%)      "Daniel Brown" 
> ><[EMAIL PROTECTED]>
> >     11    (0.05%)      5291    (0.02%)      "PostTrack [Dan 
> >Brown]" <[EMAIL PROTECTED]>
>       8    (0.04%)      11635    (0.05%)      tedd <[EMAIL PROTECTED]>
> 
> If I flood the list with post, can I get the top position?  :-)

of course. that's what this is all about. its a 'who can flood more'
contest ;)

(sorry Dan I just couldn't resist)

greets
Zoltán Németh

> 
> Cheers,
> 
> tedd
> 
> -- 
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 

--- End Message ---
--- Begin Message ---
On Jan 12, 2008 10:41 AM, Zoltán Németh <[EMAIL PROTECTED]> wrote:

> 2008. 01. 12, szombat keltezéssel 10.25-kor tedd ezt írta:
> > At 4:00 PM -0500 1/11/08, PostTrack [Dan Brown] wrote:
> > >     Posting Summary for PHP-General List
> > >     Week Ending: Friday, 11 January, 2008
> > >
> > >     Messages        | Bytes           | Sender
> > >     ----------------+-----------------+------------------
> > >     226 (100%)         255776 (100%)      EVERYONE
> > >     81    (0.36%)      43996    (0.17%)      "PostTrack [Dan
> > >Brown]" <[EMAIL PROTECTED]>
> > >     20    (0.09%)      23643    (0.09%)      "Daniel Brown"
> > ><[EMAIL PROTECTED]>
> > >     11    (0.05%)      5291    (0.02%)      "PostTrack [Dan
> > >Brown]" <[EMAIL PROTECTED]>
> >       8    (0.04%)      11635    (0.05%)      tedd <
> [EMAIL PROTECTED]>
> >
> > If I flood the list with post, can I get the top position?  :-)
>
> of course. that's what this is all about. its a 'who can flood more'
> contest ;)


you could just spam each thread w/ some benign comments;
herein is my first attempt ;)

-nathan

--- End Message ---

Reply via email to