• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..17-Mar-2006-

READMEH A D27-Jul-20051.6 KiB3526

memoryH A D03-Aug-20052.5 KiB9662

README

1The memory module works as follows. The module remembers ordered lists of
2A/V pairs (ordering only guaranteed among attributes of same type) based
3on an index value.
4
5On the request list, two attributes are special: 'op' (operation) and 'key'.
6
7The operation given by 'op' can be one of:
8
9	Store		- overwrite data in A/V pair container 'key'
10	Add		- add attribute/value pairs to container 'key'
11	Concat		- concatenate values with existing attributes
12	Load		- retrieve pairs from container 'key
13	Load-Purge	- idem, removing pairs from container
14	Purge		- remove pair from container
15
16The rest of the attribute/value pairs sent to the module (controlled by
17the sendattr acl) are stored and retrieved as-is.
18
19For all operations, an additional last 'int' is returned that contains the
20total number of pairs stored in the container before the requested operation
21took place.
22
23It is important to note that the module will have a hard maximum amount of
24memory available and will remove excess containers on a LRU basis. Therefore
25behaviour files must always be prepared for the 'int==0' case and handle this
26the same way as an unexpected later packet (eg. reset peer and state machine).
27
28We use the binary module interface for efficiency, and Perl for the efficient
29hashes it offers. An external module allows for an easy way to check and
30control memory usage and remove state without bringing down the whole server.
31
32If it's a problem from a CPU/memory bandwith/scheduling perspective, we can
33always rewrite it in C, and if even that doesn't help enough, optimize this
34into an internal module (using a VM trap).
35