Solved

SpeedyCGI waiting to timeout to finish running

Posted on 2008-09-29
4
255 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 61

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now