[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] [OT] mysql & php



Hi Filiberto,

> Then I had some testing (show processlist) on the server and discovered
that
> when I ask for a new page it opens a new connection without re-using the
old
> ones even if they are sleeping. This happens until 6-5 connections are
> opened, then it starts reusing  connections (even if not always).

Yes, this happens because the connections are made inside a Apache worker
process. Persistent connection cannot be shared between those workers.

> I would like to know if my solution (setting a shorter wait_timeout) was
> right, or if it would be better to use mysql_connect instaed of
> mysql_pconnect or if there is someting else I can do.

It is certainly better to use mysql_pconnect() than mysql_connect()!

I would suggest, that you simply increase the number of allowed connection
in your MySQL server.

--
Jens Kristian Søgaard, Mermaid Consulting I/S,
jens@xxxxxxxxxxxxxxxxxxxx,
http://www.mermaidconsulting.com/