Performance Tuning

Optimize LilChunks to achieve the best balance between generation speed and server performance.

Performance Overview

LilChunks is designed to be highly performant, but proper configuration is essential for optimal results:

CPU Usage

Multi-threaded generation with configurable thread count

Memory Management

Smart memory usage with optional limits

Server Impact

Minimal TPS impact with async processing

Performance Metrics

Key Performance Indicators

Monitor these metrics during chunk generation:

Configuration Optimization

Performance Profiles

Choose a profile based on your server specifications:

Specs: 8+ cores, 16+ GB RAM, NVMe SSD

chunk-generation:
  chunks-per-tick: 8
  use-async: true
  generate-structures: true
  generate-caves: true
  generate-features: true

performance:
  max-memory-usage: 0
  use-parallel: true
  thread-count: 0  # Auto-detect

logging:
  progress-interval: 3

Expected Performance: 30-50 chunks/second

Fine-Tuning Parameters

Real-Time Optimization

Dynamic Adjustment

Monitor and adjust settings during generation:

1

Start Generation

Begin with conservative settings:

/lc start 10
2

Monitor Performance

Check TPS and memory every 30 seconds:

/tps
/memory
/lc status
3

Adjust if Needed

If performance is good, increase speed:

# Edit config.yml
chunks-per-tick: 6  # Increase from 4
/lc reload
4

Continue Monitoring

Keep watching performance and adjust as needed.

Performance Indicators

TPS: 19.8, 19.5, 19.2
Memory: 45% used
Generation: 15 chunks/second

Action: Consider increasing generation speed

Server-Specific Optimizations

Paper Server

Paper provides additional optimizations:

# paper-world-defaults.yml
chunks:
  auto-save-interval: 6000  # Increase from default
  delay-chunk-unloads-by: 10s
  
entities:
  spawning:
    per-player-mob-spawns: true
    
misc:
  use-faster-eigencraft-redstone: true

Spigot Server

Spigot configuration tweaks:

# spigot.yml
world-settings:
  default:
    mob-spawn-range: 6  # Reduce from 8
    entity-activation-range:
      animals: 16
      monsters: 24
      raiders: 48
      misc: 8

JVM Optimization

Optimize Java Virtual Machine settings:

# Recommended JVM flags for chunk generation
java -Xms4G -Xmx8G \
     -XX:+UseG1GC \
     -XX:+ParallelRefProcEnabled \
     -XX:MaxGCPauseMillis=200 \
     -XX:+UnlockExperimentalVMOptions \
     -XX:+DisableExplicitGC \
     -XX:+AlwaysPreTouch \
     -XX:G1NewSizePercent=30 \
     -XX:G1MaxNewSizePercent=40 \
     -XX:G1HeapRegionSize=8M \
     -XX:G1ReservePercent=20 \
     -XX:G1HeapWastePercent=5 \
     -XX:G1MixedGCCountTarget=4 \
     -XX:InitiatingHeapOccupancyPercent=15 \
     -XX:G1MixedGCLiveThresholdPercent=90 \
     -XX:G1RSetUpdatingPauseTimePercent=5 \
     -XX:SurvivorRatio=32 \
     -XX:+PerfDisableSharedMem \
     -XX:MaxTenuringThreshold=1 \
     -jar server.jar nogui

Monitoring Tools

Built-in Monitoring

Use LilChunks’ built-in monitoring:

# Check generation status
/lc status

# Enable detailed logging temporarily
# Edit config.yml:
debug: true
logging:
  detailed-logs: true

# Reload and monitor logs
/lc reload

External Monitoring

# Install monitoring plugins
- LagMonitor
- Spark
- ServerUtils
- TPS Monitor

# Use commands
/spark profiler start
/lagmonitor
/tps

Troubleshooting Performance Issues

Performance Best Practices

Start Conservative

Begin with lower settings and gradually increase based on performance monitoring.

Monitor Continuously

Keep an eye on TPS, memory, and generation speed throughout the process.

Off-Peak Generation

Run large pregeneration tasks during low-activity periods.

Backup Before Large Tasks

Always backup your world before running extensive pregeneration.

Test Configuration

Test new configurations on a development server first.

Document Settings

Keep notes on what settings work best for your server setup.

Performance Benchmarks

Typical Performance Ranges

Based on server specifications:

Server TypeCPU CoresRAMStorageExpected Speed
High-End Dedicated8+16+ GBNVMe SSD30-50 chunks/s
Mid-Range VPS4-68-12 GBSSD15-25 chunks/s
Budget VPS2-44-6 GBSSD/HDD5-12 chunks/s
Shared Hosting1-22-4 GBHDD2-8 chunks/s

Optimization Results

Example of optimization impact:

Configuration:
- chunks-per-tick: 4 (default)
- use-parallel: true
- thread-count: 0
- No memory limit

Results:
- TPS: 12-15 (poor)
- Memory: 90% usage
- Speed: 3 chunks/second

Next Steps