Skip to main content

constants.go

constants.go - Overview

This file defines various constant values used throughout the DiceDB project. These constants configure parameters related to I/O buffering, eviction policy, data limits, communication channels, timeouts, and other system-wide settings.

Detailed Documentation

Constants

  • IOBufferLength:

    • Purpose: Defines the length of the I/O buffer.
    • Type: int
    • Value: 512
  • EvictionRatio:

    • Purpose: Defines the ratio for eviction policy.
    • Type: float64
    • Value: 0.9
  • DefaultKeysLimit:

    • Purpose: Defines the default limit for the number of keys.
    • Type: int
    • Value: 200000000
  • WatchChanBufSize:

    • Purpose: Defines the buffer size for the watch channel.
    • Type: int
    • Value: 20000
  • ShardCronFrequency:

    • Purpose: Defines the frequency of the shard cron job.
    • Type: time.Duration
    • Value: 1 * time.Second
  • AdhocReqChanBufSize:

    • Purpose: Defines the buffer size for ad-hoc request channel.
    • Type: int
    • Value: 20
  • EnableProfile:

    • Purpose: Enables or disables profiling.
    • Type: bool
    • Value: false
  • WebSocketWriteResponseTimeout:

    • Purpose: Defines the timeout for writing WebSocket responses.
    • Type: time.Duration
    • Value: 10 * time.Second
  • WebSocketMaxWriteResponseRetries:

    • Purpose: Defines the maximum number of retries for writing WebSocket responses.
    • Type: int
    • Value: 3
  • KeepAlive:

    • Purpose: Defines the keep-alive interval.
    • Type: int32
    • Value: 300
  • Timeout:

    • Purpose: Defines the timeout duration.
    • Type: int32
    • Value: 300
  • DefaultConnBacklogSize:

    • Purpose: Defines the default connection backlog size.
    • Type: int
    • Value: 128
  • MaxRequestSize:

    • Purpose: Defines the maximum request size.
    • Type: int
    • Value: 32 * 1024 * 1024 (32 MB)
  • IoBufferSize:

    • Purpose: Defines the I/O buffer size.
    • Type: int
    • Value: 16 * 1024 (16 KB)
  • IdleTimeout:

    • Purpose: Defines the idle timeout duration.
    • Type: time.Duration
    • Value: 30 * time.Minute

Getting Started Relevance: YES