Skip to main content

Performance Guide

Optimize SigmaOrders for your server size and requirements.

Database Performance

SQLite Optimization

For Small Servers (< 50 players):

  • Default settings are sufficient
  • No optimization needed

For Medium Servers (50-200 players):

  • Monitor database file size
  • Consider periodic cleanup of old orders
  • Default settings usually sufficient

For Large Servers (200+ players):

  • Consider switching to MySQL
  • Monitor database performance
  • Optimize order expiration times

MySQL Optimization

Connection Pool:

database:
mysql:
pool-size: 10 # Increase for high-traffic servers (max 50 recommended)

Database Server:

  • Use dedicated database server for very large servers
  • Monitor connection count
  • Optimize MySQL configuration

Caching

Cache Configuration

performance:
cache-size: 100 # Number of orders to cache
cache-expiration: 60 # Cache expiration in seconds

Adjustments:

  • Small servers: Default (100) is sufficient
  • Medium servers: Increase to 200-300
  • Large servers: Increase to 500+ (monitor memory)

Cache Strategy

The plugin uses in-memory caching:

  • Frequently accessed orders are cached
  • Cache expires after configured time
  • Cache is cleared on order updates

Async Operations

All database operations are async by default:

  • No server thread blocking
  • Better TPS performance
  • Handled automatically

No configuration needed - this is built-in.

Order Management

Expiration Strategy

Shorter expiration = less database storage:

# High activity server
order-life: 1440 # 1 day - frequent cleanup

# Normal server
order-life: 10080 # 7 days - balanced

# Low activity server
order-life: 43200 # 30 days - longer retention

Auto-Cleanup

Completed orders are auto-deleted:

  • Reduces database size
  • Improves query performance
  • No manual cleanup needed

GUI Performance

Update Interval

gui:
update-interval: 20 # Ticks (20 = 1 second)

Adjustments:

  • Fast updates: 10-15 ticks (more server load)
  • Balanced: 20 ticks (default)
  • Performance: 40-60 ticks (less frequent updates)

Orders Per Page

gui:
orders-per-page: 45 # Number of orders per page

Adjustments:

  • Lower values = faster loading
  • Higher values = more orders visible
  • Default (45) works for most servers

Monitoring

Key Metrics

Monitor these metrics:

  • Order creation rate: Orders per hour/day
  • Delivery completion rate: % of orders completed
  • Average order value: Economic activity
  • Database size: Storage usage
  • Cache hit rate: Cache effectiveness

Performance Indicators

Good Performance:

  • Commands respond quickly (< 1 second)
  • GUI opens instantly
  • No TPS impact
  • Database queries fast

Performance Issues:

  • Commands take > 2 seconds
  • GUI lag or delays
  • TPS drops when using orders
  • Database queries slow

Optimization Tips

For Small Servers

  1. Use default settings
  2. SQLite is sufficient
  3. No special optimization needed

For Medium Servers

  1. Monitor database size
  2. Consider MySQL if growing
  3. Adjust cache size if needed
  4. Review order expiration times

For Large Servers

  1. Use MySQL
  2. Increase cache size
  3. Optimize database server
  4. Consider dedicated database server
  5. Monitor all metrics regularly

Troubleshooting Performance

Slow Commands

Check:

  1. Database performance
  2. Cache effectiveness
  3. Server resources (CPU, RAM)
  4. Other plugins interfering

Solutions:

  1. Switch to MySQL
  2. Increase cache size
  3. Optimize database
  4. Check server resources

High Memory Usage

Check:

  1. Cache size too large
  2. Too many cached orders
  3. Database connection pool

Solutions:

  1. Reduce cache size
  2. Reduce cache expiration
  3. Optimize database queries

Database Locking

Check:

  1. Multiple server instances
  2. Database file permissions
  3. Concurrent operations

Solutions:

  1. Ensure single server instance
  2. Check file permissions
  3. Use MySQL for multi-server

Best Practices

  1. Start with Defaults: Default settings work for most servers
  2. Monitor First: Monitor before optimizing
  3. Optimize Gradually: Make small changes and test
  4. Use MySQL for Scale: Switch to MySQL when needed
  5. Regular Maintenance: Clean up old data periodically