News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Index.php loads in 30 seconds.

Started by donjoe, December 06, 2008, 02:50:53 PM

Previous topic - Next topic

donjoe

SMF v1.1.7 here.

For a number of days (maybe a week or two) I've had the following problem: about 60-70% of page requests from the forum are served normally (fast enough), but the rest of the time it takes almost exactly 30 seconds per request. I've looked at this with the Firebug extension of Firefox and it said the index.php?<plus various options retrieving data from the database> was what took so long every time.

Any ideas as to what might be going wrong?

Thanks.

Bradderz

Is anyone else having the same problem?

donjoe

#2
Today I started getting something new: blank pages with the text
"Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later."

My host recommended I use repair_settings.php, so I did. No good. Still having the problem.

My database is 17.7 megs big. SMF wouldn't have any problems at this size, would it?

(Seems like right now my problem resembles this one: http://www.simplemachines.org/community/index.php?topic=253813.0)

SlammedDime

There are many SMF forums running with well over millions of posts, including this one, so database size is a non issue.

Are there any errors in your forum error log or hosting error log that are related to this?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

donjoe

Nah, only some users getting their passwords wrong and a few guests getting this:
"http://forum.atei.ro/index.php?action=register2
8: Undefined index: visual_verification_code
File: /home/ateiro/public_html/forum/Sources/Register.php
Line: 171"

The hosting error log (for this month) only has these two messages:
"[Mon Dec  8 14:35:57 2008] [error] [client 72.30.142.165] File does not exist: /home/ateiro/public_html/wiki/robots.txt
[Mon Dec  8 13:34:19 2008] [error] [client 67.195.37.190] File does not exist: /home/ateiro/public_html/forum/robots.txt"

SlammedDime

If you look in the Server and Performance Configuration board, there is a file called status.php in one of the sticky topics.  Put that on your server and next time a page is taking a long time to load, open up Status.php and either take a screen shot of the server load and any hung sql queries and post them here.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

donjoe

#6
I'm not sure if I got this right, but I waited until the 30 seconds elapsed and the page loaded and then I opened status.php in another tab - the result is attached.

Oh yeah, and in the meantime I found another thread about the "could not connect to database" error where the user upgraded their database to 1.1.7 using upgrade.php. Done that. Didn't change anything. And got some warnings:
Updating Settings.php... Successful.

Warning: file(/home/ateiro/public_html/forum/upgrade_1-1.sql) [function.file]: failed to open stream: No such file or directory in /home/ateiro/public_html/forum/upgrade.php on line 1126

Warning: implode() [function.implode]: Invalid arguments passed in /home/ateiro/public_html/forum/upgrade.php on line 1138

Warning: Invalid argument supplied for foreach() in /home/ateiro/public_html/forum/upgrade.php on line 1140
Successful.
Taking the forum out of maintenance mode... Successful.


SlammedDime

I'd need to see the server status, while the page is loading, in the middle of that 30 seconds, not after it.

As for the upgrade error, you not only need to upload upgrade.php, but also the sql files in the package, then run upgrade.php
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

donjoe

OK, upgrade was all around successful. Didn't solve the problem.

Attached is a status snapshot taken during one of those long loads.

SlammedDime

Nothing really looks out of the ordinary there...
Do you have Persistent Database connections enabled?
And  is this a shared server, vps, or dedicated?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

donjoe

Quote from: SlammedDime on December 08, 2008, 05:16:56 PMNothing really looks out of the ordinary there...
Well, there's the information that MySQL wasn't really doing much while the RAM was completely full. Host said they'd check how much of the RAM my forum was using.

QuoteDo you have Persistent Database connections enabled?
I tried that for a while since yesterday, but disabled it when I ran repair_settings.php earlier today.

QuoteAnd  is this a shared server, vps, or dedicated?
If shared means other clients' websites are being hosted on the same machine, then it's shared. I don't know what "vps" is and I take "dedicated" to mean the opposite of "shared". *shrugs*

donjoe

Well, one thing that changed with all those attempted solutions the other day was that the forum/server stopped responding with those blank pages - "Connection Problems" etc. But some queries still take 30-31 seconds.

(BTW, I don't know what's wrong with this topic here, but I can't see it when I browse the "SMF 1.x Support" forum...)

donjoe

I've tried creating a parallel database and importing the information from the active one into it, then instructing my SMF to use this new one instead. No change.

In the meantime I've noticed something that resembles another thread from this support forum: the 30-second problem is cyclic, it doesn't depend on the individual query or number of queries. For 30 seconds everything works fine, then for another 30 seconds all page requests to the forum each take 30 seconds to be served. And then it's fine again for 30 seconds and so on.

Could this in any way be due to the host's MySQL version, reported to me as "4.1.22-standard"?

SlammedDime

Did your host ever get back to you on how much resources your account was using?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

donjoe

Nope, but today they offered to move my website to another server where they have MySQL 5.0.52a. I'll see how that goes.

SlammedDime

Let us know once they have you up and running there.  MySQL 5 is definitely much better on resources than 4.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

donjoe

Nope, same thing with the 30-second queries. Now I'm not even sure changing my host would help anymore.

Isn't there some other diagnostic I could try to get to the bottom of this?...

SlammedDime

I'm going to move this topic to the performance and server config board, see if anyone has any suggestions for you.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

青山 素子

Are hostname lookups disabled? You could have a host with a bad DNS server and be hitting the timeout on that every time.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


donjoe

It's not everytime, it's just every 30 seconds: http://www.simplemachines.org/community/index.php?topic=278867.msg1840296#msg1840296

I don't know what "hostname lookups" are. Should I ask my host if they're disabled on their DNS?

Advertisement: