Advertisement:

Author Topic: [MOD][WIP]Smart Cache  (Read 6614 times)

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
[MOD][WIP]Smart Cache
« on: April 14, 2016, 11:28:11 PM »
I discussed in another thread about a cache system hack that was able to change the "Cache Level" depending on server load.
http://www.simplemachines.org/community/index.php?topic=544977

With the current offerings there is no automated way to up caching when needed. Most SMF admins will keep caching on the default of 1 or some may also choose a value of 2. A value of 3 is not recommended because data in caches will become stale at some point.

However in times of crisis stale data over a non-operational site may be preferred and a value of 3 is needed or desired. Since there is no automated method when a situation like this occurs, admins have to be constantly monitoring their site or it may become inoperable if the server is under distress.

What this is, it's a simple scale-able system that can be deployed before the current load balancing offerings of SMF 2.0.x to help remedy server stress in times of crisis. When loads go up, the cache level goes up and when loads go back down, so does the cache level.

Currently in the modification values are hard coded and are optimal on a 8 core system, like mine. In the future these will be configurable and moved to the control panel.

The configurable variables in the final release are as planned.
x Master enable disable check box.
x Page load time to enable lvl 2 caching, interger.
x Server load average to enable lvl 2 caching interger.
x Page load time to enable lvl 3 caching interger.
x Server load average to enable lvl 3 caching interger.

GitHub
https://github.com/sicommnend/SMF-Smart-Cache

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: [MOD][PENDING]Smart Cache
« Reply #1 on: April 21, 2016, 11:20:32 PM »
Decided not to go with the control panel route.

Went with general rule of thumb and statistics to determine appropriate variables. The install script figures out the appropriate values and saves them to the settings table. The script also checks to see if all requirements are met before going forward with the installation.

I am thinking about building a test script with all my modifications now, will save on support in the future.

Mod is now pending.