Skip to content

Proton Server Setup Guide(with configuration guide)

haohang edited this page Feb 24, 2024 · 1 revision

Proton Server Setup Guide

Updated on: 2024/02/23

Welcome to the Proton Server Setup Guide. This document provides step-by-step instructions for getting started with Proton Server, ranging from a simple binary setup to more advanced configurations using Docker and configuration files. Use the links below to navigate to the relevant section for your setup needs:

Quick Start with Proton Binary (Part 1)

Easily start the Proton Server with the default settings.

  1. Download the binary:
    curl https://install.timeplus.com | sh
  2. Start the server:
    ./proton server start
    Default data storage is in the ./proton-data folder.

Starting with Proton Docker (Part 2)

Customize settings within Docker for the Proton Server.

  1. Launch Proton Docker:
    docker run -it --name proton ghcr.io/timeplus-io/proton:latest
  2. Modify Configuration (optional):
    • Access the container:
      docker exec -it proton bash
    • Install vim (optional) for easier editing:
      apt update && apt install vim -y
    • Edit or directly modify config.yaml:
      sed -i 's/telemetry_enabled: true/telemetry_enabled: false/' /etc/proton-server/config.yaml
  3. Restart the container:
    docker restart proton

Advanced Configuration with Config File (Part 3)

Set up a new Proton Server instance with advanced configuration files.

  1. Download Configuration Files:
    wget https://raw.githubusercontent.com/timeplus-io/proton/develop/programs/server/config.yaml
    wget https://raw.githubusercontent.com/timeplus-io/proton/develop/programs/server/users.yaml
  2. Customize Configuration (optional):
    • For example, to adjust the max record size:
      log_max_record_size: 10485760 => log_max_record_size: 104857600
  3. Switching Storage Paths (must):
    • Adjust the default path to suit common usage:
      sed -i "s|/var/|$(pwd)/proton-data/var/|g" config.yaml
  4. Launch Server with Custom Config:
    ./proton server start --config-file ./config.yaml

Switching to Config File for Detailed Control (Part 4)

Most Complex One: Starting with Binary then Switching to Config File

For detailed control without losing existing data.

  1. Prepare Configuration Files: Follow steps in Part 3.
  2. Modify Storage Paths to Retain Data (must):
    sed -i "s|/var/lib/proton/|$(pwd)/proton-data/|g" config.yaml
    sed -i "s|/var/log|$(pwd)/proton-data|g" config.yaml
  3. Reboot Server with New Config:
    • Ensure users.yaml is alongside config.yaml.
      ./proton server start --config-file ./config.yaml

Configuration Guide

Optimize your Proton Server's performance and functionality by customizing the config.yaml file. This guide highlights common configurations and their adjustments to address specific server needs.

Concurrency Queries Limitation

To manage the load effectively, you might need to set limits on concurrent queries. The default settings are as follows:

max_concurrent_queries: 100
max_concurrent_select_queries: 100
max_concurrent_insert_queries: 100

Adjust these settings based on your server's workload and performance requirements.

Handling Large Records

The default maximum size for a single record is set to 10MiB. Increasing this limit can accommodate larger records but may impact performance:

log_max_record_size: 10485760 # 10MiB
# Increase to 100MiB
log_max_record_size: 104857600

Proton Memory Limit

To prevent Proton Server from consuming all available memory, a hard limit is set by default to 90% of system RAM. This limit can be adjusted to better suit your server's memory availability and usage needs:

max_server_memory_usage_to_ram_ratio: 0.9 # Default setting
# Reduce to use only 60% of system RAM
max_server_memory_usage_to_ram_ratio: 0.6

Troubleshooting

Encountering issues with your Proton Server setup? We're here to help. For support:

  • Report Issues: Encounter a bug or a problem? Open a GitHub issue to get assistance.
  • Join Discussions: Have questions or want to share insights? Participate in our GitHub discussions for community support.
  • Slack Channel: Prefer real-time interaction? Join our Slack channel to connect with the Proton Server community and team.