Repository: influxdata/influxdb
File: influxdb3/src/commands/serve.rs (Rust)

Code before:
    )]
    pub force_snapshot_mem_threshold: MemorySize,

    /// Disable sending telemetry data to telemetry.v3.influxdata.com.
    #[clap(
        long = "disable-telemetry-upload",
        env = "INFLUXDB3_TELEMETRY_DISABLE_UPLOAD",
        default_value_t = false,
        hide = true,
        action
    )]
    pub disable_telemetry_upload: bool,

    /// Send telemetry data to the specified endpoint.
    #[clap(
        long = "telemetry-endpoint",
        env = "INFLUXDB3_TELEMETRY_ENDPOINT",
        default_value = DEFAULT_TELEMETRY_ENDPOINT,
        hide = true,
        action
    )]
    pub telemetry_endpoint: String,

    /// Set the limit for number of parquet files allowed in a query. Defaults to 432 which is about
    /// 3 days worth of files. This number can be increased to allow more files to be queried, but
    /// query performance will likely suffer as a result. It would be better to specify smaller time
    /// ranges if possible in a query
    #[clap(long = "file-limit", env = "INFLUXDB3_FILE_LIMIT", action)]
    pub file_limit: Option<usize>,
}

/// Specified size of the Parquet cache in megabytes (MB)
#[derive(Debug, Clone, Copy)]
pub struct ParquetCacheSizeMb(usize);

impl ParquetCacheSizeMb {
    /// Express this cache size in terms of bytes (B)
    fn as_num_bytes(&self) -> usize {
        self.0 * 1_000 * 1_000
    }
}

impl FromStr for ParquetCacheSizeMb {
    type Err = anyhow::Error;

    fn from_str(s: &str) -> std::prelude::v1::Result<Self, Self::Err> {
        s.parse()
            .context("failed to parse parquet cache size value as an unsigned integer")
            .map(Self)
    }
}

Review comment (performance):
Worth noting that it's not just that query performance may suffer, but the any query going over this limit will spike RAM usage significantly and depending on system resources could get OOMkilled

Code after:
    )]
    pub force_snapshot_mem_threshold: MemorySize,

    /// Disable sending telemetry data to telemetry.v3.influxdata.com.
    #[clap(
        long = "disable-telemetry-upload",
        env = "INFLUXDB3_TELEMETRY_DISABLE_UPLOAD",
        default_value_t = false,
        hide = true,
        action
    )]
    pub disable_telemetry_upload: bool,

    /// Send telemetry data to the specified endpoint.
    #[clap(
        long = "telemetry-endpoint",
        env = "INFLUXDB3_TELEMETRY_ENDPOINT",
        default_value = DEFAULT_TELEMETRY_ENDPOINT,
        hide = true,
        action
    )]
    pub telemetry_endpoint: String,

    /// Set the limit for number of parquet files allowed in a query. Defaults
    /// to 432 which is about 3 days worth of files using default settings.
    /// This number can be increased to allow more files to be queried, but
    /// query performance will likely suffer, RAM usage will spike, and the
    /// process might be OOM killed as a result. It would be better to specify
    /// smaller time ranges if possible in a query.
    #[clap(long = "query-file-limit", env = "INFLUXDB3_QUERY_FILE_LIMIT", action)]
    pub query_file_limit: Option<usize>,
}

/// Specified size of the Parquet cache in megabytes (MB)
#[derive(Debug, Clone, Copy)]
pub struct ParquetCacheSizeMb(usize);

impl ParquetCacheSizeMb {
    /// Express this cache size in terms of bytes (B)
    fn as_num_bytes(&self) -> usize {
        self.0 * 1_000 * 1_000
    }
}

impl FromStr for ParquetCacheSizeMb {
    type Err = anyhow::Error;

    fn from_str(s: &str) -> std::prelude::v1::Result<Self, Self::Err> {
        s.parse()
            .context("failed to parse parquet cache size value as an unsigned integer")
            .map(Self)