Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

web performance 2010

by cutlass2006 (Pilgrim)
on Jul 20, 2010 at 07:03 UTC ( #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

Comment on web performance 2010
Re: LAMP performance 2010
by JavaFan (Canon) on Jul 20, 2010 at 07:11 UTC
    I have a (few) typical LAMP web applications using postgresql database
    Here I am, thinking LAMP stands for Linux, Apache, MySQL, Perl/PHP/Python, and then it turns out a "typical" LAMP application uses postgresql.
    So, dear monks, what tricks, tips, or links do you use to squeeze the most out of your perl web apps
    Perhaps you should write your LAMP applications in C. (Hey, if you swap out one of the letters, why not two?)
      Here I am, thinking LAMP stands for Linux, Apache, MySQL, Perl/PHP/Python, and then it turns out a "typical" LAMP application uses postgresql.

      That's why you expand it Linux, Apache, Middleware, PostgreSQL. Of course, those of us who aren't so much on the Linux side have to get progressively more creative in our dereferences ;)

      Lunatic Abberation Mitigated by Perl?

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.

      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.

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
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? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-08-30 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls