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

Website crashing ever since xenforo install. Possible causes?

Discussion in 'XenForo Questions and Support' started by andrewkm, Oct 18, 2012.

  1. andrewkm

    andrewkm Active Member

    Ever since we installed xenforo we have had some serious issues with our site hanging completely until a vm restart is done.

    Previous issue thread:http://xenforo.com/community/threads/website-issues-session-table-problems.39022/#post-430754
    Increased tmp partition -> 2GB
    If you have any information regarding above thread please let me know.

    Anyways onto this problem. Regarding server hanging untill a vm restart is done; and all is well again.
    While it was hanging a noticed this in ram usage: http://i.imgur.com/SHr8m.png

    After a VM reboot all was well; website was once again up and working as it should (Untill next time - happens once a day-two)

    After reboot ram usage: http://i.imgur.com/OpMdS.png

    Also noticed this after reboot when checking xenforo logs:
    http://i.imgur.com/f6GQW.png
    (im assuming its something to do with the mysql connections loses since thats when site started to go down) - Unless the other errors have something to do with it; please shed some light on this topic.

    Really needing help :) Thanks for any and all responses.
    Info regarding VPS if needed:
    (2GB ram, 25GB storage, 2vcpus, only xenforo and a media wiki is on the vm nothing more)
     
  2. Insy

    Insy Well-Known Member

    You must have a misconfiguration of MySQL that causes to crash your vm. I recommend you to optimize the MySQL setup, increase the number of open files if needed before accusing XenForo ;)
     
  3. Walter

    Walter Well-Known Member

    How many memory have you given to Mysql? It's probably the best to post your My.cnf file...

    Maybe Mysql is eating up all RAM until the VM is killed?
     
    Insy likes this.
  4. andrewkm

    andrewkm Active Member

    Not accusing; just highly confused and new to xen :( (Sorry) - Thanks for the advice I shall look into it; anywhere you recommend starting regarding options to change?
     
  5. andrewkm

    andrewkm Active Member

    [mysqld]
    set-variable = max_connections=500
    log-slow-queries
    safe-show-database

    query_cache_type=1
    query_cache_limit=1M
    query_cache_size=256M
    key_buffer_size=256M
    thread_cache_size=6
    table_cache=1024
    tmp_table_size=64M
    max_heap_table_size=64M
     
  6. Walter

    Walter Well-Known Member

    Download the mysqltuner script from https://github.com/rackerhacker/MySQLTuner-perl and look how much memory Mysql will use.

    Allowing 500 connections is really a lot for only 2 GB RAM but I don't have all the default values of Mysql in my mind (as you didn't specifiy many vars in your config file) to calculate memory consumption.
     
    Jake Bunce likes this.
  7. andrewkm

    andrewkm Active Member

  8. Walter

    Walter Well-Known Member

    Exactly as I thought. Mysql will use more RAM than you have in your VM :)

    First thing to do is to reduce the max_connections now. I highly doubt you really need 500 connections. A Mysql connection is not the same as a user online :)
    For a normal forum 100 should be enough for a long time.

    Next thing is to enable Innodb caching, this will make your forum a lot faster :)
    Just add

    innodb_buffer_pool_size=100M

    This will add 100MB buffer for Innodb.
     
    Jake Bunce and andrewkm like this.
  9. andrewkm

    andrewkm Active Member

    Thanks for all the wonderful advice :) Applying all these changes now.
    Also in the report I see it asks me to run OPTIMIZE TABLE -> should I do this through phpmyadmin on the entire xen database? Would it be safe to do so?
     
  10. CyclingTribe

    CyclingTribe Well-Known Member

    Also, try reducing the query cache size too 16M and increasing the key buffer to 512M (stop and start MySQL for the changes to take effect). (y)
     
    Jake Bunce and andrewkm like this.
  11. Walter

    Walter Well-Known Member

    Report back the outcome. But should help tremendously.

    Thats a good idea from time to time but not urgently needed. And before you optimize the tables, I highly recommend a) closing the forum and b) making a backup of the complete database.
     
    andrewkm and CyclingTribe like this.
  12. andrewkm

    andrewkm Active Member

    Alright ran optimize; looks like all went fine.
    I will report back in this thread if crashing/etc continues :)
     
  13. andrewkm

    andrewkm Active Member

    Hey walter have a question for you.
    My WHM has an option to upgrade mysql from 5.1 to 5.5
    Would doing so be safe/unsafe for xenforo? (I have heard great things regarding performance and mysql 5.5 when compared to 5.1)
    * Of course I shall do full backups before doing so.
     
  14. Insy

    Insy Well-Known Member

    I use XenForo with MySQL 5.5 and CPanel with no issue. But this does not dispense yourself to optimize your MySQL configuration once upgraded ;)
     
  15. andrewkm

    andrewkm Active Member

    Upgraded to 5.5 all systems go and no issues from what I can see :) Lets see how the next few days play out. Thanks everyone for your help!
     
    CyclingTribe and Insy like this.

Share This Page