MySQL Forums
Forum List  »  Perl

Re: Perl MySQL Connection [urgent]
Posted by: Bill Karwin
Date: June 17, 2006 11:21AM

I'd recommend changing the Perl script to queue the log entries in some local, fast format (for example, a text file).

Then run a 2nd Perl script, once per minute or similar schedule (using cron), to read the file and load all the entries in it, using one database connection.

Be careful to avoid conflicts between the 2nd Perl script reading the text file, and the 1st script writing to the text file. Perhaps in the 2nd Perl script the first thing to do is rename the text file.

Also in the 1st Perl script, use flock() to lock the file while writing to it. Make sure the lock is brief.

Regards,
Bill K.

Options: ReplyQuote


Subject
Written By
Posted
Re: Perl MySQL Connection [urgent]
June 17, 2006 11:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.