Advertisement:

Author Topic: SMF slow to create new posts  (Read 1600 times)

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
SMF slow to create new posts
« on: June 25, 2019, 11:33:16 PM »
Hey guys ran into a weird problem that started a few weeks ago.

SMF is slow to write new posts. Well I say it's slow, it appears to create the post instantly but it takes forever to return back to the forum index. The slowdown seems to increase depending on the amount threads.

For example a forum with say 2,000 threads will post almost instantly. Forums with 10k threads take 3-6 seconds, Forums with 90k-138k threads take up to 10 seconds. Forum has been running for over a decade and this just started to happen a few weeks ago. We've been on the same host for about 5 years.

What doesn't make sense to me is it's not a database write issue. For example if I open a 2nd window and refresh the new post gets made almost instantly.. but it takes 10 seconds for the posting browser to return back to the index. Very strange.

I've done everything I can think of, tweaked settings, ran maintenance tasks, checked database, etc. Today I did a fresh install and copied database over to eliminate the possibility of a rogue mod or corrupt install.. same problem.

I'm running SMF 2.0.15. Once again problem persists on fresh install, no mods, default theme.

Everything else is perfectly fine including loading and browsing forums. It only happens when you create a new post.

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #1 on: June 26, 2019, 12:31:59 AM »
Also forgot to add this which is also odd.

Replies are fine. Post a reply and it instantly posts and returns you to the index.

The problem is only on new posts.

Very, very strange!

Is there anything that governs what happens after you post that would cause the slowness?

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #2 on: June 26, 2019, 11:15:17 AM »
Did some more troubleshooting.. this is really driving me crazy!

Turned on page loads, even though it can take 10+ seconds to return to the index after a post I'm getting results in the page in this range:

Page created in 0.021 seconds with 19 queries.

Once again we know the post is getting added immediately it's just taking forever (or timing out on some of the larger boards) to return to the index after the post is made.

Tried deleting most of the users (on the test install) and problem persists so it's not like a board count or read/unread problem.

Watching server stats during a post doesn't appear that anything is jumping, also board is once again running fine in all other ways.. no slow downs browsing, reading, or replying.. just when making a new post.

Anybody have any ideas?

Thanks!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,570
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF slow to create new posts
« Reply #3 on: June 26, 2019, 11:39:39 AM »
How many posts do you have in the topics?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #4 on: June 26, 2019, 11:58:29 AM »
Thanks for the reply.

Per the first post it varies

Quote
For example a forum with say 2,000 threads will post almost instantly. Forums with 10k threads take 3-6 seconds, Forums with 90k-138k threads take up to 10 seconds. Forum has been running for over a decade and this just started to happen a few weeks ago. We've been on the same host for about 5 years.

The problem does seem tied to the number of posts but I'm not sure how? On my larger forums (with 130k topics) it takes forever to return to the index or it simply times out.

Once again through the post is made instantly, replies to same forum work fine (no lag).


Offline SpacePhoenix

  • Semi-Newbie
  • *
  • Posts: 95
Re: SMF slow to create new posts
« Reply #5 on: June 26, 2019, 12:09:36 PM »
Any changes made to the server (change of versions - PHP, MySQL, etc) around the time the problem started?

What mods are installed?

Is it a dedicated or shared server?

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #6 on: June 26, 2019, 12:17:03 PM »
Right now i'm testing on a fresh install of 2.0.15 only bringing over my database.

No changes to the server that I'm aware of, it is a shared server.

Once again what confuses me is that it's not slowing down writing to the DB, it's slowing down reloading the page after a new post is made.. anyone know what is different on a new topic being posted versus a reply?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,320
Re: SMF slow to create new posts
« Reply #7 on: June 26, 2019, 12:21:55 PM »
What are your sessions settings?

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #8 on: June 26, 2019, 12:25:30 PM »
Session is default, 2880

Obviously it shouldn't be hitting the session limit just to return after a topic though.

It feels like it's having a hard time loading something or negotiating something when returning.

Changing the option to not return to the post doesn't help. It's not a global problem as replies are not effected.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,320
Re: SMF slow to create new posts
« Reply #9 on: June 26, 2019, 12:29:35 PM »
Quote
if I open a 2nd window and refresh the new post gets made almost instantly.. but it takes 10 seconds for the posting browser to return back to the index.

This sounds like it's session related.  Have you tried disabling database driven sessions?

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #10 on: June 26, 2019, 12:31:33 PM »
This sounds like it's session related.  Have you tried disabling database driven sessions?

Yes, that is currently disabled.

I've tried all the (obvious) setting changes.

It's a weird problem, first time in the decade+ I've run SMF this has happened to me.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,320
Re: SMF slow to create new posts
« Reply #11 on: June 26, 2019, 12:35:49 PM »
Did you disable 'Allow browsers to go back to cached pages'? Disable caching?

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #12 on: June 26, 2019, 12:42:34 PM »
Did you disable 'Allow browsers to go back to cached pages'? Disable caching?

Yes, tried all of that unfortunately

If anyone wants to see what it's doing, the fresh install version i've been testing is at https://www.retroflorida.org/forum [nofollow]

I turned off all the registration requirements if anyone wants to make an account or if you PM me i can make one for you.

Thanks in advance guys! This has been killing me.


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,320
Re: SMF slow to create new posts
« Reply #13 on: June 26, 2019, 12:51:55 PM »
Quote
a forum with say 2,000 threads will post almost instantly. Forums with 10k threads take 3-6 seconds, Forums with 90k-138k threads take up to 10 seconds.
Quote
Turned on page loads, even though it can take 10+ seconds to return to the index after a post I'm getting results in the page in this range:

Page created in 0.021 seconds with 19 queries.

Appears that SMF is creating the posts normally, something is affecting the browser.  Only things I can think of are sessions or caching.  If the problem started without any changes on your end, your host may have changed something on the server.  You could be bumping up against a resource limit, or they may have done something involving server caching.  Have your php or mysql versions changed?


Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #14 on: June 26, 2019, 01:07:01 PM »
Appears that SMF is creating the posts normally, something is affecting the browser.  Only things I can think of are sessions or caching.  If the problem started without any changes on your end, your host may have changed something on the server.  You could be bumping up against a resource limit, or they may have done something involving server caching.  Have your php or mysql versions changed?

PHP and Mysql should be the same. Running PHP 5.6.

I've been on hosts that have throttled before but that usually slows the entire site down. What I'm confused by is why would this only effect new topic posts and not replies? Replies literally post and resolve back in 1 second but a new topic will 'hang' forever even though the post has been created normally.

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #15 on: June 26, 2019, 01:43:43 PM »
I think i figured it out.

It has to do with email.

I enabled Mail Queing and set it to only send 1 mail per page load, problem is gone!

I'm assuming SMF may attempt to send notification emails for new topics if people have it enabled? It's not something i've ever personally used but if enough users have it perhaps that's the problem?

I can only assume it doesn't send the same notification out for replies hence the disparity in speed. No clue, i'll keep testing but hopefully if somebody else has this issue this may help.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,508
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF slow to create new posts
« Reply #16 on: June 26, 2019, 01:55:16 PM »
avtually, it's more complicated than that....
SMF doesn't really do chron jobs...

what it does it trigger a job from the task list each time a page is loaded... -- EVERY load.... not sure why it would only make a difference when posting a message, but as long as you have it working again, we'll call it a win.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline arcadeflorida

  • Semi-Newbie
  • *
  • Posts: 11
Re: SMF slow to create new posts
« Reply #17 on: June 26, 2019, 02:09:26 PM »
avtually, it's more complicated than that....
SMF doesn't really do chron jobs...

what it does it trigger a job from the task list each time a page is loaded... -- EVERY load.... not sure why it would only make a difference when posting a message, but as long as you have it working again, we'll call it a win.

What also doesn't make sense is the mail queue is currently empty so it's not like there's some massive backlog. But it has made a night and day difference, posts are now going through normally. Big head scratcher for me but as you said if it works we won't get too upset about the hows.

Thanks again everyone for reading.

Offline rbradbury

  • Newbie
  • *
  • Posts: 1
Re: SMF slow to create new posts
« Reply #18 on: September 15, 2019, 06:02:01 PM »
Glad I read your post!  Just moved SMF to a new host.  All good in terms of overall performance  - pages launch much quicker than before. However, posting or replying to a message would take several seconds to commit. This was something new. So I tried this -
Quote
I enabled Mail Queing and set it to only send 1 mail per page load, problem is gone.
with the same result for me. Odd and seemingly inexplicable but happy with the result!
Thanks