Why does Perl use more resource than Php?

  • Thread starter I Report, You Decide
  • Start date
I

I Report, You Decide

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.
 
M

M

I Report said:
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.
 
C

ctcgag

I Report said:
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__
 
G

Gregory Toomey

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
 
I

I Report, You Decide

I Report said:
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
 
S

Sam Holden

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).
 
G

Gunnar Hjalmarsson

Sam said:
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.)
 
J

James Willmore

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.
 
K

Keith Bowes

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.
 
E

Erik Tank

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.
 
G

Gunnar Hjalmarsson

[ Please do not top post! ]

Erik said:
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.
 
M

Matija Papec

X-Ftn-To: Gunnar Hjalmarsson

Gunnar Hjalmarsson said:
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).

;)
 
B

Ben Morrow

Gunnar Hjalmarsson said:
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...
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
 
G

Gunnar Hjalmarsson

Ben said:
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. :(
 
S

Stewart Campbell CS2002

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top