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

Speed of posting replies slow - but site fast!

Discussion in 'XenForo Questions and Support' started by craigiri, Oct 2, 2012.

  1. craigiri

    craigiri Well-Known Member

    I know we've had many discussions about speeding up our sites, but this one doesn't seem to be addressed by itself.

    That is, my site is very fast - searching, listing and just clicking around.
    My server load is quite low - less than 1 with a quad-core.
    RAM is available - CPU use is not high.

    YET, at a number of times in the last couple of days, adding replies to a thread seem quite slow. The little timer on the upper right comes on and sometimes lasts 5 seconds or longer.

    Are there any hints here already - or any which folks can post here, which address possible logjams which may slow JUST that particular part of a forum - taking all of the above into account?
  2. lazy llama

    lazy llama Well-Known Member

    Do you have any anti-spam measures installed which check new posts against external databases etc?
  3. craigiri

    craigiri Well-Known Member

    No, nothing. Very few add-ons of any sort. Dedicated server. Not much else running on it.
  4. Marcus

    Marcus Well-Known Member

    You can add these lines in library/config.php to display the page execution time:
    $ips = array('199.99.444.555');
    $config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $ips) ? true : false);
    Go to whatismyip.com and copy the IP address into the first line.

    Then whenever you visit a page in your forum, you see at the bottom of the page the time your server needed to output this page.
  5. craigiri

    craigiri Well-Known Member

    Marcus, all the pages are very fast and the CPU is not being taxed.

    It is just the insertion of new material that causes the delay - that little thingy comes up on the right upper side and it takes 5-10 seconds for the page to refresh.

    I suspect it is related to the delayed writes and table locking in mysql, as there were/are a very high number of them showing. 1600 of them since I restarted the process about 12 minutes ago. Just a guess.....

    So I'm looking to see if any mysql gurus know how to specifically deal with speeding up inserts...when it seems like the server has room to do so! I will check with my admin (ISP dude) also - he's pretty smart on this stuff.
  6. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    I ran into this. Try disabling email notifications and see if that helps.
    The email notifications run in the same thread as the request, and were making all replies and posting really really slow

    Try adding this in your config.php and test again, if the site is responsive, then you know it was the email

    $config['enableMail'] = false;
    Jake Bunce likes this.
  7. craigiri

    craigiri Well-Known Member

    And if it is the email? I will try it, but if....then?
  8. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    First try it, if that is the case I could give you some hints
  9. craigiri

    craigiri Well-Known Member

    No, not the case....thanks......anyway. Still slow.....
  10. craigiri

    craigiri Well-Known Member

    Hmmm....another tidbit

    Posting in a private mod forum is MUCH quicker.....but a public or members-only forum is slower....

    Should that be the case anyway? The members-only forum in this case does not have a lot of posts in it.....
  11. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    The insert goes through the same table, so the amount of threads or post in the forum holds no correlation to the actual speed.
    Is posting a new thread as slow as posting in an existing thread ?

    Next suggestion: try disabling all the addons and see if the performance increases
    $config['enableListeners'] = true;
  12. craigiri

    craigiri Well-Known Member

    My guess is that it's mostly adding to a thread......none of the reported slowdowns were new threads.

    Right this minute it seems to have sped up a bit - but I will monitor over the evening and report back...and check next time is disabling the add-ons does anything.

    I should mention that I have very few add-ons and no new ones...and everything worked fine up until yesterday. At the same time, our db is growing and I know sometimes that slows things down....and also our busy time is here, although we are not "over the top" yet as far as traffic - 1,000 posts a day should be a piece of cake for a dedicated server.
  13. craigiri

    craigiri Well-Known Member

    Once the post makes it to the thread, editing is instant...not sure if that's a hint.

    My ISP is in there looking around at mysql logs now.....I'll report back if we find out anything.
  14. Brent W

    Brent W Well-Known Member

    slow query log might show something useful.
  15. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    All the information you gave to me kind of falls back to that email issue ...

    We discussed it a while ago

    Basically the issue is .. on new threads they are really fast, as there are no people subscribed to the thread, but on existing thread, and especially if the default is subscribe using email, the replies become really really slow

    Anyway, since it is a dedicated server, you can try a couple more things, one is on the mysql console or phpmyadmin, do a "SHOW PROCESSLIST" while posting something, so you can actually see if there is a query blocking things

    The second one is, depending on how you are starting mysql, you could go to the script (e.g. /etc/init.d/mysqld) and on the line that starts mysql log the slow queries, i.e.

    That will give you a log of which are the offending queries (if any). It could also be that your buffers for InnoDB are too low, but that will give you general slowness, instead of slowness only in some forums/threads
  16. craigiri

    craigiri Well-Known Member

    Great.....the email issue does not make sense, because one of the threads which was slow today has only 5 people who posted in it. Yet a similar short thread in another forum was quick as heck.

    We are going to check out all of the other stuff.
  17. craigiri

    craigiri Well-Known Member

    Is there any such thing as re-indexing the XF db, or does this all automatically occur as time goes by?
  18. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    you can do
    OPTIMIZE TABLE xf_post;
    OPTIMIZE TABLE xf_thread;
  19. discoian

    discoian Active Member

    I am having this exact same issue...new threads speedy, navigating around the forum...speedy, replying to posts, sometimes speedy, sometimes 5-20 seconds.

    I've tried disabling email notifications.

    This problem has only appeared in the past 2 days.
  20. craigiri

    craigiri Well-Known Member

    I suspect I could fix up my mysql conf a bit. It's really quite ragged.
    Any suggestions for ALL the needed lines in setup for mostly XF with the following specs?

    8 Gig Ram
    4 core 2.6 XEON

    1.2 million posts
    22,000 members
    Elasticsearch (eats up some RAM)

    Other - maybe 15% of the rest of the site (traffic) is served by older php/mysql ISAM tables and an old CMS. This, along with the ISAM tables in XF, probably need some settings in my.cnf?

    All on centos with mysql 5.0.77

    Sample conf settings welcome!

    Also, would upgrading mysql help a lot with something like this?


Share This Page