Perl vs PHP speed?

Discussion in 'Perl Misc' started by Jan, Mar 1, 2006.

  1. Jan

    Jan Guest

    We expect about 570 new visitors every minute on our web page
    containing a form, 17 of these will press a submit button to invoke the
    PHP (alternatively CGI perl).

    Would you expect the performance hit to noticeable at this volume, thus
    we should consider a cgi-bin perl instead of PHP (parser is loaded).
    Perl is after all never invoked unless submit is pressed.

    We would also like to store the referrer in a cookie when someone
    enters the page, this could be done with PHP. Maybe javascript is
    quicker (avoiding PHP parser)?
     
    Jan, Mar 1, 2006
    #1
    1. Advertising

  2. Jan

    J. Gleixner Guest

    Jan wrote:
    > We expect about 570 new visitors every minute on our web page
    > containing a form, 17 of these will press a submit button to invoke the
    > PHP (alternatively CGI perl).
    >
    > Would you expect the performance hit to noticeable at this volume, thus
    > we should consider a cgi-bin perl instead of PHP (parser is loaded).
    > Perl is after all never invoked unless submit is pressed.
    >
    > We would also like to store the referrer in a cookie when someone
    > enters the page, this could be done with PHP. Maybe javascript is
    > quicker (avoiding PHP parser)?


    Nothing to do with perl, however any time you can serve a static page,
    it'll be faster than anything else.

    No one can accurately answer your question, with the information you
    provided, besides this is the wrong newsgroup to discuss your Web site's
    performance. Your best bet is to benchmark your design yourself. Apache
    comes with a nice benchmark application called 'ab', which might prove
    useful.
     
    J. Gleixner, Mar 1, 2006
    #2
    1. Advertising

  3. J. Gleixner wrote:
    > Jan wrote:
    >> We expect about 570 new visitors every minute on our web page
    >> containing a form, 17 of these will press a submit button to invoke the
    >> PHP (alternatively CGI perl).
    >>
    >> Would you expect the performance hit to noticeable at this volume, thus
    >> we should consider a cgi-bin perl instead of PHP (parser is loaded).
    >> Perl is after all never invoked unless submit is pressed.

    >
    > Nothing to do with perl,


    That's obviously a BS remark. (I agreed on the rest of your reply, though.)

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Mar 1, 2006
    #3
  4. Jan

    Matt Garrish Guest

    "Jan" <> wrote in message
    news:...
    > We expect about 570 new visitors every minute on our web page
    > containing a form, 17 of these will press a submit button to invoke the
    > PHP (alternatively CGI perl).
    >
    > Would you expect the performance hit to noticeable at this volume, thus
    > we should consider a cgi-bin perl instead of PHP (parser is loaded).
    > Perl is after all never invoked unless submit is pressed.
    >


    17 form submissions a minute? Doesn't sound like a lot, but it would depend
    on how well/poorly written your script is, how much data and validation is
    involved, etc., etc. etc.

    As for Perl vs. PHP, life's not that simple. Are you talking about starting
    a new instance of the perl interpreter for each request? Or is this a
    mod_perl environment? PerlIS? Perl with FastCGI? And for PHP are you using
    mod_php? Are you using the Zend Platform? Are you...

    And are there multiple servers handling these requests? And what kind of
    servers are they? And...

    Do you see why you're not likely to get any kind of meaningful response? You
    should do your own benchmarking of both if you really want to know (if
    you're just testing one form, it shouldn't be too onerous to construct a
    Perl and PHP equivalent).

    Matt
     
    Matt Garrish, Mar 1, 2006
    #4
  5. Jan

    Jan Guest

    17/minute is not that much when using CGI-BIN (not mod_perl). Perl
    interpreter is only invoked for the 17 submit requests. While the PHP
    parser is invoked for all 570 visitors, with some cookie manufacture,
    the PHP will perform even more work.

    We will not use any databases and the page itself is static HTML, only
    cookie creation and form submit are the "active" elements. If PHP is
    not noticibly slower or less stable, it seems like a functionally easy
    solution (cookies with javascript does not work with browsers with
    scripts turned off).
     
    Jan, Mar 2, 2006
    #5
  6. Jan

    Bart Lateur Guest

    Jan wrote:

    >We expect about 570 new visitors every minute on our web page
    >containing a form, 17 of these will press a submit button to invoke the
    >PHP (alternatively CGI perl).
    >
    >Would you expect the performance hit to noticeable at this volume, thus
    >we should consider a cgi-bin perl instead of PHP (parser is loaded).
    >Perl is after all never invoked unless submit is pressed.


    Note that a Perl CGI script has an overhead of about 200ms (on my
    computer) just to get a script started. Even if it's nothing but a
    "hello world" script. That's an advantage that PHP has.

    If you want comparable results, think of using modperl, or, for a
    lighter and very specific setting, things like pperl or SpeedyCGI, or
    fastCGI, which all keep a copy of the script in memory. (The former 2
    are on CPAN, for the latter, search for CGI::Fast. Maybe there are more
    alternatives I don't know of.)

    --
    Bart.
     
    Bart Lateur, Mar 3, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rajive Narain
    Replies:
    0
    Views:
    1,865
    Rajive Narain
    Sep 18, 2009
  2. Ruby Baby
    Replies:
    13
    Views:
    244
    Josef 'Jupp' SCHUGT
    Feb 20, 2004
  3. Jan
    Replies:
    7
    Views:
    122
    Brian Wakem
    Feb 17, 2006
  4. Ignoramus6539
    Replies:
    2
    Views:
    211
    Colin McKinnon
    Aug 30, 2006
  5. M. Strobel
    Replies:
    1
    Views:
    222
    The Natural Philosopher
    Mar 5, 2013
Loading...

Share This Page