Ubuntu 8.04 ZM 1.24.1 mysql_pconnect error

Forum for questions and support relating to the 1.24.x releases only.
Locked
the_crowbar
Posts: 22
Joined: Fri May 11, 2007 7:13 pm

Ubuntu 8.04 ZM 1.24.1 mysql_pconnect error

Post by the_crowbar »

I fixed a problem today that I was unable to find any posts about so I thought I would document what it was.

I have an Ubuntu 8.04 AMD64 server setup with ffmpeg 0.5 and ZM 1.24.1. I have a total of 32 monitors configured. One client was able to view montage but as soon as second client tried I started getting php errors.

I no longer have the exact error in front of me, but it had mysql_pconnect "too many connections" and database.php in it. After a little digging I found a php setting to limit the number of mysql connections. On Ubuntu 8.04 it is set to -1 (unlimited).

After more Googling I found that MySQL also has a client limit. There was no setting for it, but I added a line to the [mysqld] section of /etc/mysql/my.cnf

Code: Select all

# Increase the maximum number of connections
max_connections		= 500
You can also view the current (maybe default) setting from within mysql with this command:

Code: Select all

mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 500   | 
+-----------------+-------+
1 row in set (0.00 sec)
I still have a couple more issues to fix (one show stopper), but ZM 1.24.1 seems to be an improvement from 1.23.

Cheers,
the_crowbar
the_crowbar
Posts: 22
Joined: Fri May 11, 2007 7:13 pm

Post by the_crowbar »

I found a window still open with the error. Here it is:

Code: Select all

Warning: mysql_pconnect() [function.mysql-pconnect]: Too many connections in /var/www/includes/database.php on line 32
Could not connect to database: Too many connections
While researching the solution to this error I found quite a bit of discussion on pconnect versus connect. I ended up changing the line in database.php to use mysql_connect instead of mysql_pconnect. My ZM/Apache/MySQL is all on one box and so the time required to start a new connection each time is minimal.

Cheers,
the_crowbar
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

Wow 32 monitors...that must be a beefy server! Thanks for posting your experience, good to have things for the search to find when people have similar problems :)
the_crowbar
Posts: 22
Joined: Fri May 11, 2007 7:13 pm

Post by the_crowbar »

32 320x240 is really not much. The system is a 2X quad core Xeon with 4GB of RAM. Doing simple MoDect with a single zone per monitor system load averages well under 1. As I go along I will be doing more involved detection that may push the load up more.

Cheers,
the_crowbar
Locked