|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Module caching in mod_perl
I'm using mod_perl
it seems I have to restart apache every time I modify one of my modules. is there a way around this so that the modified module will load without restarting apache? |
|
#2
|
|||
|
|||
|
Yep, mod_perl scripts are loaded into memory on apache load, that's why it makes them so much faster.
Use reload instead of restart, its safer You can also load Apache2::Reload in your conf file to detect changes but it's not 100% perfect and isn't recommended for your production environment http://perl.apache.org/docs/2.0/api/Apache2/Reload.html |
|
#3
|
|||
|
|||
|
Quote:
what makes it not 100% perfect and why shouldn't I use it in production environment ? |
|
#4
|
|||
|
|||
|
Its not perfect as different results can happen based on how your perl is installed and how your modules are created. You can hit scenarios where a module you create won't load, or that when you do a change, existing child nodes could report errors before they get replaced by new instances etc.
The main reason why most don't use it in a production environment is simply performance, you are taking a important part of the reason why mod_perl is such kick *** - instead of loading everything in memory once you will be constantly checking %INC for changes and reloading if needed. Most people I've seen use it in a development environment and after knowing their script is good would upload it to the production machine and use "./httpd reload" to reload all the apache instances. Give it a try, its ultimately up to you - I would suggest you read this link though http://perl.apache.org/docs/2.0/api/Apache2/Reload.html |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Module caching in mod_perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|