Database Sizing and Memory Configuration
You use the
configure_engine.py
parameters to configure the size of the in-memory
databases, including the number of database objects, object size, and size of the memory
buffer. If you are unsure about how much space each object requires, use the default
values.
The script prompts you to specify the number of objects for which space must be created in the database. You can enter average sizes for various objects to configure the in-memory data structures. The specified size must be large enough to hold all objects, but not so large that memory is wasted.
Database Sizing Parameters lists the information required to configure database sizing.
Parameter | Default Value | Notes |
---|---|---|
Number of userGroupJoin Objects | 1000 | |
userGroupJoin Object Average Size | 219 bytes | |
Number of userSubscriptionJoin Objects | 100000 | |
userSubscriptionJoin Average Size | 219 bytes | |
memberJoin Object Average Size | 200 bytes | |
Activity Object Average Size | 460 bytes | |
Device Object Average Size | 300 bytes | |
Group Object Average Size | 350 bytes | |
Service Object Average Size | 300 bytes | |
Session Object Average Size | 750 bytes | |
Subscriber Object Average Size | 900 bytes | |
User Object Average Size | 300 bytes | |
Wallet Object Average Size | 1100 bytes | |
Maximum Number of Active Sessions | Defaults to Number of Subscribers. See notes for more information. | The maximum number of active sessions is used
internally to determine the size of the activity database and
internal memory structures. This number is used for initial database
sizing. It is not an object count. Specify a value that is equal to or higher than the expected maximum number of simultaneous Diameter sessions and CAP sessions for voice and SMS. For example, specify 100,000 if you expect the maximum number of active sessions to be 100,000. If you specify a value that is too low, errors might occur and calls might fail. If you do not specify a value, Maximum Number of Active Sessions defaults to the value specified for Number of Subscribers. The Number of Subscribers value is determined by the following create_config.info question: How many subscribers do you want to support? |
Number of Notification Objects | 131072 | |
Notification Object Average Size | 600 | |
Number of Task Objects | 131072 | |
Task Object Average Size | 144 | |
Maximum Number of Event Objects | 100000 | The maximum number of event objects to insert into the Event Repository is determined by the
following create_config.info question: How many event objects do
you want to support? If 0 is specified, this disables event creation in the database. This setting can improve system performance when events charging the same balance for many subscribers (for example, over 100,000 subscribers) are being processed. Warning: Once event creation is disabled, it cannot be enabled again. If you change
this value from the default, you must also change the database cleanup threshold. See the discussion about Task Manager configuration. Note: If database compression is enabled for the event database, this value is much larger. The aim is a 2:1 compression
ratio, but MATRIXX suggests first testing the compression in a pre-production environment to determine the average size requirements.
|
Event Object Average Size | 1200 bytes | This value multiplied by the Number of Event Objects determines the size of the Event database. This value must be larger than the Task Manager Event Cleanup Threshold by 10–20% to allow the events to be added to the database
before the event cleanup operation is triggered. The Event Cleanup Threshold value is determined by the following create_config.info question:
How large (in bytes) should
the event database grow before events are
deleted?
For example, to keep 3.3 million events in the database with an average event size of 1200 bytes (3960000000 bytes), the threshold might be 3600000000. |
Number of Pricing Objects | 4096 | |
Pricing Object Average Size | 512 | This value multiplied by the number of pricing objects determines the size of the Pricing database. |
Maximum Number of Balance Update Buffers | 4096 | |
Default Initial Object Size | yes | By default, the Initial Object Size for each
database object type is the value entered for the Average Object
Size for that object, except for the event object and pricing
object. These objects use a value of 0 because they
are created with their real size during runtime. If you answer no
(n ) to the question Do you want to use the
default initial object sizes (y/n)?, the following questions are asked and allow you to change the
initial size of any database object. What is the initial size of an activity object in bytes? What is the initial size of a userGroupJoin object in bytes? What is the initial size of a userSubscriptionJoin object in bytes? What is the initial size of an aggregation object in bytes? What is the initial size of an aggregation set object in bytes? What is the initial size of a balance set object in bytes? What is the initial size of a device object in bytes? What is the initial size of an event object in bytes? What is the initial size of a group object in bytes? What is the initial size of a memberJoin object in bytes? What is the initial size of a notification object in bytes? What is the initial size of a pricing object in bytes? What is the initial size of a service object in bytes? What is the initial size of a session object in bytes? What is the initial size of a subscriber object in bytes? What is the initial size of a task object in bytes? What is the initial size of a wallet object in bytes? |
Default Database Garbage Collection | yes | The default database garbage collection is triggered when the size of fragmentation reaches 11 percent of total database size. To change the default trigger size, answer no (n) to the question Do you want to use the default database garbage collection settings (y/n)?. |
Maximum Number of Aggregation Objects | The number of aggregation objects to support in the activity database. The default value is 200000. This value must reflect the number of subscribers multiplied by the number of devices per subscriber. If you have many inactive devices, you can reduce this value so that activity database sizing is more exact. The Maximum Number of Aggregation Objects parameter is determined by the following create_config.info question: How many aggregation objects do you want to support? |
After you have a test system running with subscriber data and performing rating and charging, stop the server to write the database sizes to the mtx.log file. You can see the object sizes and adjust the database configuration values as needed.
When the number of allocated database or index segments is larger that the threshold, a warning similar to the following appears in logs:
LM_WARN 48644|48826 2023-07-19 01:58:22.952718 [transaction_server_2:1:1:1(5255.b9212c4)] | SegmentDataMap::allocateSegment: The number of allocated segments for transaction_server.1.database.subscriber.index.user_group_join_by_group.index_block_pool.storage reached more than 90% of the maximum capacity. You may need to increase the sizing for this particular data storage in the configuration file.
When the maximum number of allocated database or index segments is reached, an error similar to the following appears in logs:
LM_ERROR 48644|48826 2023-07-19 01:58:22.952718 [transaction_server_2:1:1:1(5255.b9212c4)] | SegmentDataMap::allocateSegment: The number of allocated segments for transaction_server.1.database.subscriber.index.user_group_join_by_group.index_block_pool.storage reached to the maximum capacity. You may need to increase the sizing for this particular data storage in the configuration file.
When no extended data segments remain, a warning similar to the following appears in logs:
LM_WARN 48644|48826 2023-07-19 01:58:22.952718 [transaction_server_2:1:1:1(5255.b9212c4)] | VariableRdm::allocateExtendedData: pool ID 31: reached maximum number of extended data segments (transaction_server.1.database.sched.storage.extended_data). You may need to increase database sizing in the configuration file.
To clear these errors and warnings, adjust the values given for the following configuration questions:
# for subscriber database
How many subscribers do you want to support?500
What is the average number of balances per subscriber?20
What is the average number of devices per subscriber?2
What is the average number of login devices per subscriber?0
How many users do you want to support?100
What is the average size of a user object in bytes?300
How many userGroupJoin objects do you want to support?1000
What is the average size of a userGroupJoin object in bytes?219
How many userSubscriptionJoin objects do you want to support?100
What is the average size of a userSubscriptionJoin object in bytes?219
How many groups do you want to support?1000
What is the average size of a group object in bytes?350
What is the average size of a device object in bytes?300
How many memberJoin objects do you want to support?1000
What is the average size of a memberJoin object in bytes?48
What is the average size of a login device object in bytes?300
What is the average size of a subscriber object in bytes?900
What is the average size of a wallet object in bytes?1100
# for activity database
How many aggregation objects do you want to support?100000
What is the maximum number of active sessions?1000
What is the average size of an activity object in bytes?460
What is the average size of an aggregationSet object in bytes?300
What is the average size of an aggregation object in bytes?300
What is the average size of a session object in bytes?750
# for schedule database
How many notification objects do you want to support?100
What is the average size of a notification object in bytes?600
How many task objects do you want to support?100
What is the average size of a task object in bytes?144
# for event database
How many event objects do you want to support?2500
What is the average size of an event object in bytes?1200
# for pricing database
How many pricing objects do you want to support?4096
What is the average size of a pricing object in bytes?512
Adjust the database size threshold by adding the following in a sed.extra file:
s/<segment_map_warning_threshold_pct>.*</<segment_map_warning_threshold_pct>pct_of_maximum</
Where pct_of_maximum is the percentage of the maximum number of
allocated database or index segments. Warnings appear in logs when this percentage
is exceeded. The default value is 90
.
For more information about configuring MATRIXX Engine, see the discussion about applying engine configuration changes.
Memory Management
MATRIXX has an internal memory management service that reclaims memory occupied by objects that are no longer in use. If you answer n to Do you want to use the default database garbage collection settings (y/n)?, you can set the parameters listed in Garbage Collection Parameters.
Parameter | Description | Default Value |
---|---|---|
Activity Database Fragmentation Holes | The number of fragmentation holes that must exist in the Activity database to trigger garbage collection. | 0 |
Activity Database Fragmentation Percentage | The percentage of fragmentation that must exist in the Activity database to trigger garbage collection. | 11 |
Balance Set Database Number of Fragmentation Holes | The number of fragmentation holes that must exist in the Balance Set database to trigger garbage collection. | 0 |
Balance Set Database Fragmentation Percentage | The percentage of fragmentation that must exist in the Balance Set database to trigger garbage collection. | 11 |
Event Database Fragmentation Holes | The number of fragmentation holes that must exist in the Event database to trigger garbage collection. | 0 |
Event Database Fragmentation Percentage | The percentage of fragmentation that must exist in the Event database to trigger garbage collection. | 11 |
Schedule Database Fragmentation Holes | The number of fragmentation holes that must exist in the Schedule database to trigger garbage collection. | 0 |
Schedule Database Fragmentation Percentage | The percentage of fragmentation that must exist in the Schedule database to trigger garbage collection. | 11 |
Subscriber Database Fragmentation Holes | The number of fragmentation holes that must exist in the Subscriber database to trigger garbage collection. | 0 |
Subscriber Database Fragmentation Percentage | The percentage of fragmentation that must exist in the Subscriber database to trigger garbage collection. | 11 |
When shared memory runs out, the following warning appears in logs:
LM_WARN 48644|48826 2023-07-19 01:58:22.952718 [transaction_server_2:1:1:1(5255.b9212c4)] | SegmentDataMap::allocateSegment: Attempt to allocate 245334016 bytes for a new segment (transaction_server.1.database.sched.storage.extended_data), but no memory is available. You may need to increase the total shared memory size specified in the configuration file. Note that segment allocation for this instance is disabled at this point.
To clear this warning, adjust the values given for the following configuration questions:
What is the shared memory size in MB to use?1500
What is the shared memory size in MB on publishing server to use?1000