Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

performance of LAMP-system

by bjelli (Pilgrim)
on Dec 12, 2001 at 17:17 UTC ( #131231=perlquestion: print w/replies, xml ) Need Help??
bjelli has asked for the wisdom of the Perl Monks concerning the following question:

Geschwister in Perl,

two of my friends are webmasters for community sites, and both sites have performance problems. Right now they don't even know where the problem is located: hardware, operating system, apache, mysql, or in the scripts (mod_perl in one case, php in the other).

I've found information on the performance of the single parts the system, like the mod_perl tuning guide. But I couldn't find anything that gives an overview over all parts of the system, and some hint as to how to start looking for the problem.

I mean, apache + mysql + some free scripting language starting with p is such a common combination, there's got to be some literature/website/mailing-list on this!

Please point me in the right direction!

Brigitte    'I never met a chocolate I didnt like'    Jellinek

Replies are listed 'Best First'.
Re: performance of LAMP-system
by davis (Vicar) on Dec 12, 2001 at 17:25 UTC
    There's a document on the apache website regarding performance, which could be a good place to start
Re: performance of LAMP-system
by Khaine (Initiate) on Dec 12, 2001 at 19:00 UTC
    This is quite a wide subject but generally performance tuning can be most easily performed at an app level. However, first off I would recommend using apps like vmstat, mpstat, top, etc (assuming they are running something Unix like) and check for the four common system bottlenecks, CPU utilization, physical RAM/Swap utilization, network bandwidth and disk spindle utilization time. Generally one or more of these will indicate the source of the problem (which are usually bad SQL code, badly laid out database tables on physical spindles or very inefficient Perl code in that order of likeliness). Good luck :-)
Re: performance of LAMP-system
by mirod (Canon) on Dec 12, 2001 at 19:10 UTC

    Maybe looking at OnLAMP would be a good start!

Re: performance of LAMP-system
by chromatic (Archbishop) on Dec 13, 2001 at 00:29 UTC
    It's probably not a big help at the moment, but if your friends had mock pieces of the application for testing, they could isolate each part in turn and do benchmarking that way.

    For example, when testing something like a libnet module, it's a whole lot easier to whip up a fake Socket module that does exactly what you want than it is to work with all sorts of network configurations. So they could have a fake database object, a fake web server object, and so forth. The performance isn't quite real-world, but if they have enough fake pieces, they can benchmark each real piece in isolation. That can be handy.

    Hey, testing can't solve everything, but this is a place it can help.

SUMMARY: performance of LAMP-system
by bjelli (Pilgrim) on Dec 13, 2001 at 16:37 UTC

    Thanks to all of you. Here's a quick summary of the answers I got:

    performance problems in a LAMP system

    The problem could be located in one or more components:

    1. hardware/os
    2. apache
    3. mysql
    4. the application itself

the usual suspects are the application itself (bad SQL code, inefficient Perl code) and the database (badly laid out database tables on physical spindles)

check: CPU utilization, physical RAM/Swap utilization, network bandwidth and disk spindle utilization time.
tools: vmstat, mpstat, top,...
links: Apache Performance Tuning
tools: the mysql slow log, DBIx::Profile
links: linuxmag article on mysql performance tuning
the application itself
tools: Devel::DProf, Apache::DProf

2001-12-13 Edit by Corion : Added missing <OL> tag

Re: performance of LAMP-system
by perrin (Chancellor) on Dec 13, 2001 at 00:34 UTC
    Here's the right direction: Devel::DProf (or Apache::DProf for mod_perl). That will tell you which part of your application is slow.

    The most common cause of performance problems in simple web systems is database performance, often due to poor table design or inefficient SQL. You can use DBIx::Profile to find slow SQL statements that need to be fixed.

    Of course, before you do anything else you should make sure that your machines have enough RAM and are not swapping. The mod_perl guide you mentioned can help you deal with that.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://131231]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-11-22 11:30 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (319 votes). Check out past polls.