Disabling resource intensive features based on server load

Started by Ben_S, March 14, 2006, 04:33:04 PM

Previous topic - Next topic

Ben_S

SMF 1.1 introduces a new feature.

This new feature can be used to disable certain other features that can be hard on the server depending upon the server load.

Note, it is not recommended that you use these options if you are on a shared server as other users load will affect your board and you may find it being disabled when it doesn't need to be.

There is no admin interface for this feature to prevent people enabling the feature and locking themselves out of their forum.  You will need to enable it with phpMyAdmin (What is phpMyAdmin?).  This way you can just go back to phpMyAdmin and undo the changes.

To enable it, run the following query (you may with to adjust the values before hand)

REPLACE INTO smf_settings
   (variable, value)
VALUES ('loadavg_enable', '1'),
   ('loadavg_forum', '40.0'),
   ('loadavg_auto_opt', '1.0'),
   ('loadavg_search', '2.5'),
   ('loadavg_allunread', '2.0'),
   ('loadavg_unreadreplies', '3.5'),
   ('loadavg_show_posts', '2.0');


This will disable the forum completely if the server load is above 40, automatic database table optimization with a load above 1, search with a load above 2.5, users "show all unread posts" at 2, users "show all unread replies" at 3.5 and the profile > show users posts at a load of 2.

If you need to tweak any of the settings, you can just do a REPLACE INTO, e.g. to turn the feature off, you can run

REPLACE INTO smf_settings
   (variable, value)
VALUES ('loadavg_enable', '0');
Liverpool FC Forum with 14 million+ posts.

vbgamer45

Sweeet!! Cant' wait till SMF 1.1. This is going to rock!
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

ediww

Beep-beep-beep. Beep-woop-woo. Beep-boop.

vbgamer45

The dot's aren't required mainly there if you want to get to an exact limit
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

qtime

Is it possible to set different values according certain membergroups?

Ben_S

Liverpool FC Forum with 14 million+ posts.

Paracelsus

Quote from: Ben_S on March 14, 2006, 04:33:04 PM
REPLACE INTO smf_settings
   (variable, value)
VALUES ('loadavg_enable', '1'),
   ('loadavg_forum', '40.0'),
   ('loadavg_auto_opt', '1.0'),
   ('loadavg_search', '2.5'),
   ('loadavg_allunread', '2.0'),
   ('loadavg_unreadreplies', '3.5'),
   ('loadavg_show_posts', '2.0');


This will disable the forum completely if the server load is above 40, automatic database table optimization with a load above 1, search with a load above 2.5, users “show all unread posts” at 2, users “show all unread replies” at 3.5 and the profile > show users posts at a load of 2.

Discussion around this feature (which I was completely unaware of) has come up again in the MODs forum again and I would just like to ask:

1. The feature "Disable Forum" means that forum goes to Maintenance Mode?

2. Does anyone know the "best" tweaking values for each option? I'm not familiar with server load values, so I really don't know if values should be tweaked according to server-type, to forum size, to forum bandwidth, or if any other parameter should be taken into account.

Ben_S

1. Not Maintenance Mode, it uses a fatal error message (as far as I remember) to show the server load is currently too high, all access will be denied including admins.

2. There are no best values, they are entirely dependent upon the server you are on, if you are not on a dedicated server, I'd suggest you don't even bother with this feature since 90% of the time, the load will not be caused by your forum.
Liverpool FC Forum with 14 million+ posts.

Paracelsus

Tkx ;).

I just wondered if I should get worried with that.
Our forum, which consumes about 50 Gb bandwidth / month, had 1Gb disk space to use - 250 Mb for MySQL database and 410 Mb free space - and it crashed twice because of not enough disk space to execute those "temporary" MySQL table operations... but now it was upgraded to 5Gb and everything is smooth now.

But it's surely too small yet to cause any server load... ;D

Col

Hi Ben,

I understand that this should not be used in shared server environment, but what if the server has mod_perl2 installed? This enables resources to be assigned to individual accounts - might it be possible to use the individually assigned resource levels so that peoples' forums aren't being disabled because of a high total server load?

青山 素子

mod_perl doesn't have anything to do with resource assignment, it is merely a way to run perl scripts inside the Apache process instead of as a CGI.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


se7o.com

it show this error

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loadavg_forum', '7.0'' at line 1

Kill Em All

se7o.com, this post is quite old, MySQL probably had revisions and the code has probably changed, that is why it probably wont work.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Something like that

Quote from: Kill Em All on February 07, 2010, 09:59:32 PM
se7o.com, this post is quite old, MySQL probably had revisions and the code has probably changed, that is why it probably wont work.

That's standard SQL that's been around for decades. It's possible that he copied and pasted incorrectly.

Ricky.

I know this post is quite old but its very helpful as it saves your forum if there is sudden spike or something. However, is there way to customize message it shows and also to not to lock down forum for Admin?

Aleksi "Lex" Kilpinen

You can probably customize the message somehow, can't remember how this worked on 1.1 - but you can not make it so that it would care about your membergroup.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Ricky.

Ok, which part or what files deal with this settings.. .. that way I can look into myself !

Dzonny

This is really work?
It would be very helpflu to have somthing like this in admin panel.
Quote
This will disable the forum completely if the server load is above 40, automatic database table optimization with a load above 1, search with a load above 2.5, users "show all unread posts" at 2, users "show all unread replies" at 3.5 and the profile > show users posts at a load of 2.
by "server load above 40", u mean if server ram memmory is above 40% or what? :D

qtime

Quote from: Dzonny on January 01, 2011, 01:00:44 PM
This is really work?
It would be very helpflu to have somthing like this in admin panel.
Quote
This will disable the forum completely if the server load is above 40, automatic database table optimization with a load above 1, search with a load above 2.5, users "show all unread posts" at 2, users "show all unread replies" at 3.5 and the profile > show users posts at a load of 2.
by "server load above 40", u mean if server ram memmory is above 40% or what? :D
please check this http://www.lifeaftercoffee.com/2006/03/13/unix-load-averages-explained/ to find out.

Dzonny

Right, thank you, just read that, and get it :) I didnt know about that, couse i just moved from share to vps server.
So, anyone is using this on public forum? Is it working? Can it work with 1.1.12 version? :)

Advertisement: