Solved

SpeedyCGI waiting to timeout to finish running

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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
insert flat files in to tables based upon first character 1 61
Unwanted output from my query 5 53
MySQL 6 48
sed command 3 30
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

759 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