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

XF 1.2 Cache Rebuilding Process Takes Ages

Discussion in 'Troubleshooting and Problems' started by yavuz, Jan 14, 2014.

  1. yavuz

    yavuz Well-Known Member

    This is happening for quite some. It didn't bother me until I started to receive 500 internal server errors during an add-on installation.

    I have 60 add-ons, a compilation of simple and detailed ones (don't know how else to describe them) installed on my board. In the past I have installed and uninstalled a variety of styles and add-ons but currently there are also two styles installed which have two child styles.

    Why is the rebuild process taking such a long time, especially when it comes to rebuilding templates?

    Is there a way to detect, unused but in the database remaining templates or any other part of junk data that we can maybe flush out?

    Thank You.
  2. yavuz

    yavuz Well-Known Member

    It's also worth mentioning that I'm on a dedicated server with high specs:

    Harddisk: 2x 2000 GB SATA 3,5" 7.200 rpm
    CPU: AMD Opteron 3280 Octacore
    Barebone: Fujitsu PRIMERGY MX130 S2
    RAM: 24x Gigabyte RAM

    Memcached, APC and other optimization in place.
  3. Mike

    Mike XenForo Developer Staff Member

    The easiest option is to reduce the number of styles and languages you have.

    However, beyond that, optimization of MySQL writes is probably the most significant recommendation. These processes update a lot of data. (This can apply at the general filesystem level as well.)
  4. yavuz

    yavuz Well-Known Member

    2 Languages and 2 styles (with one child on each)... Is that a lot?

    I'll look furhet how I can optimize the mysql writes.
  5. Mike

    Mike XenForo Developer Staff Member

    You mention "one child each", does that mean you actually have 4 languages and 4 styles? You need to count all styles/languages that are installed, enabled or not.

    The cost to rebuild this is roughly number of styles * number of languages. In general, languages will "cost" more because we can't share compiled templates like we can with styles.

    You can see more on InnoDB optimization here: http://www.mysqlperformanceblog.com/2013/09/20/innodb-performance-optimization-basics-updated/
  6. yavuz

    yavuz Well-Known Member


  7. Mike

    Mike XenForo Developer Staff Member

    That would be considered 4 styles, though I appreciate that you can't really do much to reduce that if you're using both child styles actively.

    Essentially, there's 8 times the work of 1 style and 1 language. This is done at "compile time" to speed up the run time process (significantly).
    yavuz likes this.
  8. yavuz

    yavuz Well-Known Member

    I've increased some values at my server, the internal server errors disappeared for now. I'll be looking into optimizing my mysql settings. Thanks @Mike
  9. RoldanLT

    RoldanLT Well-Known Member

    I have 7 styles:

    Adding or Removing addon which rebuild templates, phrases takes 50 to 60 seconds, is this normal @Mike ?
    Or there are server settings that can be tune and speed up?
  10. Mike

    Mike XenForo Developer Staff Member

    Possibly in the normal range. Optimizing InnoDB is always worth it though. There are potentially some things that can be done at the filesystem level (disabling barriers, for example), but I wouldn't recommend that unless you understand what it does and what can happen.
    RoldanLT likes this.
  11. RoldanLT

    RoldanLT Well-Known Member

    I'm already using APC and Memcache, Is it fine to enable File Cache also on config.php?
    Would it help speed things up?
  12. Mike

    Mike XenForo Developer Staff Member

    Aside from APC, caching isn't going to make much of a difference with the rebuild process speed.
    RoldanLT likes this.
  13. yavuz

    yavuz Well-Known Member

    After I removed one language, it got a bit faster... Frustrating though English is sometimes needed.
  14. RoldanLT

    RoldanLT Well-Known Member

    OK, thanks Mike.
    Is it bad if I have a lot of customized phrases?
    My RM are almost all customized and some of XenForo default phrase.
  15. Mike

    Mike XenForo Developer Staff Member

    No, there should not be a significant difference based on that.
    RoldanLT likes this.
  16. yavuz

    yavuz Well-Known Member

    @Mike, I noticed that even after unistalling an addon the addon's phrases remain in the language. Is that default behaviour?
  17. Jeremy

    Jeremy XenForo Moderator Staff Member

    No. If the add-on auto generated phrases, its possible it didn't associate them correctly.
    yavuz likes this.
  18. RoldanLT

    RoldanLT Well-Known Member

    If you customize the phrase it's normal.
  19. yavuz

    yavuz Well-Known Member

    @Mike @Jeremy I've been doing some enhancements & performance tweaking and digging into the sites.

    Currently I’m trying to find the best configuration for my MySQL server.

    But please allow me to expand my findings: There are three XenForo sites on this server two share similar genres, near message count & user account, have same number of styles and languages installed. One of them is very slow in terms of add-on installation & rebuilding process. The same goes when someone wants to mark their forum read, it takes a lot of time.

    The other forum in the same niche, is very fast. Add-on installation doesn't take more than 30 seconds most at the time, marking forums read is also fast.

    The third website is tad different, has more users & posts and threads. More add-ons installed. However it shares the same fate with the other slow XenForo board.

    What I’ve done, beside the optimizing the header, expires, putting it behind CloudFlare, loading content from a cookieless domain, having memcached and ACP configured, I've also disabled the listeners and to find out if that made any difference, it doesn’t.

    I’m clueless about why this is happening. I hope there is a way we can determine the cause of this slowness.
  20. RoldanLT

    RoldanLT Well-Known Member

    @yavuz, Addon's installed?

Share This Page