Skip to content

[2.1] Bots - reduce topic view updates#9128

Merged
jdarwood007 merged 2 commits intoSimpleMachines:release-2.1from
sbulen:21_bot_views
Mar 14, 2026
Merged

[2.1] Bots - reduce topic view updates#9128
jdarwood007 merged 2 commits intoSimpleMachines:release-2.1from
sbulen:21_bot_views

Conversation

@sbulen
Copy link
Contributor

@sbulen sbulen commented Feb 25, 2026

This PR aims to minimize I/O during a bot attack by eliminating the tracking of guest & bot views in the smf_topics record. Note this counter is incremented under all circumstances, and causes yet another I/O during bot attacks.

An option is added, allowing the user to turn this behavior on or off. Users may wish to disable this only during high-CPU bot attacks.

I've been running this code on my prod forum with no issues.

If this is approved, I can submit a 3.0 version.

For more discussion see:
https://www.simplemachines.org/community/index.php?topic=592442.0

Feedback welcome.

Signed-off-by: Shawn Bulen <bulens@pacbell.net>
@jdarwood007 jdarwood007 added this to the 2.1.8 milestone Mar 8, 2026
@jdarwood007
Copy link
Member

@sbulen Do you have the related updates for 3.0 on this PR?

@sbulen
Copy link
Contributor Author

sbulen commented Mar 8, 2026

I was going to add 3.0 versions once the 2.1 ones were approved. Trying to avoid duplication of rework, etc.

This one has clear tradeoffs, but given there's a switch, folks can turn it on only when needed.

@jdarwood007
Copy link
Member

This is another one: do we need to implement the installer/upgrader logic if the feature is disabled by default?

I've tagged this on the 3.0 project with the 2.1.8 milestone.

Copy link
Member

@Sesquipedalian Sesquipedalian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary installer and upgrader changes.

@sbulen
Copy link
Contributor Author

sbulen commented Mar 12, 2026

Please remove unnecessary installer and upgrader changes.

This is another one: do we need to implement the installer/upgrader logic if the feature is disabled by default?

I had deliberately set it up so behavior is unchanged if no var is found. Felt safest. Also, easiest to patch, no update needed.

But I did add to the installer & upgrader, mainly because I like seeing all the 'real' SMF vars doc'd in that fashion. To my knowledge, we've always added them.

I'll go either way, just letting you know my thoughts.

@Sesquipedalian
Copy link
Member

There are already a number of other settings that aren't included in the install/upgrade scripts because they are disabled by default.

@sbulen
Copy link
Contributor Author

sbulen commented Mar 12, 2026

OK, I'll remove.

Signed-off-by: Shawn Bulen <bulens@pacbell.net>
@sbulen
Copy link
Contributor Author

sbulen commented Mar 12, 2026

Done.

Copy link
Member

@jdarwood007 jdarwood007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, will wait for a 3.0 version before I merge.

@jdarwood007 jdarwood007 merged commit 05f4aa8 into SimpleMachines:release-2.1 Mar 14, 2026
10 checks passed
@sbulen sbulen deleted the 21_bot_views branch March 15, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants