Re: Sharing a DBI::Mysql database connection with your children
- From: "szr" <szrRE@xxxxxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 11:22:17 -0700
Andrew DeFaria <Andrew@xxxxxxxxxxx> wrote:
I have a process I was thinking of making into a multithreaded daemon
that deals with a MySQL database. The thought is that the daemon
would open the database once, then listen for clients. As clients
connected the daemon would fork off a copy of itself and handle the
requests. This would make the process faster because I wouldn't need
to open the database every time a new client wanted service.
On my system it takes less than one millisecond to open a connection
to a MySQL server (located on a different system.) Do you find that
connection time problematic? This is about the same amount of time
it takes to fork in the first place.
Normally this would be true, if the MySQL server is on the same network,
but if it's not, connection time depends entirely on the latency between
the OP's running system and the MySQL server, such is the case if it is
across the internet; it will surely take longer than a millisecond. But
then again, that would hardly be an ideal setup, but it's not unheard
- Prev by Date: Re: empty variables - getting rid of "uninitialized value" warnings?
- Next by Date: Re: empty variables - getting rid of "uninitialized value" warnings?
- Previous by thread: Re: Sharing a DBI::Mysql database connection with your children
- Next by thread: Re: Sharing a DBI::Mysql database connection with your children