MySQL Forums
Forum List  »  Perl

Re: Perl MySQL Connection [urgent]
Posted by: Bill Karwin
Date: June 18, 2006 09:06AM

Ok, instead of the 2nd Perl script I described being run by cron once per minute, it should be a daemon itself.

It's not hard to code a daemon in Perl.
See http://search.cpan.org/~ehood/Proc-Daemon-0.03/Daemon.pm

Then when each call ends, it sends a request via some fast method of interprocess communication to this daemon.

There are many Perl modules for IPC:
http://search.cpan.org/modlist/Networking_Devices_IPC/IPC

Then the daemon Perl script maintains a persistent MySQL database connection and logs the data.

Another alternative is to find out why it takes so long for your script to connect to MySQL itself. Is it slow because of DNS? Network? Authentication? Caching?

You've given no sample code about how you connect, and no description of the architecture of your system. So it's hard to offer more specific advice.

Regards,
Bill K.

Options: ReplyQuote


Subject
Written By
Posted
Re: Perl MySQL Connection [urgent]
June 18, 2006 09:06AM


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.