Why does Perl use more resource than Php?

Discussion in 'Perl Misc' started by I Report, You Decide, Dec 23, 2003.

  1. A hosting service lungcapage has banned yabb, because it takes too much
    CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why
    perl sucks more resource of a server than php? i thought only mod-perl will
    suck not regular perl.

    --
    I am Social Liberal-Fiscal Conservative
    Social Liberal: Forgiveness, Acceptance of Difference, Universal Healthcare,
    Free College Education for Everyone
    Fiscal Conservative: Small Government, No Tax for Low Income
    I Report, You Decide, Dec 23, 2003
    #1
    1. Advertising

  2. I Report, You Decide

    M Guest

    "I Report, You Decide" <> wrote in message
    news:Ln4Gb.232551$...
    > A hosting service lungcapage has banned yabb, because it takes too much
    > CPU/memory, but phpBB is fine. Is that perl/php or the script itself?


    yabb != perl. Did the hosting service "ban" perl? That should answer your
    question.
    M, Dec 24, 2003
    #2
    1. Advertising

  3. I Report, You Decide

    Guest

    "I Report, You Decide" <> wrote:
    > A hosting service lungcapage has banned yabb, because it takes too much
    > CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why
    > perl sucks more resource of a server than php? i thought only mod-perl
    > will suck not regular perl.


    use Blatant::Liar;
    print "yabb was so much better that many more people were using it\n";
    print "so it consumed lots of resources\n";
    __END__

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service New Rate! $9.95/Month 50GB
    , Dec 24, 2003
    #3
  4. It was a dark and stormy night, and I Report, You Decide managed to scribble:

    > A hosting service lungcapage has banned yabb, because it takes too much
    > CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why
    > perl sucks more resource of a server than php? i thought only mod-perl
    > will suck not regular perl.
    >


    Do like I do - run user mode linux with root access for about the same price as a virtual ISP. Run whatever you like.

    See http://user-mode-linux.sourceforge.net/uses.html for a list of UML ISPs.

    gtoomey
    Gregory Toomey, Dec 24, 2003
    #4
  5. > "I Report, You Decide" <> wrote in message
    > news:Ln4Gb.232551$...
    > > A hosting service lungcapage has banned yabb, because it takes too much
    > > CPU/memory, but phpBB is fine. Is that perl/php or the script itself?

    >
    > yabb != perl. Did the hosting service "ban" perl? That should answer

    your
    > question.
    >
    >


    the hosting corp does not bann perl, but banns yabb, because saying it takes
    TOO MUCH CPU/memory. i just wnat to know if the yabb problme is a perl
    problem or the problme of the yabb script only
    I Report, You Decide, Dec 24, 2003
    #5
  6. I Report, You Decide

    Sam Holden Guest

    On Wed, 24 Dec 2003 09:15:47 GMT, I Report, You Decide <> wrote:
    >> "I Report, You Decide" <> wrote in message
    >> news:Ln4Gb.232551$...
    >> > A hosting service lungcapage has banned yabb, because it takes too much
    >> > CPU/memory, but phpBB is fine. Is that perl/php or the script itself?

    >>
    >> yabb != perl. Did the hosting service "ban" perl? That should answer

    > your
    >> question.
    >>
    >>

    >
    > the hosting corp does not bann perl, but banns yabb, because saying it takes
    > TOO MUCH CPU/memory. i just wnat to know if the yabb problme is a perl
    > problem or the problme of the yabb script only


    If it was a perl problem they would ban perl, yes?

    But they don't ban perl, they ban a specific application that is too
    resource intensive for their machines.

    What that application is written in is irrelevant (if it was they would
    ban that language and not just the application).

    --
    Sam Holden
    Sam Holden, Dec 24, 2003
    #6
  7. Sam Holden wrote:
    > What that application is written in is irrelevant (if it was they
    > would ban that language and not just the application).


    I'm not following you, Sam. A Perl app that means a large number of
    new processes, which I suppose is the case with a bulletin board, may
    well reach the limit as regards how much CPU a web host accepts,
    without the host necessarily having to ban Perl for smaller
    applications. And there may be other languages that require less CPU
    for a similar app, so the language may well be relevant.

    (mod_perl is sometimes useful in cases like this, but very few web
    hosts offer that option.)

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Dec 24, 2003
    #7
  8. On Wed, 24 Dec 2003 09:15:47 GMT
    "I Report, You Decide" <> wrote:

    > > "I Report, You Decide" <> wrote in message
    > > news:Ln4Gb.232551$.
    > > ..
    > > > A hosting service lungcapage has banned yabb, because it takes
    > > > too much CPU/memory, but phpBB is fine. Is that perl/php or the
    > > > script itself?

    > >
    > > yabb != perl. Did the hosting service "ban" perl? That should
    > > answer

    > your
    > > question.
    > >
    > >

    >
    > the hosting corp does not bann perl, but banns yabb, because saying
    > it takes TOO MUCH CPU/memory. i just wnat to know if the yabb
    > problme is a perl problem or the problme of the yabb script only


    This all sounds like yabb problem :)

    Seriously .... if you want to find out where the "problems" are with
    yabb, then run some benchmarks and find out. You could, if using a
    *NIX system, use the 'time' command to see which is using more cpu
    time. For a strictly Perl look at the situation, check out the
    various Devel modules to aid in finding out where yabb "bottlenecks"
    are.

    In general, this really isn't a Perl issue - it's one you're having
    with your host and is based upon what *they* have told you. Find out
    for yourself and then decide if *they* are right :)

    HTH

    --
    Jim

    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.

    a fortune quote ...
    Bugs, pl. n.: Small living things that small living boys throw
    on small living girls.
    James Willmore, Dec 24, 2003
    #8
  9. I Report, You Decide

    Keith Bowes Guest

    I Report, You Decide wrote:
    > A hosting service lungcapage has banned yabb, because it takes too much
    > CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why
    > perl sucks more resource of a server than php? i thought only mod-perl will
    > suck not regular perl.
    >


    That's strange. I would have thought that Perl would be more efficient,
    due to PHP being easier and having more modules that are included
    without invocation. But I guess it's possible that hard to read doesn't
    necessarily mean fast to run.
    Keith Bowes, Dec 24, 2003
    #9
  10. I Report, You Decide

    Erik Tank Guest

    Your arguement doesn't really make sense. I can write two programs
    (both in Perl) that do exactly the same thing and one will run like
    lightening with nearly no impact on the machine while the other will
    grind the machine to a halt eventually crashing it.

    Neither outcome is Perl's fault - it is the fault of the programmer
    who either wrote inteligent/effecient code verses code that has memory
    leaks, hogs resources, etc.

    Asking if Perl is slower or uses more resources that PHP is like
    asking if a Ford gets better gas mileage than a Toyota.

    On Wed, 24 Dec 2003 12:13:51 +0100, Gunnar Hjalmarsson
    <> wrote:

    >Sam Holden wrote:
    >> What that application is written in is irrelevant (if it was they
    >> would ban that language and not just the application).

    >
    >I'm not following you, Sam. A Perl app that means a large number of
    >new processes, which I suppose is the case with a bulletin board, may
    >well reach the limit as regards how much CPU a web host accepts,
    >without the host necessarily having to ban Perl for smaller
    >applications. And there may be other languages that require less CPU
    >for a similar app, so the language may well be relevant.
    >
    >(mod_perl is sometimes useful in cases like this, but very few web
    >hosts offer that option.)
    Erik Tank, Dec 24, 2003
    #10
  11. [ Please do not top post! ]

    Erik Tank wrote:
    > Gunnar Hjalmarsson wrote:
    >> Sam Holden wrote:
    >>> What that application is written in is irrelevant (if it was
    >>> they would ban that language and not just the application).

    >>
    >> I'm not following you, Sam. A Perl app that means a large number
    >> of new processes, which I suppose is the case with a bulletin
    >> board, may well reach the limit as regards how much CPU a web
    >> host accepts, without the host necessarily having to ban Perl for
    >> smaller applications. And there may be other languages that
    >> require less CPU for a similar app, so the language may well be
    >> relevant.
    >>
    >> (mod_perl is sometimes useful in cases like this, but very few
    >> web hosts offer that option.)

    >
    > Your arguement doesn't really make sense.


    Now i'm confused. If you don't run your Perl program under mod_perl or
    something similar, it's compiled every time it's called. The
    compilation costs CPU. (Please correct me if I'm wrong so far.)

    > I can write two programs (both in Perl) that do exactly the same
    > thing and one will run like lightening with nearly no impact on the
    > machine while the other will grind the machine to a halt eventually
    > crashing it.


    Of course. But you can't do anything about the need to compile.

    > Asking if Perl is slower or uses more resources that PHP is like
    > asking if a Ford gets better gas mileage than a Toyota.


    The question in the subject line of this thread may not be possible to
    answer. But for a particular application area I really thought is was
    not only possible, but also advisable, to consider which programming
    language is the better choice out from various viewpoints - also CPU
    usage. If you guys disagree on that, I must have missed something.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Dec 24, 2003
    #11
  12. I Report, You Decide

    Matija Papec Guest

    X-Ftn-To: Gunnar Hjalmarsson

    Gunnar Hjalmarsson <> wrote:
    >Sam Holden wrote:
    >> What that application is written in is irrelevant (if it was they
    >> would ban that language and not just the application).

    >
    >I'm not following you, Sam. A Perl app that means a large number of
    >new processes, which I suppose is the case with a bulletin board, may
    >well reach the limit as regards how much CPU a web host accepts,
    >without the host necessarily having to ban Perl for smaller
    >applications. And there may be other languages that require less CPU
    >for a similar app, so the language may well be relevant.


    You shouldn't say such heretic words.. some other language being better than
    Perl.. bah, just wait and see which language you'll use in your afterlife if
    you keep on with such heresy (hint, devil likes Sun).

    ;)


    --
    Matija
    Matija Papec, Dec 25, 2003
    #12
  13. I Report, You Decide

    Ben Morrow Guest

    Gunnar Hjalmarsson <> wrote:
    > Now i'm confused. If you don't run your Perl program under mod_perl or
    > something similar, it's compiled every time it's called. The
    > compilation costs CPU. (Please correct me if I'm wrong so far.)


    This is not specific to Perl, it applies ti any 'scripting'-type
    language which is not precompiled. For instance, if you don't run your
    PHP program under mod_php or similar, it's compiled (or re-parsed, or
    whatever PHP does) every time.

    > Of course. But you can't do anything about the need to compile.


    You can do many things: use mod_perl or fastCGI, compile to bytecode,
    write a separate server process that does most of the processing,
    write the program so as not to load modules unless they're needed...

    > Erik Tank wrote:
    > > Asking if Perl is slower or uses more resources that PHP is like
    > > asking if a Ford gets better gas mileage than a Toyota.

    >
    > The question in the subject line of this thread may not be possible to
    > answer. But for a particular application area I really thought is was
    > not only possible, but also advisable, to consider which programming
    > language is the better choice out from various viewpoints - also CPU
    > usage. If you guys disagree on that, I must have missed something.


    You are of course right in both cases :). In general, the question is
    unanswerable, except for generalities like 'well-written C tends to be
    faster' and 'Lisps tend to be slow'. In specific cases, language may
    make a difference: in particular, if your ISP provides mod_php and not
    mod_perl you should either switch ISP or use PHP. :)

    Ben

    --
    And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
    * *
    Ben Morrow, Dec 27, 2003
    #13
  14. Ben Morrow wrote:
    > if your ISP provides mod_php and not mod_perl you should either
    > switch ISP or use PHP. :)


    Well, my impression is that web hosting providers tend to offer
    mod_php, while web apps written in Perl typically are reduced to CGI.
    That is probably a generally valid answer to the question in the
    subject line, btw.

    Following your advice would lead to Perl being marginalized (is that a
    word?) as a language for web apps. :(

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Dec 27, 2003
    #14
  15. I Report, You Decide wrote:
    > A hosting service lungcapage has banned yabb, because it takes too much
    > CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why
    > perl sucks more resource of a server than php? i thought only mod-perl will
    > suck not regular perl.
    >


    The major difference there is YABB is flat file, phpBB uses a database.

    YABB is older generation software, YABBSe and now SMF replace that, in
    PHP with a database backend. Many message boards which use flat file
    are banned on a large number of hosts, including UBB, YABB, etc.

    Anything with a database backend, is (normaly) going to be much quicker
    and less resource intensive than a flat file version.

    Stewart
    Stewart Campbell CS2002, Oct 27, 2004
    #15
    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.

Share This Page