OnixS C++ B3 Binary UMDF Market Data Handler 1.10.0
Users' manual and API documentation
Loading...
Searching...
No Matches
OrderBookPoolSettings Struct Reference

#include <OnixS/B3/MarketData/UMDF/OrderBook.h>

Classes

struct  GrowthPolicy

Public Attributes

size_t orderBooksAmount = 500
size_t chunksAmount = 1000
size_t chunkLength = 512 * 1024
bool preferHugePage = false
GrowthPolicy growthPolicy = {GrowthPolicy::Addition, 1.0f}

Detailed Description

To improve performance, the OrderBook keeps some of its internals in the preallocated memory areas (chunks).

The chunks are initially owned by the OrderBookPool object. The OrderBookPool object is shared between the OrderBooks (and can be shared between several instances of the handlers).

When a chunk is taken from the pool, it is not shared between the other order books, so the number of the chunks must be at least equal to the number of order books. A single order book can use from 1 to 255 chunks if necessary.

The number of books equals the number of securities on a channel or the size of the security filter (if used).

Placing the order book's internals into a single chunk improves data locality and can thus improve performance, so the chunk must be sufficient to fit the book content. On the other hand, making a chunk too big can lead to excessive memory consumption.

Definition at line 48 of file OrderBook.h.

Member Data Documentation

◆ chunkLength

size_t chunkLength = 512 * 1024

Length of a chunk.

The maximum chunk length should not be much more than the size of memory necessary to store all orders for security.

Note
The minimal value is 4*1024.

Definition at line 60 of file OrderBook.h.

◆ chunksAmount

size_t chunksAmount = 1000

Amount of memory chunks.

Note
If the pool is exhausted, the chunks are allocated dynamically, and a warning is raised.

Definition at line 55 of file OrderBook.h.

◆ growthPolicy

GrowthPolicy growthPolicy = {GrowthPolicy::Addition, 1.0f}

Definition at line 85 of file OrderBook.h.

◆ orderBooksAmount

size_t orderBooksAmount = 500

Amount of order book objects.

Definition at line 51 of file OrderBook.h.

◆ preferHugePage

bool preferHugePage = false

Use Huge pages for chunk allocation.

Note
Takes effect on Linux only.
Huge pages must be enabled on the system level.

Definition at line 65 of file OrderBook.h.