Database
The New Economy – Database & Data Settings
Overview
The data.yml file controls how The New Economy (TNE) stores and syncs player data, transactions, and configurations across servers.
It includes settings for:
Syncing data between servers (BungeeCord, Velocity, Redis).
Database backend (YAML, MySQL, MariaDB).
Purging inactive accounts and old transactions.
Connection pools for Redis and SQL.
Auto-saving data at intervals.
Config Version
config-version: 41. Sync Settings
The Sync block controls how data and configs are synchronized across multiple servers.
Reload
Enabled → If
true, reloads data from the database on the first player to join after downtime.Time → Delay (minutes) between reloads.
Type
Options:
Bungee,RedisDetermines sync mechanism across a network.
Use Redis for large or multi-proxy setups.
Redis
Basic Redis connection details.
Redis Connection Pool
Standard Jedis pool settings for Redis stability.
Adjust
MaxSize/MaxIdlefor your player count.Keep
TestWhileIdle: trueto avoid stale sockets.
JMX Settings
JmxEnabled → Enables or disables JMX monitoring for the connection pool. Should remain
falseunless you are actively monitoring with JConsole, Prometheus, or another JMX client.JmxNamePrefix → A string prefix applied to JMX MBeans (e.g.,
"tne_redis_pool"). Use this to differentiate between multiple Redis pools.JmxNameBase → The base identifier for JMX object names. Defaults to
"pool", but can be changed to something descriptive (e.g.,"economy_pool").
⚠️ Performance Note: JMX introduces a small overhead. Only enable and configure these if you are doing advanced monitoring or troubleshooting.
2. Purge Settings
Controls removal of inactive data to reduce database size.
Enabled → Whether purging is active.
Transaction.Archive → Skip archived transactions.
Transaction.Days → Days before transactions are purged.
Accounts.Days → Days of inactivity before an account is purged.
3. Database Settings
The database backend where economy data is stored.
Types
YAML → File-based storage (default, simple single-server).
MySQL / Maria → Recommended for production/multi-server.
maria-outdated → For MariaDB < 10.7.0 or MySQL < 8.0.0.
SQL Options
Host/Port → Database connection target.
DB → Database name.
User/Password → SQL user credentials.
SSL/PublicKey → Security options depending on host.
4. AutoSaver
Controls periodic saving of player data.
Enabled → If true, data is auto-saved.
Interval → Frequency in seconds (default: 10 minutes).
5. SQL Connection Pool
For SQL-based backends.
MaxSize → Maximum connections.
MaxIdle → Idle connections allowed.
MaxLife → Max connection lifetime (ms).
Timeout → Timeout per connection (ms).
📌 Recommendations
Small servers → Use
YAMLorSQLite(lightweight, no external DB).Multi-server setups → Use
MySQLorMariaDBwithRedissyncing.
Suggested Jedis Connection Pool Profiles
This is used for when Data.Sync.Type is set to Redis in data.yml.
MaxTotal
64
24
96
Total connections (active + idle). Heavy-Burst raises ceiling to absorb auction/shop spikes.
MaxIdle
16
6
32
Keep more idle connections for sudden bursts.
MinIdle
8
2
16
Warm pool for rapid expansion under spikes.
BlockWhenExhausted
true
true
true
Always safer to block than error out.
MaxWait
15000 ms (15s)
10000 ms (10s)
20000 ms (20s)
Longer tolerance for bursts; lets threads queue during peak auctions.
TimeBetweenEvictionRunsMillis
30000 ms (30s)
20000 ms (20s)
45000 ms (45s)
Slightly slower runs to reduce CPU overhead during spikes.
MinEvictableIdleTimeMillis
300000 ms (5m)
120000 ms (2m)
600000 ms (10m)
Allow more idle time before eviction; keeps burst pool available.
SoftMinEvictableIdleTimeMillis
120000 ms (2m)
60000 ms (1m)
300000 ms (5m)
Evict idle later to maintain larger pools during busy hours.
NumTestsPerEvictionRun
3
2
5
Validate more connections per cycle to keep larger pools healthy.
TestWhileIdle
true
true
true
Strongly recommended; protects against dead sockets.
TestOnBorrow
true
true
true
Ensures stable connections under load.
TestOnReturn
false
false
false
Leave disabled unless debugging.
TestOnCreate
false
false
false
Only enable if Redis/network instability is observed.
Lifo
true
true
true
Always reuse hottest connections first.
JmxEnabled
false
false
false
Disable unless actively monitoring.
Profile Overview
Recommended (High-Throughput) → Balanced defaults for medium–large servers (auctions, player economies).
Low-RAM Profile → Tight footprint for JVM heaps under ~4 GB; aggressive trimming.
Heavy-Burst Profile → Optimized for peak loads (auctions, mass shop scans, large events); keeps a bigger warm pool at a higher memory cost.
Last updated