This is a discussion on Should I use mysql_connect() or mysql_pconnect() ? within the MySQL Database forums, part of the Database Forums category; If wondering the site has many con-current users, use of persistent connection might block new user from connecting? For ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
"howa" <howachen@gmail.com> wrote:
> If wondering the site has many con-current users, use of persistent > connection might block new user from connecting? > > For heavy loaded site, which one is better? In almost all cases pconnect() causes more problems than it solves. http://groups.google.com/group/comp....43f0b9e59ad710 XL -- Axel Schwenke, Senior Software Developer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ |
|
|||
|
>If wondering the site has many con-current users, use of persistent
>connection might block new user from connecting? > >For heavy loaded site, which one is better? If you have a maximum of N Apache processes (this is an Apache setting, and may be much larger than the actual number of simultaneous hits), K different db_host / username / password / db combinations on your pages, and you use persistent connections, then you'll eventually have N*K connections, and MySQL had better be able to handle that many. On the other hand, if you use mysql_connect(), you'll at most use a number of connections equal to the max number of simultaneous hits, which is somewhat less than N. |
|
|||
|
Axel Schwenke wrote: > "howa" <howachen@gmail.com> wrote: > > If wondering the site has many con-current users, use of persistent > > connection might block new user from connecting? > > > > For heavy loaded site, which one is better? > > In almost all cases pconnect() causes more problems than it solves. > > http://groups.google.com/group/comp....43f0b9e59ad710 > > > XL > -- > Axel Schwenke, Senior Software Developer, MySQL AB > > Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ > MySQL User Forums: http://forums.mysql.com/ that's great information! many people believed that pconnect mean scalability but the fact is not, and in fact it is harmful in a busy site! thanks. |