XF 1.2 Intermittent Speed Issue

ScottLott

Member
Hey Guys,
I've searched Google and the forums until my eye balls bled and haven't found a solution to this issue.

My forum will randomly drop to a snails pace for a few hours, then go back to normal, then back to a snails pace.

I'm running on a VPS, server load is minimal, the CPU never gets above 10%, the ram is less than 50% used, and I've got plenty of free hard drive space.

Here's what happens when it slows down:
- Pages take around 10 seconds to appear, then load pretty quickly once they appear.
- Ajax calls for things like the Alerts menu can take forever to load, and sometimes don't even load. (Just shows the loading bar in the top right forever).
- Posting threads, replies and edits take 30 seconds or more to apply, then the page won't redirect. This is causing some members to double post since the website isn't responding like it should.

Pages outside of XenForo, even ones that use the MySQL databases, aren't experiencing the random slow down.

My site is here:
www.RCPowers.com
 
Last edited:
Yeah, I've got these on:
- BBCode Media Sites Pack
- Custom BBCode Manager
- ParseHTML
- Tapatalk
- Thread Thumbnails.

I'm running v1.2.2, so the custom BB code plugin is still needed.

It's more than likely a MySQL related issue, I restarted the mySQL service on my server and that spead things up for a while.

I'll be doing the server upgrade tonight when there are less folks online.
 
I found the problem, there was another PHP script installed that was opening MySQL connections and not closing them. I updated the script with MySQL close commands and everything sped up.

I'll probably still update the MySQL server since 5.1 is reaching end of life soon.
 
Last edited:
Alright, another update.

The PHP files were part of the problem, but not the whole one.

Here's what I did after 3 days of pulling my hair out to get this fixed:

1 - Enable MySQL logging using the following sql queries:
Code:
set global general_log=1;
set global log_output='table';

This won't actually fix anything, but it will show you where all the time is being eaten up.

For me, I noticed that the MySQL server was taking 10 seconds or more to make the initial connection.

2 - Fix DNS issue.
A little Google searching led to a DNS issue being the problem. Since the database is on the same server as the website host software, it was a little confusing to me how this would be such a problem, but it was!

Just so everyone's on the same page here, the MySQL server was having trouble resolving "localhost". Yeah.

Anyway, this Stack Overflow page lead me to the final solution.

I updated my /etc/hosts file to the following:
Code:
127.0.0.1 localhost
::1 localhost
fe80::1%lo0 localhost

And just to be clear, the stack overflow question was addressing a Mac OS X server and I'm using Cent OS 6 on a VPS, so this isn't platform specific.

Anyway, hope that's helpless to someone.

Oh, and make sure you turn off logging when you're done. Dont wanna slow down things down again!
 
Back
Top Bottom