You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Boysenberry Payne <bo...@humaniteque.com> on 2007/06/21 01:38:43 UTC

mod_perl2 best practices interacting with non-apache apps

Hello Everyone,

I'm running a website building/management system (http:// 
habitatlife.com/) using
an apache2/mod_perl2 via unix platform and want to run some time  
consuming
processes without tying up my apache/mod_perl children.

Ideally, I would run these programs then continue on with returning  
feedback, etc.
without waiting for the program to complete, checking on the status  
of the operation
with a different "quick check" request, like flagging the database or  
something
from the program with feedback, "beginning, error, done, etc", then  
checking the status
intentionally.

What is the safest approach to accomplish this.  Its running on a  
dedicated server
and for now I'm only planning on running programs on the same server,  
i.e. local
to the apache/mp2 build.

In particular, what syntax/mod should be used to assure the program  
gets run securely
from mod_perl?
(e.g. running a perl script that does a whole site backup)

TIA,
Boysenberry Payne

Re: mod_perl2 best practices interacting with non-apache apps

Posted by Perrin Harkins <pe...@elem.com>.
On 6/20/07, Boysenberry Payne <bo...@humaniteque.com> wrote:
> Hello Everyone,
>
> I'm running a website building/management system (http://
> habitatlife.com/) using
> an apache2/mod_perl2 via unix platform and want to run some time
> consuming
> processes without tying up my apache/mod_perl children.

For simpler things, you can use the techniques shown by Randal in these columns:
http://www.stonehenge.com/merlyn/LinuxMag/col39.html
http://www.stonehenge.com/merlyn/WebTechniques/col20.html

For a more scalable solution, you would use a job queue system.  There
are some on CPAN.

- Perrin

Re: mod_perl2 best practices interacting with non-apache apps

Posted by Jonathan Vanasco <jv...@2xlp.com>.
Personally , I do this:

	MP inserts a job request into the db cluster, redirects to a  
'waiting page'.  status is 'requested'
	a python daemon queries the db cluster every 5 seconds, pulling jobs  
to run through.  status is 'processing'
	when the python daemon is done, it updates the status to  
'processed' , and leaves either a sucessess or failure flag
	'waiting page' reloads every 6-10 seconds. if it sees 'processed' in  
the db, it shows sucesses.
	btw, the job insert checks for 'similar' requests and doesn't allow  
them.



// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|   CEO/Founder SyndiClick Networks
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|     Founder/CTO/CVO
|      FindMeOn.com - The cure for Multiple Web Personality Disorder
|      Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      RoadSound.com - Tools For Bands, Stuff For Fans
|      Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -