Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Persistent MySQL Connections

Quote Reply
Persistent MySQL Connections
Hi Alex and all,

I am coming out of a long discussion with some MySQL experts who believe that using persistent connections to MySQL is a very bad idea to do in an application that is on a server together with many other scripts. Each connection eats out lots of RAM and if it persists then very soon server will get overloaded and crash. There was strong recommendation that one refrains from using persistent connections unless for a heavy load server with very small number of databse driven sites.

I am still testing GM and so far have used it for personal mail but we are getting ready to release it and expect quite a good number of users. I am worried about that issue. For now GM will be hosted with other applications on a 700 MHZ PIII with 256 MB RAM. Do you believe I should run it without modperl? I have been told that 256 MB RAM will handle 50-60 simultaneous connections before it starts limping and if using persistent connections, this time will happen very quickly .

Please comment and advise

Thanks

Frank
Quote Reply
Re: [frankLo] Persistent MySQL Connections In reply to
Hello,

I am not aware of the fact that pconnect is a problem on MySQL. We are running a PIII-400 and
have many databases running from the same server and using GTMail. We haven't seen any problems so far. May be we didn't hit the roof yet. We sure will look more into this. Thanks.

-Srinivas
Quote Reply
Re: [srinivas] Persistent MySQL Connections In reply to
Hi Srinivas,

Thanks for your reply. How much RAM do you have? What is your current number of users that login daily? What is current number of users accessing various database-driven sites each day?

Thanks

Frank
Quote Reply
Re: [frankLo] Persistent MySQL Connections In reply to
Hi,

It really depends on how you have it setup. The ideal solution if you are using mod_perl is to have it as an application server, with a lightweight apache just proxying requests back to the mod_perl server. This limits the number of mod_perl children required (on our site, we only need 5 mod_perl httpds, where we have on average 75 lightweight httpds). This means we only keep open 5 requests (well, really we keep open 10, 5 to our demo database where all our product demos are, and 5 to our main database for the forum and other system work).

But yes, your experts are right. Each mod_perl httpd will need it's own connection, and you will need one connection per unique DBI connect string. So if you have 3 applications, each connecting to a different database, and have 25 httpd's, you now have to keep open 75 connections to the database.

You should plan your apache server setup with this in mind. A great read is:

http://perl.apache.org/...rk_with_Databases_un

Cheers,

Alex
--
Gossamer Threads Inc.