forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Master of Orion on May 11, 2007, 08:50:26 pm

Title: Unable to connect to database !
Post by: Master of Orion on May 11, 2007, 08:50:26 pm
Hi dear developers of Coppermine !

Our photo collection http://china.kulichki.com/pictures/ have    files and we are having about 10.000 views of Coppermine’s pages .
Our Coppermine - 1.4.9 .  Run at Apache/1.3.33 (Unix) PHP/4.4.1 rus/PL30.20    MySQL  Client API version 4.0.26

Often a error like this are occur –
Coppermine critical error:
Unable to connect to database !
MySQL said: User china has already more than 'max_user_connections' active connections

Our server administrator says that its problem with the Coppermine system. Coppermine cannot able to serve so many pictures and page views...

It is possible?  Can Coppermine more pics than  25948  and more views? 
What I must to do?
Title: Re: Unable to connect to database !
Post by: Master of Orion on May 11, 2007, 08:54:55 pm
This Picture collection have 25948 files in 579 albums and 48 categories with 6918 comments viewed 2175067 times
Title: Re: Unable to connect to database !
Post by: Nibbler on May 11, 2007, 09:00:17 pm
Get the 'max_user_connections' increased then.
Title: Re: Unable to connect to database !
Post by: Master of Orion on May 11, 2007, 09:07:24 pm
Connections about 400 seconds «connecting» to base and administrator say that connection not closed automatically
Title: Re: Unable to connect to database !
Post by: Nibbler on May 11, 2007, 09:12:42 pm
Connections are closed automatically unless you have made code modifications. I don't understand the rest of your reply.
Title: Re: Unable to connect to database !
Post by: Master of Orion on May 11, 2007, 09:27:56 pm
Can Coppermine support  more pics  than  25948  and more views than 10.000?
Title: Re: Unable to connect to database !
Post by: Nibbler on May 11, 2007, 10:03:18 pm
Yes, easily. The limiting factor is your hardware and server setup.
Title: Re: Unable to connect to database !
Post by: eka on September 09, 2007, 09:40:50 am
Hi Nibbler,

I've also been getting this problem - "Mysql said: too many connections"

How do you increase the "max_user_connections" ?

Pse advice.

Thanks.
Title: Re: Unable to connect to database !
Post by: eka on September 09, 2007, 09:50:51 am
Hi Nibbler,

forget my request - I'm reading up on it.

thanks.
Title: Re: Unable to connect to database !
Post by: Veronica on September 09, 2007, 06:56:15 pm
For MySQL too many connections error message try to use MySQL with persistent connections

For details read this:
http://se.php.net/manual/en/function.mysql-pconnect.php

For updating Coppermine change in /include/functions.inc.php

from
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
to
$result = @mysql_pconnect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);

ie just add a "p" to the connect for persistent connections
Title: Re: Unable to connect to database !
Post by: eka on September 15, 2007, 02:07:42 am
Hi Veronica,

thanks for the tip.

just wonder...would it create any problems anywhere?

does anybody had any experience with persistent connections?
Title: Re: Unable to connect to database !
Post by: Nibbler on September 15, 2007, 02:31:14 pm
Depending on how your php is setup it could either help, do nothing, or make things worse. Take it up with your host and see what they suggest. Also, there is code posted somewhere to spread the load over multiple users. You could try that - search the board.
Title: Re: Unable to connect to database !
Post by: eka on September 16, 2007, 10:02:41 am
Hi Nibbler,

I searched the board, can't find anything about multiple users, but I found a thread suggesting that a way to resolve the "too many connections" problem is to reduce the number of links on the frontpage that connects to the database.

I not sure I interpreted it correctly. I have a number of images on my frontpage that are pulled from the database. If I cut done on these links to the database, would it help to resolve the connection problem?

Pse advice.

thanks.
Title: Re: Unable to connect to database !
Post by: Joachim Müller on September 16, 2007, 06:51:48 pm
Do as Nibbler suggested and ask you webhost for support. The number of items on each page doesn't have an impact on the "too many connections" issue.
Title: Re: Unable to connect to database !
Post by: eka on September 17, 2007, 03:12:17 am
Thanks GauGau.
Will check with web host.