SMF slow to create new posts

Started by arcadeflorida, June 25, 2019, 11:33:16 PM

Previous topic - Next topic

arcadeflorida

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.

arcadeflorida

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?

arcadeflorida

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!

vbgamer45

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

arcadeflorida

Thanks for the reply.

Per the first post it varies

QuoteFor 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).


SpacePhoenix

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?

arcadeflorida

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?

Sir Osis of Liver

What are your sessions settings?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

arcadeflorida

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.

Sir Osis of Liver

Quoteif 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?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

arcadeflorida

Quote from: Sir Osis of Liver on June 26, 2019, 12:29:35 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.

Sir Osis of Liver

Did you disable 'Allow browsers to go back to cached pages'? Disable caching?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

arcadeflorida

Quote from: Sir Osis of Liver on June 26, 2019, 12:35:49 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.


Sir Osis of Liver

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?

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

arcadeflorida

Quote from: Sir Osis of Liver on June 26, 2019, 12:51:55 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.

arcadeflorida

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.

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

arcadeflorida

Quote from: Kindred 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.

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.

rbradbury

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 -
QuoteI 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

wunderbunny

Likewise.  I moved to a new host this week.  Every time someone hit 'post', it was a 30 second wait.  Members were so confused, they hit "post" again and we got two posts.

I adjusted the mail server settings and now it's a 5 sec wait.

Advertisement: