1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Intermittent Speed Issue

Discussion in 'Troubleshooting and Problems' started by ScottLott, Mar 17, 2014.

  1. ScottLott

    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: Mar 17, 2014
  2. RoldanLT

    RoldanLT Well-Known Member

    Try to optimize your Mysql/Innodb config.
    Make sure it is using Innodb.
     
    ScottLott likes this.
  3. ScottLott

    ScottLott Member

    I'm using MySQL v5.1.7, it doesn't support Innodb.

    I guess you're saying it's time to upgrade the MySQL database?
     
  4. RoldanLT

    RoldanLT Well-Known Member

    Yes! since your using your own VPS, instead of upgrading to mysql 5.5/5.6, Replace it with MariaDB 5.5.36 ;).
    You can also try Percona.
     
  5. ScottLott

    ScottLott Member

    Alright, thanks! I'll do the upgrade and get back to you with the results.
     
  6. RoldanLT

    RoldanLT Well-Known Member

    Hope it helps (y)
     
  7. pegasus

    pegasus Well-Known Member

    Any add-ons? I recently saw a similar issue with NodesAsTabs enabled.
     
  8. ScottLott

    ScottLott Member

    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.
     
  9. RoldanLT

    RoldanLT Well-Known Member

    Using the latest version?
    Badly I have some plans of using it :(
     
  10. ScottLott

    ScottLott Member

    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: Mar 18, 2014
  11. ScottLott

    ScottLott Member

    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!
     

Share This Page