Recent Topics

1 Aug 18, 2007 03:31    

My b2evolution Version: 1.10.x

I recently moved from 0.9.1 to 1.10.2 and since then, every so often the blog dies with the following error:

An unexpected error has occured!
If this error persits, please report it to the administrator.
Go back to home page

Additional information about this error:
MySQL error!
Error establishing a database connection!
(User monte_bvlt1 has already more than 'max_user_connections' active connections)

I reported it to my host and they of course pointed @ the software:

Please check that you are not using persistent connections to the database. This is a common cause of this problem. Also, make sure each script has it's own username and database.

I have no idea where to check in B2evo for the persistent connection settings. Also, has anything changed between 0.9.1 & 1.10 that would cause me to run out of connections?

Other actions taken so far:
- I did the whole Analyze/Repair/Optimize thing via myPHPAdmin for both my blog DB & my Gallery DB.

No telling if this helped, since it's an intermittent problem, but time will tell I suppose.

I am actually leaning toward something outside of b2evo causing it since I also changed servers at the same time, but I need to fully investigate this path before my host's tech support will of much help.

Info from SiteAdmin:

Operating system  	Linux
Linux kernel version 	2.6.9-55.0.2.ELsmp
Apache version 	1.3.37 (Unix)
Perl version 	5.8.7 (more info)
PHP version 	PHP/4.4.4 (more info)
MySQL version 	4.1.21-standard-log

From the mysql section of phpinfo:

mysql
MySQL Support	enabled
Active Persistent Links 	0
Active Links 	0
Client API version 	4.1.21
MYSQL_MODULE_TYPE 	external
MYSQL_SOCKET 	/var/lib/mysql/mysql.sock
MYSQL_INCLUDE 	-I/usr/include/mysql
MYSQL_LIBS 	-L/usr/lib -lmysqlclient

Directive	Local Value	Master Value
mysql.allow_persistent	Off	Off
mysql.connect_timeout	60	60
mysql.default_host	no value	no value
mysql.default_password	no value	no value
mysql.default_port	no value	no value
mysql.default_socket	no value	no value
mysql.default_user	no value	no value
mysql.max_links	Unlimited	Unlimited
mysql.max_persistent	Unlimited	Unlimited
mysql.trace_mode	Off	Off

Thanks!

2 Aug 18, 2007 04:35

I give a quick answer because it's after midnight and I need sleep before tomorrow.
1) Google for 'sql presistant connection php' and you find enough background information
1a) A persistant connection is something like an open line to the database that will be open for several hours (8-12).
2) Check the B2evo code for mysql_pconnect() calls and change them to mysql_connect.
3) You can close non-persistant connections with close_connect() - will not work on persistant connections.
4) You can have several hundred connections simultaniously. So you have a lot of visitors or your host has a low max_connections variabe set.

It is interesting this problem comes up after the upgrade. I think a notice in the bug section of the forum will alert the developers to the matter.

If you need a temporary solution, create a static page for the frontpage of your blog.

Good luck

3 Aug 18, 2007 05:21

Did you recently install the gallery plugin? Can there be any connection between instaling or upgrading the gallery plugin and the probem occuring?

If so, disable the plugin for the time being, wait till all persistnt connections are closed (several hours) and see if the problem returns.

4 Aug 18, 2007 19:52

Thanks.

Actually the Gallery to which I refer is a separate Gallery2 installation. I haven't even tried the b2e Gallery plugin. I think I will however, reduce the number of posts showing per page. That may help.

I know the basics of what a persistent connection is, & even get why it would be a problem, especially since 75% of my hits are probably spam & spiders, so the connections come quickly & aren't needed for long. But I can't see how b2evo could be making them, since looking at the settings further, they have them disabled according to phpinfo. I just got a response back from support after I pointed that out to them. All it said was:

Sorry, we didn't know if you had them enabled in a local php.ini file.

:roll: I used to actually get good support from these folks.

5 Aug 18, 2007 21:31

I am not an expert, but only recently I came across an article about persistent connections while searching for something related but completely different. I hoped the persistent connection could do some good, like an open connection between the front page of the blog and the database, but I soon found out, that is not what persistent connections are about.
As I recall from the article, is there a connection type that is default and persistent other than the mysql_pconnect()?
I noticed the max_persistent = maximal and the allow_persistent = off settings, but in my rather hasty first reaction I choose to write what I thought, hoping to give you a lead.

So your connections are non persistent. As I recall non persistent connections can live long if they are not closed. Furthermore It is no longer my guess the Gallery plugin is to blame, as was your conclusion also.
Do you or your host have a log of the database. There may be a clue.

Good luck

6 Aug 20, 2007 22:30

It went down again today, so reducing my number of posts per page (which should reduce the # of database calls) made no difference. When this happens, it also kills email & basic webpages on the server, so I don't think it's limited to (or even related to) b2evo.

7 Aug 21, 2007 00:29

Don't underestimate the possbility of bots trying to register a hundred times in succession or something similar. I've twice had a Russian bot roaming the blog for several hours and clicking everything clickable until my host alerted me I used too much CPU power.
I hope you find a solution soon.

Good luck

8 Aug 21, 2007 05:39

I would go along with that if it weren't for the fact that my hit counts are about the same as on the previous server. I suppose if it were bursts of traffic it could cause issues, but it seems odd that the change in traffic would be timed with the move to a different box. Unless the new version of b2evo really has that much more overhead, which seems unlikely. *shrug* Just kind of thinking outloud.

9 Aug 24, 2007 07:34

Well, whatever was wrong with the server, appears to have been fixed. It took them a while, and of course they never said what was wrong, but it appears to be behaving.

10 Aug 24, 2007 12:18

That's the worst when the problem is solved "magically" and one never knows what really happened. May I ask, what host are you using? of course I may, I already did :-)
"The question is never indiscrete, only the answer" (from a film a watched a few days ago)


Form is loading...