|
From: Mark T. <ma...@fr...> - 2001-07-13 16:14:23
|
> Obviously there is an advantage to mod_perl's persistence, speeding > up response processing significatively (I've seen claims of > improvements in the order of 10 to 100 times!, depending on code) in > exchange for a bit more RAM. This is clearly a usable benefit! > > Where do you all think mod_perl can fit into sql-ledger's scheme of things? It probably doesn't need to for the vast majority of SQL-Ledger users: We do virtual-hosting and have offered mod_perl on our servers for several years now. Our own e-commerce stuff and anything else that will generate large numbers of hits is built in Perl/mod_perl. mod_perl is probably one of the single most powerful technologies available to web developers using Perl. mod_perl integrates the Perl language interpreter into the Apache web server. This has two main advantages: 1. the developer gets access to the Apache API via Perl, allowing Apache modules (or handlers) to be written in Perl 2. Perl scripts can run as Apache::Registry scripts, meaning they are parsed, compiled and executed in the Apache process itself. Once a script has been parsed and compiled into the Apache parent process (preferably at Apache start-up) the next request that calls the script is answered from the compiled version cached by Apache. This means the overhead of starting a Perl process, parsing and compiling the script for each request is avoided. The result is performance that comes close to that of compiled C-code in many cases. So, mod_perl is used for speed and power by folks that use Perl. But, for applications like SQL-Ledger its benefits are likely to be minimal at best (unless the same system is being used by many users simultaneously). There are a couple of caveats when using mod_perl. But they do help enforce good coding practices. Because the Perl scripts/handlers/Apache-modules are persistent name-spaces and variable-scoping become critical. A global variable will be shared by all Apache processes that handle requests for a particular script. mod_perl Apache processes can be pretty large. On modern systems this is usually not a problem. On a busy server it is generally preferable to have an Apache child process using 10MB-RAM (a lot is shared memory on OS's like Linux) than to fork and exec a new Perl process for every hit to a frequently requested resource. There is no harm in using a mod_perl capable server to run SQL-Ledger since Perl scripts can always be run as standard CGI processes. The Apache configuration can control the use of mod_perl on a per-file/script basis. For more info see: http://perl.apache.org/guide/ Mark Mark Tiramani FREDO Internet Services ma...@fr... |