XF 2.2 (Resolved) Posting a message takes a long time to complete, can't find cause?

Fullmental

Member
Hello, we are experiencing an issue where a user will post a response in a thread, either via quick reply or full reply, and that user will occasionally experience a 10-60 second wait before they see that post operation complete. However, from a separate tab it shows the post operation is almost instantly completed. This seems to occur regardless of post length or complexity - even the word "test" with nothing else can prompt a 60 second wait time before the poster's page refreshes. At other times, it's nearly instant though, so the issue is very intermittent. It also seems to happen on some profile posts as well.

We're trying to identify why this is occurring, and how the wait time can be reduced. Because the posts appear almost immediately on the front page, we don't think it is a database issue. We've tested disabling all add-ons and re-enabling them one by one, and no one add-on seems to really cause it.

I tried using the slow query logger by Xon and unfortunately I'm not seeing any helpful info there either (provided below in case I'm blind/dumb/both). Due to the intermittent nature of the issue, I'm unsure how to proceed. Is there any sort of logging tool we can use within XF that can pinpoint the specific issue?

Code:
[LIST]
[*]               
[*]Exception: Slow query: 15.2418 seconds, /forum/threads/first-world-problems.157/add-reply
[*]              
[*]src/addons/SV/SlowQueryLogger/Db/Mysqli/SlowQueryLogAdapter.php:387
[*]           
[/LIST]
          
[LIST]
[*]               
[*]Generated by: Fullmental
[*]              
[*]Aug 4, 2022 at 11:07 PM
[*]           
[/LIST]
       
      
[HEADING=2]Stack trace[/HEADING]
      
           #0 src/XF/Db/Mysqli/Statement.php(108): SV\SlowQueryLogger\Db\Mysqli\SlowQueryLogAdapter->logQueryCompletion()
#1 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#2 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#3 src/XF/Search/Source/MySqlFt.php(96): XF\Db\AbstractAdapter->insert('xf_search_index', Array, false, 'title = VALUES(...')
#4 src/XF/Search/Search.php(40): XF\Search\Source\MySqlFt->index(Object(XF\Search\IndexRecord))
#5 src/XF/Behavior/Indexable.php(46): XF\Search\Search->index('post', Object(SV\ThreadReplyBanTeeth\XF\Entity\Post), false)
#6 src/XF.php(365): XF\Behavior\Indexable->XF\Behavior\{closure}()
#7 src/XF/Mvc/Dispatcher.php(156): XF::triggerRunOnce(true)
#8 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#10 src/XF.php(512): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}
      
      
[HEADING=2]Request state[/HEADING]
      
           array(4) {
  ["url"] => string(49) "/forum/threads/first-world-problems.157/add-reply"
  ["referrer"] => string(73) "https://nuzlockeforums.com/forum/threads/first-world-problems.157/page-28"
  ["_GET"] => array(1) {
    ["/forum/threads/first-world-problems_157/add-reply"] => string(0) ""
  }
  ["_POST"] => array(10) {
    ["message_html"] => string(184) "<p>Went to the dog park and there was a giant hole in the fence.&nbsp;</p><p><br></p><p>Cool. Guess my dog can't play and have fun outside for the foreseeable future. Sorry, buddy!</p>"
    ["attachment_hash"] => string(32) "7e3dab1a39dcba625b3a58dc8fffd7df"
    ["attachment_hash_combined"] => string(85) "{"type":"post","context":{"thread_id":157},"hash":"7e3dab1a39dcba625b3a58dc8fffd7df"}"
    ["last_date"] => string(10) "1656841440"
    ["last_known_date"] => string(10) "1656841440"
    ["load_extra"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(47) "/forum/threads/first-world-problems.157/page-28"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Last edited:

webbouk

Well-known member
Hmmm, I've had similar over the past month or so when everything seems to hang returning to the post once submitted, yet if checked on a seperate device/browser the post has been submitted and all appears normal.
I've yet to find the reason behind it and it is as you say so random.

Firefox 103.0.01 and XF 2.2.01 inc patch
 

Fullmental

Member
Interesting, so it's not just us then. We've found it seems browser independent. While I was testing I found I could reliably reproduce about a 10-15 second delay in the post update simply by logging in as two different users on the same thread, and posting in an alternating fashion with a refresh in between each post. I used Firefox 103.0.01 and Chrome 104.0.5112.80 to manage this. It's also possibly notable that we use cloudflare as a CDN/DNS, but switching over to dev mode there doesn't seem to change much.

We were previously on an older version of XF, 2.2.1 and very recently upgraded to the latest, 2.210 patch 1. If anything we saw the problem get slightly worse. Also noticed that navigating away from the tab where the post was submitted can cause the response to go missed, and it will eventually time out. Seeing some query runs as long as 200 seconds if this happens, instead of 10-60.

We ran a slow-query log on our mysql database and it has come up with no entries so far, although it's only been logging for a few hours. We'll keep it going to see if it catches anything, but safe to say it's probably not the forums waiting on a database query to finish.
 
Last edited:

bzcomputers

Well-known member
Saw some similar slow posting and actual no posting issues recently right here on XenForo.com. Turned off my browser ad-blocker and issues went away. Might want to give that a test.
 

Fullmental

Member
Saw some similar slow posting and actual no posting issues recently right here on XenForo.com. Turned off my browser ad-blocker and issues went away. Might want to give that a test.
I don't personally use an ad blocker on our own site because we don't serve any real ads. Plus my chrome install is barbones, so no ad blocker even existed for that test.
 

Fullmental

Member
Took a few more troubleshooting steps this morning. We tried cloning our site to a test server with twice the RAM and CPU cores, and adjusted the database buffer pool size to match. Absolutely no change. Database queries are nearly instant, so it's definitely not a sql performance issue. Kind of at a loss here and wondering if there's some sort of bug?
 

Brogan

XenForo moderator
Staff member
Are there many members watching the threads, with email replies selected?

Although I'm not sure if that's an issue any longer due to the job table.
 

Fullmental

Member
Are there many members watching the threads, with email replies selected?

Although I'm not sure if that's an issue any longer due to the job table.
No, that doesn't seem to be the issue. I can recreate the problem in a brand new thread with nobody watching it. If I do start watching the thread, it doesn't seem to affect the delay's frequency or length either. At least, not by any significant amount.
 

PatriotGB

Active member
I saw the same thing a few days ago. It seems to have fixed itself. I have not installed any new addons at the time of the "symptoms," nor have I uninstalled any when it fixed itself.
 
Last edited:

Fullmental

Member
We managed to get this sorted. It was actually an addon, just one that was exhibiting issues even when it was disabled. It seems the addon added a requirement for XF Enhanced Search at the same time we removed ES from our installation. The resulting crossing of wires lead to a broken, hung up search indexing process that was only resolved after the addon was completely purged from the system, and even then it did not go quietly. We had to really convince it to uninstall...anyway, now that it's gone the site is nice and snappy again.

Thanks to @AndyB for the suggestion about uninstalling addons instead of just disabling them!
 
Last edited:
Top