Current location: Hot Scripts Forums » Programming Languages » Perl » Perl/CGI Script to background process


Perl/CGI Script to background process

Reply
  #1 (permalink)  
Old 06-29-06, 04:55 AM
weilies weilies is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Perl/CGI Script to background process

hi all, i hv a situation like this in my site

a.pl
Quote:
$a = 4;
...
if (...) {
# a bunch of time consuming process
}
$b = 5;
...
# end the code
so, i hv a script which may make my visitor suffer from long waitng time when they fall into the "if " section. so i plan to make whatever inside the "if" into a background process, which wil straight away come to code:"$b=5;", and trigger the server to perform the "if" section in batch/shell, whatever background process which wil make no waiting time, so, any suggestion? coz i m kinda new to background process, but i do know bout CGI,web program


Thanks
Reply With Quote
  #2 (permalink)  
Old 06-29-06, 12:45 PM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by weilies
hi all, i hv a situation like this in my site

a.pl


so, i hv a script which may make my visitor suffer from long waitng time when they fall into the "if " section. so i plan to make whatever inside the "if" into a background process, which wil straight away come to code:"$b=5;", and trigger the server to perform the "if" section in batch/shell, whatever background process which wil make no waiting time, so, any suggestion? coz i m kinda new to background process, but i do know bout CGI,web program


Thanks
Sounds like you need to re-write some code instead of putting the if process into the background. This is really important if the person will still have to wait for the "background" process to complete its job and allow the the visitor to continue...

Have you actually benchmarked the code? If so, show the results.
Are you sure that the "if" statement is what slows your script down?
What size is your script?
What version on Perl is your code designed for?

In all honesty, without actual code, anything could be causing your script to have slow performance.
Reply With Quote
  #3 (permalink)  
Old 06-29-06, 08:57 PM
weilies weilies is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
actually the "if" block is to perform some sort of non-critical process, i m dealing with the online advertising, the situation like this

- once the visitor click on the banner, it wil trigger the script click.pl?aid=123..., then our sys wil track, then add a record for aid=123 to db after some validation on ip and certain rules. then continue let the visitor proceed to the next line of the code.

- but becoz the click.pl would be trigger quite offtenly, and we stil hope the visitor can continue proceed to the next line, means the "if" block NEVER block the visitor from proceed in whatever situation. but an "amount" of waiting time there when the click.pl trigger many times in a short amount of time.

so we hope to switch the current validation to background process instead of foreground

Thanks
Reply With Quote
  #4 (permalink)  
Old 07-18-06, 08:19 PM
schmiddy schmiddy is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Perl fork

Hi,

It sounds like you might be looking forPerl's fork.

I haven't used it myself, and don't have experience doing the sort of low-level system programming that would require using fork, so can't help you out much more than that. Good luck.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 07:15 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 2 01-02-06 11:55 PM
get the table elements from other page using a background search script poison~IVY JavaScript 1 03-21-05 10:08 AM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 12:12 AM


All times are GMT -5. The time now is 04:10 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.