- Usage
- Settings
- Modules
- Admin
- ???
- Client
- ???
- Admin
- Introspection
- ???
- Receive
- ???
- Route
- ???
- Send
- ???
- Validate
- ???
zefina
uses a single INI file for all configurations.
In all the INI examples, the default values are used.
Enable/Disable
For the enable/disable
values, the following are excepted as alternatives:
enable | disable |
---|---|
enabled | disabled |
true | false |
yes | no |
1 | 0 |
Capacity/Size
When specifying sizes, the following suffixes must be used:
suffix | meaning | power-of 2 |
---|---|---|
b | bytes | (2^1) |
k | kilobytes | (2^10) |
m | megabytes | (2^20) |
g | gigabytes | (2^30) |
Except for bytes, the size of the Memory Pool will be a Power-Of-2.
Meaning 1k
is the same as 1024b
.
And 1m
equals both 1024k
and 1048576b
.
When using bytes (b), the size will be rounded up to the nearest 64-byte boundary.
Time
When specifying time, the following suffixes must be used:
suffix | meaning |
---|---|
ns | nanoseconds |
ms | milliseconds |
s | seconds |
m | minutes |
h | hours |
d | days |
y | years |
[zefina]
The [zefina]
section is used to configure and refine zefina
's abilities.
Admin
The Admin allows Zefina to respond to administration messages. These messages allow Zefina to report its state as well as load and unload modules.
Note: Zefina must be compiled with admin support for these settings to have any affect.
admin=disable
admin_dynamic_module=disable
admin_dynamic_module_admin=disable
admin_dynamic_module_client=disable
admin_dynamic_module_introspection=disable
admin_dynamic_module_reader=disable
admin_dynamic_module_route=disable
admin_dynamic_module_validate=disable
admin_dynamic_module_writer=disable
admin_update_config=disable
admin
Default: disable
Allows the Admin Module to be enabled or disabled.
If the Admin Module is disabled, then all administration messages will be ignored.
To receive administration messages, enable admin
and restart the Zefina service.
admin_dynamic_module
This setting will enable the ability for modules to be loaded and unloaded during runtime. Enabling this setting only enables the feature. Each individual module type must be enabled. Those types are:
admin_dynamic_module_admin=disable
admin_dynamic_module_client=disable
admin_dynamic_module_introspection=disable
admin_dynamic_module_reader=disable
admin_dynamic_module_route=disable
admin_dynamic_module_validate=disable
admin_dynamic_module_writer=disable
Note: Zefina must be compiled with admin_dynamic_module support for this setting to have any affect.
admin_update_config
If the settings change during runtime, this setting will enabled Zefina to write out the settings. When Zefina restarts, the new settings will automatically be used.
Note: The setting file must be writable for this feature to work.
Log
log=enable
log_interval=60s
log_type=file
log_file=/tmp/zefina_service.log
log_interval
how often the log should be written
log_type
file: log to file bundle: log to bundle
log_file=/path/to/log
Paths
path_module_introspection=introspection/
path_module_reader=reader/
path_module_validate=validate/
path_module_route=route/
path_module_writer=writer/
path_module_admin=admin/
path_module_client=client/
path_memorypool=ram/
Relative paths are relative to the Zefina Service executable.
Memory Pool
Memory Pools define a region of memory to be used by one or more modules.
A Memory Pool section is identified by the type
key.
The Memory Pool's section name is the name of the Memory Pool.
[fizbix]
type=memory_pool
defrag=
resizable=
size=8m
suffix | meaning | power-of 2 |
---|---|---|
b | bytes | (2^1) |
k | kilobytes | (2^10) |
m | megabytes | (2^20) |
g | gigabytes | (2^30) |
Except for bytes, the size of the Memory Pool will be a Power-Of-2.
Meaning 1k
is the same as 1024b
.
And 1m
equals both 1024k
and 1048576b
.
When using bytes (b), the size will be rounded up to the nearest 64-byte boundary.
[MEMORY POOL NAME]
The name of the Memory Pool. The Memory Pool name can not contain any white-space and is limit to 16 bytes in length.
All keys are required.
type=memory_pool
Specifies that this section is a Memory Pool.
defrag=EVENT
Determines when the Memory Pool should defragment segments. If no EVENT s are given, then the Memory Pool will never defrag itself.
Use a comma delimited list of which events should trigger defragmentation.
Event | Meaning |
---|---|
alloc | Before memory is allocated, defragment the Memory Pool |
free | After memory is free'ed, defragment the Memory Pool |
acquire | Before memory is acquired, defragment the Memory Pool |
release | After memory is released, defragment the Memory Pool |
resizable=AMOUNT
When the Memory Pool gets full, this setting will allow the Memory Pool to expand to fit the additional content. If no AMOUNT is given, then the Memory Pool will not auto expand.
To allow the Memory Pool to expand, two types of values can be provided: percentage and size.
- Percentage
A numeric value in the range of 1..100, inclusive, with a
%
suffix. The percentage value will be based on the current size. For example, if the current size is1000k
, the new size with a value of20%
will be approximately1200k
. Be aware of rapid memory usage when using large values. - Size
A positive numeric value greater than
0
with the size suffix. When the memory pool needs to expand, this value is the amount that will be added. For example, if the current size is1024k
, the new size with a value of512k
will be1536k
.
size=SIZE
The initial size of the Memory Pool, with the size suffix.
Queue
Queue's are used to temporarily store data.
A Queue section is identified by the type
key.
The Queue's section name is the name of the Queue and can not contain any white-space and are limit to 16 bytes in length.
[command_queue]
type=queue
memory_pool=fizbix
[QUEUE NAME]
The name of the Queue. The Queue name can not contain any white-space and is limit to 64 bytes in length.
All keys are required.
type=queue
Specifies that this section is a Queue.
memory_pool=MEMORY POOL NAME
The name of the Memory Pool to use.
The Queue will use as much space as needed from the Memory Pool, so depending on the use-case, it might be good to have a 1-to-1 mapping of Memory Pool to Queue. This would also allow for each Queue to specialize the Memory Pool's defragmentation behavior.