Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Re: Re: Re: Re: How do you feel about mod_perl?

by edebill (Scribe)
on Nov 12, 2001 at 20:41 UTC ( [id://124853] : note . print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Re: How do you feel about mod_perl?
in thread How do you feel about mod_perl?

Our site architecture tries to isolate all non-trivial logic from the .epl files which are actually displayed. This has paid off in a large way when parts of the site have to be changed around.

Unfortunately, it means most of the core logic behind the site lives in perl modules - and changes to them aren't noticed automatically. Any method that requires explicitly reloading a given method or module is unacceptable - it would be too much work to modify all 1200 .epl files to explicitly reload every module they use.

Actually, like I said, I've already solved it. It's only a dev issue - for production we want to have as much caching as possible (to the point that we'll even cache database query results within modules). On a dev box I've found that setting MaxRequestsPerChild to 1 in the apache config file does the job (this forces apache to fork a new process for each incoming connection - which incidentally starts a new perl interpreter in mod_perl).

Makes things rather slow to run, but that's much better than adding special case code to every .epl file (~1200) for every method in one of our home-grown modules (~700).

  • Comment on Re: Re: Re: Re: Re: How do you feel about mod_perl?

Replies are listed 'Best First'.
Re6: How do you feel about mod_perl?
by blakem (Monsignor) on Nov 13, 2001 at 00:02 UTC
    You should at least take a look at Apache::Reload. It only requires a small change to the modules in question... Changing the .pl files was a solution to a special case, and wouln't necessarily need to be done.

    That said, I think you're fooling yourselef if you think developing in a 'MaxRequestsPerChild=1' environment is a good idea. Almost all the mod_perl related bugs have to do with the persistant nature of your code -- the fact that a single binary is running multiple scripts multiple times is being glossed over in your development environment.

    I would recommend keeping your development environment as similiar to your production environment as possible. MaxRequests=1 vs MaxRequest=alot is a *huge* difference that can cause you troubles down the road.