|
The processing of DCBs and sessions has been enhanced by never releasing their memory. They have a standard fixed size and so any DCB that is no longer needed can be kept in the list of all DCBs and when a new DCB is needed, if a free one is available it can be used. This greatly reduces the use of memory allocation functions, and also substantially reduces the traversing of lists. The same applies to sessions.
|
|
This code is now part of the develop branch, and expected to go live in release 2.0. Code is also under development to provide a neater generalisation of the mechanism used for DCBs and sessions. This is not intended for release 2.0 as there is insufficient time to verify its working. The newer code provides for the variables involved in managing the list of items (e.g. DCBs) into a static structure that can be used for any such list.
|
|
Standard list manager for recyclable lists now working and tested. Initialization of DCB and Session structures simplified. Work proceeding to add option to display list statistics through Maxadmin.
|
|
Pre-allocation now available, and triggered as a default in config.c with 1,000 DCBs and 250 sessions. Intended to become configuration items, with defaults such as the figures quoted. List statistics now available through maxadmin with commands "show dcblist" or "show sessionlist". Example:
MaxScale> show dcblist
Recyclable list statistics
--------------------------
Name of list: All DCBs
Size of entries: 536
Currently in use: 416
Maximum ever used at once: 419
Currently free for reuse: 584
Total in use + free: 1000
Number of memory allocations: 0
|
|
Completed the work for DCBs and sessions. The same principle could be applied to filters in exactly the same way. The work could be used as a basis for processing fixed size blocks of memory that do not need to be visibly organised as lists.
|