Solved

SpeedyCGI waiting to timeout to finish running

Posted on 2008-09-29
4
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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.

628 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