xoops forums

shivaji

Friend of XOOPS
Posted on: 2004/11/29 17:26
shivaji
shivaji (Show more)
Friend of XOOPS
Posts: 179
Since: 2003/9/18
#1

What is there in line 34 of databasefactory.php ?

This page cannot be displayed due to an internal error...

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


This becomes a very common error for XOOPS site. We hosted our website with RackSpace and even mainfile.php is perfectly okay.

I realised that this error is not relate to any particular XOOPS version becuse I got this similar error in XOOPS 2.05 and even in latest version. I found, it mainly occurs when there are too many user visitors surfing our website at same time.

is it a bugs or its a bandwith problem of our web server? what is there in line 34 of databasefactory.php ?

hervet

Friend of XOOPS
Posted on: 2004/11/29 18:27
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#2

Re: What is there in line 34 of databasefactory.php ?

Hi,

Do you use MySQL persistent connections or do you have a limit of connections ?

Bye,
Hervé

Mithrandir

XOOPS is my life!
Posted on: 2004/11/29 19:28
Mithrandir
Mithrandir (Show more)
XOOPS is my life!
Posts: 6320
Since: 2003/6/21
#3

Re: What is there in line 34 of databasefactory.php ?

Quote:
what is there in line 34 of databasefactory.php ?

This:
33: if (!$instance->connect()) {
34:     trigger_error("Unable to connect to database"E_USER_ERROR);
35: }

I.e if the database cannot be connected to, it throws this error.

As you say yourself:
Quote:
I found, it mainly occurs when there are too many user visitors surfing our website at same time.
Which really is not all that surprising

shivaji

Friend of XOOPS
Posted on: 2004/11/30 3:13
shivaji
shivaji (Show more)
Friend of XOOPS
Posts: 179
Since: 2003/9/18
#4

Re: What is there in line 34 of databasefactory.php ?

Quote:

hervet wrote:
Hi,
Do you use MySQL persistent connections or do you have a limit of connections ?
Bye,
Hervé


Herve,

Persistent connection is off :

// Use persistent connection? (Yes=1 No=0)
// Default is 'Yes'. Choose 'Yes' if you are unsure.
define('XOOPS_DB_PCONNECT', 0);

shivaji

Friend of XOOPS
Posted on: 2004/11/30 3:47
shivaji
shivaji (Show more)
Friend of XOOPS
Posts: 179
Since: 2003/9/18
#5

Re: What is there in line 34 of databasefactory.php ?

Quote:

Mithrandir wrote:
Which really is not all that surprising


Yes it is. We have active forum with 27,000 members, and on average sometime 100+ users use IPBM forum at same time. We have Bandwidth of 200GB/month, Apache 2.0, Memory : 1GB DDR RAM, Hard Drive 1 : 80GB EIDE, Operating System : Red Hat Enterprise Linux ES 3, Processor : Single AMD Athlon XP 2600+ 2.133 GHz., MySQL 3.23.58-2.3, webalizer 2.01_10-15.ent, php 4.3.2-14.ent.

Xoops persistent connection is off. What I am asking, is it a problem of MySQL that it can not take more queries and crash. What is the reason behind that ? I have never seen xoops.org website having this problem with a massive users surfing website at same time.

FYI, this strange error comes, reamins there for maxium 1-2 minute on average, and again evrything get normaal and site become LIVE. This occurs 2-4 times a day during pick hours.

brash

Friend of XOOPS
Posted on: 2004/11/30 4:06
brash
brash (Show more)
Friend of XOOPS
Posts: 2206
Since: 2003/4/10
#6

Re: What is there in line 34 of databasefactory.php ?

Is the webserver and database hosted on the same server? Do you have FULL control of you environment, or do you have some restrictions? The first place I'd be looking is at your server, as it'll hold all the clues. See if you can track CPU/ I/O and RAM usage over your peak periods.

shivaji

Friend of XOOPS
Posted on: 2004/11/30 4:16
shivaji
shivaji (Show more)
Friend of XOOPS
Posts: 179
Since: 2003/9/18
#7

Re: What is there in line 34 of databasefactory.php ?

Is the webserver and database hosted on the same server?

REPLY: Yes, I already open a ticket at rackspace.com for that to know. Its a good question, I will get back to you.

Do you have FULL control of you environment, or do you have some restrictions?

REPLY: We appointed Freelancer from US recommended by RackSpace to manage our PLESK CP, DB, Backup and Server. Jim has full rights and access to environment.

The first place I'd be looking is at your server, as it'll hold all the clues. See if you can track CPU/ I/O and RAM usage over your peak periods.

REPLY: Can I PM You ?

brash

Friend of XOOPS
Posted on: 2004/11/30 4:29
brash
brash (Show more)
Friend of XOOPS
Posts: 2206
Since: 2003/4/10
#8

Re: What is there in line 34 of databasefactory.php ?

PM away . Must warn you though that my background is Windows, so I may be of limited use to you for diagnosing Red Hat configuration issues.

hervet

Friend of XOOPS
Posted on: 2004/11/30 6:16
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#9

Re: What is there in line 34 of databasefactory.php ?

IPB must use too much queries

shivaji

Friend of XOOPS
Posted on: 2004/11/30 6:45
shivaji
shivaji (Show more)
Friend of XOOPS
Posts: 179
Since: 2003/9/18
#10

Re: What is there in line 34 of databasefactory.php ?

Is the webserver and database hosted on the same server?

REPLY: Yes. Its in same place. Now I make persistent connection to 1.