1
ukandrewf
Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/6 11:58

  • ukandrewf

  • Friend of XOOPS

  • Posts: 198

  • Since: 2002/12/2


hi there,

I've searched on this problem but couldn't find an exact post regarding my problem.

I'm getting the 'Unable to connect to database in file class/database/databasefactory.php line 34'

However... the site is still up - give it a second or two and refresh and it's back.

I'm seeing a round 123 unique visitors an hour is this too much for XOOPS to handle?

I'm worried that maybe i'm using up all my database connections in peak moments. What is the max concurrent db connects XOOPS can handle?

thanks

Andrew

2
tedsmith
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/6 12:13

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


I don't know the factual answer for this, but I doubt 123 an hour will cause XOOPS problems. Besides, I think its the database backend which is more of the issue - how many can that handle? If its MySQL it should be thousands (I think). If its Access then not so good! Perhaps its more related to the amount of bandwidth your ISP allows you to have. For example, if you are having 123 visitors, and each are browsing a lot and downloading stuff, then your bandwidth requirement will have to be high. I'd check with your ISP and check what your prescribed service allows you.

Hope that helps.

3
Herko
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/6 12:15

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Quote:

ukandrewf wrote:
I'm seeing a round 123 unique visitors an hour is this too much for XOOPS to handle?

I'm worried that maybe i'm using up all my database connections in peak moments. What is the max concurrent db connects XOOPS can handle?

Does the speed of reading a book depend on the book itself? Yes, but the main factor is the reader. The same goes here. Does XOOPS influence the number of available connections? Yes. But the main factor is the (database) server. There's only so much you can do with XOOPS to optimise it's database resources use, by using (block) caching. But if the server itself is limited, you're only making a little room for better performance.

By comparison: xoops.org runs on a dual 700 mHz Celeron server, and we're getting about 7000 unique visitors/day.

Herko

4
tl
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/6 12:18

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Try to turn persisent connection OFF (if you have not done so) and see if that helps a bit. Linux/MySql tends to have the problem creating too many wasted MySQL connections with persistent connection ON

5
ukandrewf
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/6 16:00

  • ukandrewf

  • Friend of XOOPS

  • Posts: 198

  • Since: 2002/12/2


where is the persistent connect option? I couldn't seem to find it. (I think it's switched off but i'd have to check).

bandwidth isn't a problem despite the requirements being huge. I have an allowance of 80gig a month for the site.
3.7gig / day max so far this month - which could mean I'll need 111gig for this month.

when I've spoken to the isp they assure me that the load on the server is fine. But clearly there's some problem with the database server.

thanks for your thoughts

Andrew

6
ukandrewf
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/6 16:38

  • ukandrewf

  • Friend of XOOPS

  • Posts: 198

  • Since: 2002/12/2


ok my isp says:-

it seems the script is opening connections and forgetting to close them and they just accumulate until they bring the server down

I know that xoopsgallery is a new module which I'm using and is getting a real pounding with traffic.

xoops before the module was introduced didn't get the same levels of traffic.

(no it's not porn ;)

we broke the problem down and it's definely xoopsgallery which is creating the sleeper connections.


7
jgrimm73
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/12 12:22

  • jgrimm73

  • Friend of XOOPS

  • Posts: 6

  • Since: 2003/8/7 4


Has anybody gotten to the bottom of this yet?

I'm getting this same error on one of my XOOPS sites. I just started getting this error today. Previously I had been getting just a blank page??? Here is the strange order of events:

1. Many sites / scripts pointed to my hosting provider's MySQL server (about 10 XOOPS sites, 1 or 2 phpwebalbum - not as a module - , 1 or 2 oscommerce, etc.)
2. One day about 2 weeks ago, 1/2 of them start giving a blank page. No noticable rhyme or reason as to which ones work and which ones don't. All configured with the same db host and auth settings, pointing to different dbs, and directories, but other than that, identical configurations.
3. Moved one of the dbs off to my own privately hosted db servers and it works fine.
4. Went to move another one off and still got the blank page.
5. When I moved that second db back I started getting this error:

This page cannot be displayed due to an internal error.

If 
you are the administrator of this siteplease visit the XOOPS Troubleshooting Page for assistance.

Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34


I used standard phpmyadmin import / export stuff to move the databases. In troubleshooting I cleared both the /cache and /templates_c directory as well as turn on php debugging and delete all of the sessions in the config table.

Any help please, I'm totally stuck.

Thanks,

Jason

8
tl
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/12 12:50

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Quote:
Has anybody gotten to the bottom of this yet?


This is related to Xoops' inability of connecting to MySQL server. This can happen to a busy site especially on a shared server. As a matter of fact, it can happen to any site on a shared server. There is not much you can do since all sites share the same MySQL resource on the server. Alternatively you could find a hosting company using php-cgi where there is no persistent connection issue to deal with.

If you have your own server, then you can fine-tune the MySQL server to get the max performance.

You could occasionally notice xoops.org (on a dedicated server, I think) experiencing the same problem but would disappear shortly.

[edit]this is not a xoops-specific issue, it is true to any site using php/mysql combo [/edit]

9
ukandrewf
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/13 14:16

  • ukandrewf

  • Friend of XOOPS

  • Posts: 198

  • Since: 2002/12/2


humm interesting. Does anyone then know the tweaks (or areas to tweak) to get best performance from a shared server and 2) anyone know a cheap dedicated server host ;)

*OK I think my issues are now solved. I have shared hosting and see around 200 unique visitors an hour (which I think is pretty busy).

I had issues with xoopsgallery module leaving connections open when visitors had left - which over time rbought down the server - so i changed to Myalbum-p and everything is much better on that front now.

Part of the above process was to reduce the number of concurrent connections allowed between the application and database to 10. As traffic built back up i started seeing the error - then we increase the concurrent connections allowed to 30 and i haven't seen the issue since.

It woud be interesting to see if anyone could develop a formular for ow many connections are needed based on number of visitors an hour. For example 200:30 seems to be working well for me at the moment this is 6.66:1 but this might be high perhaps i only need 200:20 or 10:1 - and i guess it will partly depend on the type of content you have and howmany times your visitors are clicking/minute therefore.

I guess what we're saying is that if more than 10 people request something from the database at exactly the same time (in my example of 10 connections allowed) then the 11th/12th etc would see this error.*


thanks

Andrew

10
karuna
Re: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/7/14 14:36

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


i suffered from this problem.
yesterday my site got about 150 visitors online.and the the MySQL down. The host admin said it's my site got the MySQL down(i have enable cache even forum) ,and then closed my site for a day. the MySQL didn't down during this day.
so he added a maxquestions limit 30000 to my db. it's only enough to let the site work for about half an hour.
however 150 online is not the most online number.Once i got 800 online, and the MySQL didn't down. Is really strange when the MySQL down, is not the highest online visitor. is there any other possible reason to cause the MySQL down?

Login

Who's Online

351 user(s) are online (276 user(s) are browsing Support Forums)


Members: 0


Guests: 351


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits