Why mod_perl?

In this clause{article} I shall acquaint you with bases mod_perl, I shall achieve that you want to try to work with it  and I shall result as examples some the known sites created with the help mod_perl under Apache.

What is mod_perl?


mod_perl Is heart of the project of integration Apache/Perl uniting in all opportunities of programming language Perl and Apache web-server.


From the very beginning Apache has been created so that you could expand his  opportunities adding "modules". Modules can do{make} all necessary how, for example, to copy searches with HTTP, to limit access to the certain pages and to carry out search in a database. Usually modules are written on C with which it is sometimes difficult to work. mod_perl is a module which enables you to do{make} all these things and, moreover, use Perl does{makes} process of development by faster, than on C. Apache is the web-server most widespread on the Internet, and mod_perl - one of most is wide primenjamykh modules for expansion of his  opportunities.

Why mod_perl has received such wide popularity?


If it is pleasant to you Perl and your liked web-server - Apache you grow fond mod_perl at first sight. And as soon as you porobuete it  in operation - you will not look back any more on the parties{sides} because will understand: in mod_perl there is everything, that it is necessary for you. And even if you suddenly will find out, that in him something does not suffice - only say. Before you will have time to count up to three, somebody will already have time to create it for you. And, certainly, to you will want to give something in exchange. In a result you will add something is will save a lot of time to other members of community mod_perl, and they can create even more things for needs of other users.


Such the picture turns out: mod_perl increases opportunities to users who in turn increase opportunities mod_perl which in turn increases opportunities of users which in turn... It as is elementary, as nuclear reaction which you passed at school (or will pass still).


Using mod_perl it is possible to write modules Apache entirely and completely on Perl. It transaction processing, a spelling autentifikacii and obrabotchikov dens enables you to do{make} easily such things which are complex  or simply impossible for usual programs on CGI, as for example.


The basic advantages mod_perl are opportunities and speed. You have full access to all activity occuring inside the web-server and you can interfere at any stage of processing HTTP of search. It enables to make independently amendments at various stages of processing: for example, the link to transformation of a name of a file, authorization to generate answers and broad gullies.


There is a big economy of time at start and compilations. The interpreter for Perl built - in in the server considerably reduces the charge of time, not spending it  to start of the external interpreter at each search HTTP for which use of code Perl is necessary. At least such importance is represented with caching a code: modules and scripts are loaded and compiled only once - at the moment of the first start of the server. And the rest of all life of the server management of scripts occurs from a cache so the server needs to start only prekompilirovannyj a code. In most cases it as is quickly feasible, as start of the compiled programs on C.


It is a small gain in time at start. In particular, under mod_perl there is no necessity to start individual process for each search as it is frequently done{made} in other expansions for web-servers. The most widespread mechanism of such expansions - Common Gateway Interface (CGI) - is completely replaced with code Perl which is engaged in processing of process of search in a phase of generating of the answer. For these purposes there are two interconnected with mod_perl target the module: Apache:: Registry which can imperceptibly start existing unmodified scripts Perl CGI and Apache:: PerlRun which carries out a similar problem , but enables you to start scripts to some extent "dirtier".


mod_perl Enables you to adjust Apache server and programs of processing on Perl (using for this purpose PerlSetVar directive and section <Perl>. Thus administration of the server with set of virtual hosts becomes extremely simple. EHj, you even can set your own directives of a configuration.

As far as fast and stable is mod_perl?


Many ask: " How much advantages are given with use mod_perl? " Well, all depends on how you use mod_perl and, probably, from the one whom you ask. Developers declare increase in speed from 200 up to 2000 percent{interests}. Whether the best way to define{determine} so it - to try and see the eyes. (for reception of the information on this question look http://perl.apache.org/tidbits.html and http://perl.apache.org/stories/).


Every second each day of thousand web-sites worldwide use mod_perl for management of hundreds thousand web-page.s Apache and mod_perl by ratings are one of the best ever in general the written programs. Certainly, they continue to develop and be finished, but you should not work with "semifinished item" - for your sites you can use a stable product and give to anothers an opportunity to test new versions.


I want to show you some sites from number of the most popular and often visited{attended}, controlled by means of mod_perl. It is better to see time, than hundred times to hear. Visit these sites and feel a difference. You are convinced, that mod_perl is rulez!

?         ValueClick - http://www.valueclick.com/ processes daily more than 70 million searches from 20 machines. All answers dynamic, include any kinds of calculations, recordings, broad gullies, calculations - name. All programs - applications are executed on Perl.

?         Singles Heaven - http://singlesheaven.com/ is the site - Match Maker numbering more of 35000 members and this number constantly grows. The site copes with the help mod_perl, DBI, Apache:: DBI (which constant connection with a DB provides) and MySQL. Speed simply monstrous to communicate with mod_perl - it is a pleasure. Each page is generated approximately 10-¯ by SQL-searches for what a plenty of dynamic checks on each page (as, for example, check new e-mail messages, users of whom observe various programs - watchdog'¿ and many other things) is made. For you these searches will be not appreciable at all, speed same high, as a script " Hello World ' ".

?         Internet Movie Database (Ltd) - http://www.moviedatabase.com/ - processes daily about 2 million seen{overlooked} pages. All searches in databases are processed inside Apache by means of mod_perl. Each search also passes through a number{line} of programs - obrabotchikov mod_perl and the deduced{removed} data further pereformatirujutsja by means of mod_perl SSI to insert into them advertising banners and to give various kinds of a site depending on a used host.

?         CMPnet - http://www.cmpnet.com/, the network on information technologies, daily processes more 600k prosmatrivaemykh pages.

?        CitySearch.com - http://www.citysearch.com/ gives in a online-mode guidebooks more than on 100 cities worldwide. citysearch.com helps people during search and planning, that they want to make and allows them to undertake concrete actions, rendering service on registration of transactions on a place, such as purchase of tickets on any actions and the order of places in hotels and restaurants in a online-mode. The traffic exceeds 100 million seen{overlooked} pages a month.


How many sites work with mod_perl for Apache web-server?


On data Netcraft (http://netcraft.com/), in August, 2001 of 18 million hosts used for job the free-version of Apache web-server that has made about 60 percent{interests} from number of all investigated hosts.


So mod_perl? http://perl.apache.org/netcraft/ declares, that the sites working on mod_perl total 2,823,060 names of hosts and 283,180 unique IP-addresses. Actually parameters are underestimated, as check of working web-servers was spent only on the most known ports (80, 81, 8080 and on several others). If the server uses rare port he has not been taken into account{has not been discounted} even if the owner of the server has with own hand added it  in database Netcraft.


For reception of data of later periods look http://perl.apache.org/netcraft/.

Full forward


You, should be, are excited with an output{exit} of version Apache 2.0, new generation of best of web-servers. The main features of web-servers of new generation are multiline processes which will raise opportunities of the server to expansion, and, certainly, a long-awaited level of kill.


You, should be, not less ozabocheny concerning a recent output{exit} of version Perl 5.6, whose main feature is (almost stable support of the streams which have struck you in previous version Perl but where she was too astable.


You ask, how all this will affect on mod_perl? mod_perl 2.0 at the moment it is still developed and will incorporate all advantages of new versions Apache and Perl. The most important improvement will be reduction of the size of processes - the design of a tree of operations Perl practically will be completely distributed{allocated} between streams of one process.


You believe in concurrences? Both Perl 5.6 and Apache 2.0 - both have left on the same week in March, 2000. It seems to me rather suspicious. If you possess the exact information convicting secret arrangement, please, let to me know.


Certainly, around of us there are enough unexpectedness. Will pass a lot of time before all our applications can use advantages of a multithreading. The main reason that the majority of modules Perl accessible on CPAN are not intended for reliable job of streams. But it is not necessary to lose courage. You can disconnect use of streams in not intended for reliable job of several streams a Perl-code, or in such which uses the modules which have been not intended for multiline job.

I want mod_perl right now where it  to take?


The home page mod_perl is here http://perl.apache.org/. From this site you can download the freshest software on mod_perl and the most different documentation, will find commercial products and the given modules laid out in an easy approach third party, will read stories about upekhakh and achievements and learn{find out} a lot of new about mod_perl.


It is important enough to subscribe to dispatch mod_perl. If you want to keep abreast of the events occuring with mod_perl, you want to know, that new is developed, if you want to participate and promote or simply want to receive the help then do not neglect this dispatch. To subscribe for dispatch, send the empty letter on S-mail on modperl-subscribe@apache.org.

It is pleasant to me mod_perl and I want to know, who has created this perfect product!


Well, of all it is guilty Arches MakIchen (Doug MacEachern):). He is that guy who has presented a society mod_perl. He is Linusom for the project mod_perl.


But, as you know, in the big community always there will be people, ready to help, and there is a whole group of developers from all world, creating patches for mod_perl, develop for him  the whole modules on Perl, check the server on presence of mistakes and protect it . I am afraid, that the list of developers participating in business will turn out too long to result it  here. But welcome in a sheet of dispatch - and you can see all these people in operation. I promise, you will not regret, is especial if want to learn{find out} more and not only about mod_perl. Look.

To participate


If you use mod_perl or are going to to use, then not bad to subscribe for dispatch for users mod_perl. That it to make, you will need to send on e-mail the empty letter on modperl-subscribe@apache.org.


If you want to assist in development mod_perl 2.0 - welcome, join us. Very much many things still need to be made and much to test. So it is a lot of job, be you the skilled developer or even the newbie. And the more the help we shall receive, the we shall result mod_perl 2.0 in a packaging more likely. You can subscribe for dispatch of the developer, having sent the empty letter on dev-subscribe@perl.apache.org.


If you are already familiar with mod_perl you should be know about the big and thick management{manual} on mod_perl, given by me with assistance of many people (http://perl.apache.org/guide/). Anyhow, in mod_perl 2.0 that has changed, so job above the new documentation already began. Welcome for obnovlenijami on a site http://perl.apache.org/ also subscribe for dispatch of the documentation always to keep abreast having sent e-mail on docs-dev-subscribe@perl.apache.org <mailto:docs-dev-subscribe@perl.apache.org>.