Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

web performance 2010

by cutlass2006 (Pilgrim)
on Jul 20, 2010 at 07:03 UTC ( [id://850361]=perlquestion: print w/replies, xml ) Need Help??

cutlass2006 has asked for the wisdom of the Perl Monks concerning the following question:

I have a (few) typical web applications using postgresql database, apache2 and mod_perl2 which does a lot of webby things; like generate and consume json via ajax, CRUD on database, page templating, sessions and acl enforcement, manage url rewriting and redirects, search, etc, etc.

I have applied a series of optimizations to make things perform good and generally happy with the results e.g.

  • Apache mpm: for my app prefork worked best
  • I removed unused apache modules
  • Keepalive: I have enabled and tweaked
  • benchmarked the perl app and tweaked iteratively slow functions
  • reduced number of perl deps
  • put in place CDN for static (using nginx to deliver)

In addition, I used yslow and chrome developer browser extensions to identify any bottlenecks or things I could do better.

Searching the perlmonks archives I have found little in the way of up-to-date advice for optimisations and thought it might be appropriate to ask the question for 2010.

Dear monks, what tricks, tips, or links do you use to squeeze the most out of your perl web apps ? tia

update- changed reference to LAMP for the pedants amongst us

update- small edit

Replies are listed 'Best First'.
Re: web performance 2010
by moritz (Cardinal) on Jul 20, 2010 at 07:28 UTC
    So, dear monks, what tricks, tips, or links do you use to squeeze the most out of your perl web apps ?

    Profiling, to find bottlenecks. And caching, caching, caching. Did I mention memcached?

    Perl 6 - links to (nearly) everything that is Perl 6.
      Profiling, to find bottlenecks.

      I can only second that. About three weeks ago, I had a factor 30 (3000%!) speedup after some litte benchmarking with Devel::NYTProf and nytprofhtml. One of the first actions after removing some of my really stupid code(1)was to get rid of XML::Twig and use XML::LibXML instead.

      Alexander

      (1) Don't code when your brain is in power save mode: Traversing a large tree to find the root node at least once for every node (900.000 times per script run) doesn't make your code faster. Using the root node that is already stored in $self does. ;-)

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

        yes, replacing incorrect use of one module by correct use of another can do wonders to the speed of your scripts. Irrespective to the relative efficiency of the modules in question.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

      any experience with using memoize module ? I have always been leary of using this module (not because of quality) in production e.g. I would prefer to 'hand-roll' caching.

        You can't get much better than Memoize with hand-rolled caching, and using Memoize is a one-line change to your code - so there is very little cost to implementing it, supposing that you have a benchmark/profile to target.

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://850361]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found