Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 5th, 2009, 10:33 AM
berezDolef berezDolef is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 7 berezDolef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 4 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old November 5th, 2009, 12:56 PM
Analog Analog is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 73 Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 3 h 1 m 5 sec
Reputation Power: 30
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

Reply With Quote
  #3  
Old November 8th, 2009, 04:58 AM
berezDolef berezDolef is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 7 berezDolef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by Analog
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


what makes it not 100% perfect and why shouldn't I use it in production environment ?

Reply With Quote
  #4  
Old November 8th, 2009, 06:45 PM
Analog Analog is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 73 Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level)Analog User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 3 h 1 m 5 sec
Reputation Power: 30
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Module caching in mod_perl


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek