Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Part II: Extending Perl > Embedding Perl into Apache with mod_perl

Chapter 5. Embedding Perl into Apache with mod_perl

Although the Perl CGI methodology we discussed in Chapter 4, is an easy and popular approach to building web-based applications, there have historically been some performance problems with this approach. Whenever a Perl CGI script is run, the rather sizeable Perl interpreter must first be brought into memory before it can interpret and execute your program. Unfortunately, that can be a very slow process. Fans of Java servlets have pointed to this performance issue in advocating that their technology be used instead of Perl. But Perl has not taken this challenge from Java evangelists lying down! Apache's mod_perl module provides an interface between Apache and Perl that allows Perl code to be cached in the web server's memory space. The effect is a substantial improvement in performance over standard Perl CGI applications.

How much is substantial? As with so many things, the only real benchmarks are either for highly oversimplified cases (with no real application) or for highly specialized cases (with little extensibility). For most real-world programs, however, we can tell you that mod_perl provides a raw speed increase of approximately 40 to 60%. But this is only part of the story. The really significant gain is the vastly increased scalability provided through mod_perl because the interpreter is in memory and can be shared between processes.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint