Project

General

Profile

Feature #545

persistent variables in standalone are needed

Added by Jan Klopper over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
2011-12-09
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

We need a straightforward sollution for storing persistent information inside the server on standalone uweb instances.

This is needed for the Guard and Configserver programs in Janitor.

History

#1 Updated by Elmer de Looff over 12 years ago

  • Status changed from New to Resolved
  • Assignee changed from Elmer de Looff to Jan Klopper
  • % Done changed from 0 to 70

Each PageMaker instance now comes with a persistent attribute. This links to a class constant which is accessible for each pagemaker instance for the running process.

This class constant is a CacheStorage class, which supports Get, Set and SetDefault methods.
  • Get retrieves the value for a key, with an optional default (KeyError if none given, unlike dict.get())
  • Set writes an entry into the cache, (key, value pair)
  • SetDefault Gets the value for a key, but if the key does not exist, writes the default value in its place before returning.

The class has been made threadsafe by virtue of a Lock around its methods.

The templateparser and various database connections have been stored in the CacheStorage as well, in the knowledge that neither Apache or Standalone run multiple threads per process (if they would, SQLTalk.mysql would abort, this seems very much not the case). This has increased the performance measured in #526 from 2200 req/s to ~2800 req/s under similar conditions).

#2 Updated by Jan Klopper over 12 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100

seems to work

Also available in: Atom PDF