Skip to content

Commit

Permalink
fix: increase default buffer size
Browse files Browse the repository at this point in the history
Increases the default buffer size for memcache client from 4KB to
16KB to accomodate larger payloads without configuration changes.
  • Loading branch information
brayniac committed Aug 4, 2023
1 parent 9f57b3d commit 4440f6b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/config/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use super::*;

const PAGESIZE: usize = 4096;
const DEFAULT_BUFFER_SIZE: usize = 4 * PAGESIZE;

fn default_buffer_size() -> usize {
DEFAULT_BUFFER_SIZE
}

#[derive(Clone, Deserialize)]
pub struct Client {
Expand Down Expand Up @@ -28,9 +33,9 @@ pub struct Client {
///
/// Not all client implementations allow setting these values, so this is a
/// best effort basis.
#[serde(default)]
#[serde(default = "default_buffer_size")]
read_buffer_size: usize,
#[serde(default)]
#[serde(default = "default_buffer_size")]
write_buffer_size: usize,
}

Expand Down

0 comments on commit 4440f6b

Please sign in to comment.