Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions arcus.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# ============================================================
# Arcus-memcached Configuration File
#
# This file is used to configure the Arcus-memcached server at startup.
#
# Usage:
# ./memcached -c arcus.conf
# ./memcached -c arcus.conf -p 20000 (CLI options override config file settings)
#
# Format:
# key=value
# Lines starting with '#' are treated as comments.
# ============================================================


# [Required] Path to the storage engine library (.so).
# This must be specified to start the server.
engine_path=.libs/default_engine.so

# TCP port number to listen on. (Default: 11211)
port=11211

# UDP port number to listen on. (Default: 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0์€ off๋ฅผ ์˜๋ฏธํ•œ๋‹ค๋Š” ๊ฒƒ๋„ ํฌํ•จ๋˜๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

# udpport=0

# The IP address of the network interface to listen on.
# 0.0.0.0 means listen on all available interfaces (INADDR_ANY).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default๊ฐ€ INADDR_ANY์ž„์„ ํฌํ•จ

listen=0.0.0.0

# Path to the UNIX socket file.
# socketpath=/tmp/memcached.sock

# Access mask for the UNIX socket in octal. (Default: 0700)
# access=0700

# Assume the identity of <username> (drops root privileges).
# Effectively switches the user after starting.
# username=nobody

# Number of worker threads to process incoming requests. (Default: 4)
# Typically set to the number of CPU cores.
threads=4

# Maximum number of simultaneous connections. (Default: 1024)
# Connections exceeding this limit may be queued or rejected.
maxconns=1024

# Backlog queue limit for pending connections. (Default: 1024)
backlog=1024

# Maximum number of requests per event. (Default: 20)
# Limits the number of requests processed for a given connection to prevent starvation.
reqs_per_event=20

# Maximum memory to use for item storage. (Default: 64)
memory_limit=64M

# Maximum size of a single item. (Default: 1m)
# Supports K and M suffixes. Min: 1k, Max: 128m.
# Adjusting this value also adjusts the slab page size.
item_size_max=1m

# Action to take when memory is exhausted. (Default: false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์„ค๋ช…์ด ๋ฐ˜๋Œ€๋กœ ๋œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. Default ๊ฐ’์€ true ์ด๋ฉฐ, eviction์ด false์ด๋ฉด ์•„์ดํ…œ์ด ๊ฐ€๋“ ์ฐจ๋ฉด ์—๋Ÿฌ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

# false = Evict old items (LRU) to make space.
# true = Return an error instead of evicting items.
eviction=false

# Chunk size growth factor between slab classes. (Default: 1.25)
# Controls the size increase of chunks in subsequent slab classes.
factor=1.25

# Minimum space allocated for key+value+flags. (Default: 48)
chunk_size=48

# Sticky (gummed) memory limit in MB. (Default: 0 - Unlimited)
# Reserved memory for items that should not be evicted.
sticky_limit=0

# Use large memory pages if available. (Default: false)
# Can improve performance by reducing TLB misses.
preallocate=false

# These options control the behavior of the Arcus storage engine,
# including Collection features (List, Set, Map, B+Tree).
Comment on lines +83 to +84
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ์ฃผ์„์€ ์ œ๊ฑฐํ•ด๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.


# Enable CAS (Check-And-Set) feature. (Default: true)
# Ensures data consistency. Set to false to disable.
use_cas=true

# Raw configuration string passed directly to the engine.
# Format: param1=val1;param2=val2...
# engine_config=conf/default_engine.conf

# Character to use as a delimiter for key prefixes in stats. (Default: :)
# If specified, per-prefix stats collection is automatically enabled.
prefix_delimiter=:

# Enable detailed stats collection. (Default: false)
# Automatically enabled if 'prefix_delimiter' is set.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ์ฃผ์„์€ ์ œ๊ฑฐํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

detail_enabled=false

# Allow the 'stats detail' command to be used. (Default: true)
allow_detailed=true

# Run as a daemon (background process). (Default: false)
daemonize=false

# File to write the Process ID (PID) to when running as a daemon.
# pid_file=/var/run/memcached.pid

# Verbose logging level. (Default: 3)
# 0 = Detail, 1 = Debug, 2 = Info, 3 = Warning
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์—ฌ๊ธฐ์„œ verbosity ๊ฐ’์€ ๋ฐ˜๋Œ€์ž…๋‹ˆ๋‹ค.
0 = Warning, 1 = Info, 2 = Debug, 3 = Detail

# Higher values result in less logging.
verbosity=3

# Limit the size of the core file. (Default: 0)
# Used for debugging purposes to allow core dumps.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ํ•ด๋‹น ๊ฐ’์€ 0(false) ๋˜๋Š” 1(true)์˜ ๊ฐ’์„ ๊ฐ€์ง„๋‹ค." ๋ผ๋Š” ์˜๋ฏธ๋ฅผ ๋„ฃ์œผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

maxcore=0

# Lock down all paged memory. (Default: false)
# Prevents memory from being swapped out, but may fail if system limit is exceeded.
lock_memory=false

# Path to the UNIX socket file (if used).
# socketpath=/tmp/memcached.sock

# Access mask for the UNIX socket in octal. (Default: 0700)
# access=0700

# Protocol to use (auto, binary, ascii). (Default: auto)
protocol=auto

# Load extension libraries (.so).
# Used to load additional modules like loggers or management tools.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ตœ๋Œ€ ๊ฐœ์ˆ˜๋„ ์„ค๋ช…์ด ์žˆ์œผ๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

# extension1=/usr/local/lib/logger.so
# extension2=/usr/local/lib/management.so

# Settings required

# ZooKeeper ensemble server list.
# Only available if compiled with ZooKeepr support.
# Format: host1:port1,host2:port2,...
# zookeeper=zk1.local:2181,zk2.local:2181,zk3.local:2181

# ZooKeeper session timeout in milliseconds. (Default: 0 -> Uses internal default)
# Only available if compiled with ZooKeepr support.
# Recommended value: > 10 and < 20000 (check internal implementation limits).
# zk_timeout=3000

# Proxy configuration (if compiled with proxy support)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋Š” proxy support๋Š” ๋นŒ๋“œ ๊ณผ์ •์—์„œ ํฌํ•จ๋˜๋Š” ์˜ต์…˜์€ ์•„๋‹ˆ๋ฏ€๋กœ if complied with proxy support ์„ค๋ช…์€ ์ œ๊ฑฐํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

# proxy_config=...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์˜ˆ์‹œ๋Š” ip:port ํ˜•์‹์ด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.


# Require SASL authentication for connections. (Default: false)
# Only available if compiled with SASL support.
# require_sasl=false
6 changes: 1 addition & 5 deletions config_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#include <memcached/config_parser.h>
#include <memcached/util.h>

static int read_config_file(const char *fname, struct config_item items[],
FILE *error);

/**
* Copy a string and trim of leading and trailing white space characters.
* Allow the user to escape out the stop character by putting a backslash before
Expand Down Expand Up @@ -224,8 +221,7 @@ int parse_config(const char *str, struct config_item *items, FILE *error) {
return ret;
}

static int read_config_file(const char *fname, struct config_item items[],
FILE *error) {
int read_config_file(const char *fname, struct config_item items[], FILE *error) {
FILE *fp = fopen(fname, "r");
if (fp == NULL) {
(void)fprintf(error, "Failed to open file: %s\n", fname);
Expand Down
1 change: 1 addition & 0 deletions include/memcached/config_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct config_item {
*/
MEMCACHED_PUBLIC_API int parse_config(const char *str, struct config_item items[], FILE *error);

int read_config_file(const char *fname, struct config_item items[], FILE *error);
#ifdef __cplusplus
}
#endif
Expand Down
Loading