Solved

SpeedyCGI waiting to timeout to finish running

Posted on 2008-09-29
4
258 Views
Last Modified: 2013-11-22
We are running Apache 2.0 server on FreeBSD. All of our Perl code is running with SpeedyCGI with a MySQL database. We have noticed that sometimes a database entry may take up to 2 hours before it shows up in the database. What we found was that an employee gets anxious and closes out the web browser before the transaction is complete. It seems like the Perl script is just hanging in limbo and then at some unspecified time interval in the future it finishes and completes the database entries. Basically the script inserts some data into the table, performs a select to retrieve some data to present some info on the screen and inserts some more data into the database. The user Xs out of the browser during the select stage and then hours later the second sets of inserts get processed. It seems very odd but I can't find any information about the relation between Apache and Speedy that controls what happens in this situation. It's almost like Speedy is waiting until someone tries to connect to it before it finishes completing.
0
Comment
Question by:mastercraftowner
  • 2
4 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 22603453
You have to do that in database transaction ideally.
Does problem show up with plain perl?
0
 
LVL 39

Expert Comment

by:Adam314
ID: 22607215
The speedy will exit after the specified timeout, or after the specified number of executions.  This could be what causes it to eventually exit.

As for the data - do you have autocommit on for your database?  If so, as soon as the perl script runs (which inserts data in the database), the database will have the new data, and will not have to wait for anything.
0
 

Author Comment

by:mastercraftowner
ID: 22673408
Autocommit is on for the database. It always seems like the speedy thread sends the last insert query after it exits the process.
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 250 total points
ID: 22673980
Are you using set_shutdown_handler, add_shutdown_handler, or register_cleanup from the CGI::SpeedyCGI module?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question