Skip to content

Conversation

@ing-eoking
Copy link
Collaborator

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

๊ธฐ์กด์— engine ์„ค์ •๋งŒ ๊ฐ€๋Šฅํ–ˆ๋˜ config file ์„ค์ • ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•˜์—ฌ, engine์™ธ์˜ ๋‹ค๋ฅธ ์„ค์ •๋„ ํŒŒ์ผ ํ˜•ํƒœ๋กœ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
(-e config_file=/config_file1.conf)

  1. ๊ตฌ๋™์‹œ ์˜ต์…˜์„ ์ง์ ‘ ์ „๋‹ฌํ•˜๋Š” ๋Œ€์‹ , config file ๊ฒฝ๋กœ๋ฅผ ์ธ์ž๋กœ ๋„˜๊ฒจ ์ดˆ๊ธฐ ์„ค์ •์„ ์ž๋™์œผ๋กœ ์ ์šฉํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
    (๋Œ€๋ถ€๋ถ„์˜ ํ”„๋กœ๊ทธ๋žจ์—์„œ ์ฐจ์šฉํ•˜๋Š” ๋ฐฉ์‹)
    • main()์‹คํ–‰์‹œ, ๊ตฌ๋™์˜ต์…˜์„ ํ™•์ธํ•˜๊ธฐ ์ „์— ์ฒซ๋ฒˆ์งธ ์ธ์ž๋ฅผ config file๊ฒฝ๋กœ๋ฅผ ์ธ์‹ํ•˜๋„๋ก ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•ฉ๋‹ˆ๋‹ค.
./memcached /path/to/arcus.conf
  1. try_load_config_file()์„ ๊ตฌํ˜„ํ•˜์—ฌ, .confํŒŒ์ผ์„ ๋ผ์ธ ๋‹จ์œ„๋กœ ์ฝ์–ด์„œ ๋ชจ๋“  ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

    • getopt์˜ optind๋ฅผ ๋™์ ์œผ๋กœ ์กฐ์ •ํ•˜์—ฌ config file๊ณผ ๊ตฌ๋™์˜ต์…˜์„ ํ˜ผ์šฉํ• ๋•Œ, ๊ตฌ๋™ ์˜ต์…˜๊ฐ’์ด ๋ฎ์–ด์”Œ์–ด์ง€๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
  2. https://github.com/jam2in/arcus-works/issues/808 ๋ฅผ ํ†ตํ•œ old_opts ์ค‘๋ณต ํ•ด๊ฒฐ

    • ๊ธฐ์กด์—๋Š” getopt(๊ตฌ๋™์˜ต์…˜๊ฐ’ ์„ค์ •)๋ฃจํ”„ ๋‚ด์—์„œ settings ์ „์—ญ ๊ตฌ์กฐ์ฒด์™€ old_opts ๋ฌธ์ž์—ด ์ƒ์„ฑ์„ ๋™์‹œ์— ์ˆ˜ํ–‰ํ•˜๊ธฐ์—, config file๊ณผ ๊ตฌ๋™์˜ต์…˜์„ ๋™์‹œ์— ์ˆ˜ํ–‰ํ•˜๋ฉด old_opts์— ์ค‘๋ณต๋œ ๊ฐ’์ด ๋“ค์–ด๊ฐ”์Šต๋‹ˆ๋‹ค.
    • ์ด์— config_file๊ณผ ๊ตฌ๋™์˜ต์…˜ ๋ชจ๋‘ settings ์ „์—ญ ๊ตฌ์กฐ์ฒด๋งŒ ์—…๋ฐ์ดํŠธ๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ , ํŒŒ์‹ฑ์ดํ›„์— old_opts ๋ฌธ์ž์—ด์„ ์ž‘์„ฑํ•˜๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค.

@ing-eoking ing-eoking marked this pull request as draft December 22, 2025 00:57
@ing-eoking ing-eoking marked this pull request as ready for review December 26, 2025 08:23
@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch 2 times, most recently from a20ccb4 to bd65692 Compare December 26, 2025 08:29
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ์™„๋ฃŒ

memcached.c Outdated
settings.username = strdup(optarg);
break;
case 'P':
FREE_CFGFILE_VAL(settings.pid_file);
Copy link
Collaborator

Choose a reason for hiding this comment

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

FREE_CFGFILE_VAL() ๋งคํฌ๋กœ๊ฐ€ ํ•„์š”ํ•œ ์ด์œ ๊ฐ€ ์ดํ•ด๋˜์ง€ ์•Š๋Š” ๋ฐ, ์„ค๋ช… ๋ฐ”๋ž๋‹ˆ๋‹ค.
์ฐธ๊ณ ๋กœ, ์œ„์˜ settings.username ์ฒ˜๋Ÿผ free ํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

Choose a reason for hiding this comment

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

์ฐธ๊ณ ๋กœ, ์œ„์˜ settings.username ์ฒ˜๋Ÿผ free ํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ธฐ์กด์— optarg ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋Œ€์‹  strdup()์œผ๋กœ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น๋ฐ›๋„๋ก ๋ณ€๊ฒฝํ–ˆ๋Š”๋ฐ,
์ข…๋ฃŒํ•  ๋•Œ settings.username free ํ•˜๋Š” ๋กœ์ง ๋น ์ง„ ๊ฒƒ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FREE_CFGFILE_VAL() ๋งคํฌ๋กœ๊ฐ€ ํ•„์š”ํ•œ ์ด์œ ๊ฐ€ ์ดํ•ด๋˜์ง€ ์•Š๋Š” ๋ฐ, ์„ค๋ช… ๋ฐ”๋ž๋‹ˆ๋‹ค.
์ฐธ๊ณ ๋กœ, ์œ„์˜ settings.username ์ฒ˜๋Ÿผ free ํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ฐ™์€ ๊ตฌ๋™ ์˜ต์…˜์ด ์—ฌ๋Ÿฌ ๋ฒˆ ์ „๋‹ฌ๋˜๋Š” ๊ฒฝ์šฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.
config ํŒŒ์ผ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ settings.pid_file์—๋Š” ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น๋œ ๊ฐ’์ด ์ €์žฅ๋˜์ง€๋งŒ, ๊ธฐ์กด ๊ตฌ๋™ ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” optarg์˜ ์ฃผ์†Œ๋ฅผ ๊ทธ๋Œ€๋กœ ๊ฐ€๋ฆฌํ‚ค๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
์ด ์ƒํƒœ์—์„œ ๋™์ผํ•œ ๊ตฌ๋™ ์˜ต์…˜์„ ์—ฌ๋Ÿฌ ๋ฒˆ ์‚ฌ์šฉํ•˜๋ฉด(memcached -P ./pidfile1 -P ./pidfile2 ...), ํ•ด๋‹น ๊ฐ’์„ freeํ•˜๋ฉด ์•ˆ ๋˜๋Š” ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•˜๋ฏ€๋กœ ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์œ„์˜ ๋งคํฌ๋กœ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ์กด์— optarg ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋Œ€์‹  strdup()์œผ๋กœ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น๋ฐ›๋„๋ก ๋ณ€๊ฒฝํ–ˆ๋Š”๋ฐ,
์ข…๋ฃŒํ•  ๋•Œ settings.username free ํ•˜๋Š” ๋กœ์ง ๋น ์ง„ ๊ฒƒ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

settings.username๋งŒ ์•„๋‹Œ arcus_proxy_cfg ์ชฝ๋„ ๋น ์ ธ์žˆ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ PR์—์„œ๋Š” ์ด๋ฅผ ๋ณ„๋„๋กœ ์ฒ˜๋ฆฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

Choose a reason for hiding this comment

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

์•„๋ž˜ ๋‘ ๊ฐ€์ง€ ํŒจํ„ด์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๊ตฌ๋ถ„ ๊ธฐ์ค€์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

  1. FREE_CFGFILE_VAL ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ
  2. strdup + free ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ

Copy link
Collaborator Author

@ing-eoking ing-eoking Dec 29, 2025

Choose a reason for hiding this comment

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

์•„๋ž˜ ๋‘ ๊ฐ€์ง€ ํŒจํ„ด์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๊ตฌ๋ถ„ ๊ธฐ์ค€์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

์ •ํ™•ํ•œ ์‚ฌํ•ญ์€ ๋ชจ๋ฆ…๋‹ˆ๋‹ค.
์™ธ๋ถ€ API๋กœ ํ•ด๋‹น ์ฃผ์†Œ ๊ณต๊ฐ„์„ ๋„˜๊ธฐ๋Š” ๊ฒฝ์šฐ, strdup์„ ์“ด ๊ฒƒ์œผ๋กœ ์ถ”์ •ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

Choose a reason for hiding this comment

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

์ด์ „ ์ฝ”๋ฉ˜ํŠธ์—์„œ ์งˆ๋ฌธ์„ ๋ชจํ˜ธํ•˜๊ฒŒ ํ–ˆ๋Š”๋ฐ, ๊ธฐ์กด ๊ตฌํ˜„๊ณผ ๋ณ„๊ฐœ๋กœ
์ด๋ฒˆ PR์—์„œ optarg๋ฅผ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๋˜ ์˜ต์…˜์€ ๋ชจ๋‘ FREE_CFGFILE_VAL์œผ๋กœ ๋ณ€๊ฒฝํ•˜์˜€๋Š”๋ฐ
username๋งŒ ์˜ˆ์™ธ๋กœ strdup() ์‚ฌ์šฉํ•œ ์ด์œ ๋ฅผ ๋ฌผ์œผ๋ ค๋˜ ๊ฒƒ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

username ์ชฝ์— strdup ์ฒ˜๋ฆฌ๊ฐ€ ๋“ค์–ด๊ฐ€ ์žˆ๋Š” ์ง€ ๋ชฐ๋ž์Šต๋‹ˆ๋‹ค.
ํ˜„์žฌ๋Š” ์ˆ˜์ • ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch 3 times, most recently from 7faba24 to b2570e2 Compare December 29, 2025 01:07
@jhpark816 jhpark816 requested a review from namsic December 29, 2025 03:59
@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch 9 times, most recently from 38b8dbe to 7c5e437 Compare December 30, 2025 00:52
@jhpark816
Copy link
Collaborator

@ing-eoking
draft๋กœ ๋ณ€๊ฒฝํ•œ ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”?

@ing-eoking
Copy link
Collaborator Author

@jhpark816

PR๋ณ€๊ฒฝ์ด ์žˆ์–ด์„œ ์ž ์‹œ draft๋กœ ๋‘์—ˆ์Šต๋‹ˆ๋‹ค

draft ํ•ด์ œํ–ˆ์Šต๋‹ˆ๋‹ค.

@ing-eoking ing-eoking marked this pull request as ready for review December 31, 2025 07:26
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ์™„๋ฃŒ

memcached.c Outdated
}
}

#define EXTENSION_PATH_MAX_SIZE 10
Copy link
Collaborator

Choose a reason for hiding this comment

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

์ด ๊ฐ’์€ 5์ด์–ด๋„ ์ถฉ๋ถ„ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

memcached.c Outdated

static int load_config_file(const char *path)
{
int ret = EXIT_SUCCESS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

EXIT_XXXX ์ฝ”๋“œ์™€ EX_XXXX ์ฝ”๋“œ๊ฐ€ ํ˜ผ์šฉ๋˜์–ด ์‚ฌ์šฉ๋˜๋Š” ๋ฐ์š”.
์„ฑ๊ณตํ•˜๋ฉด 0, ์‹คํŒจํ•˜๋ฉด -1์„ ๋ฆฌํ„ดํ•˜๋Š” ๊ฒƒ์ด ๊ฐ„๋‹จํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator Author

@ing-eoking ing-eoking Jan 2, 2026

Choose a reason for hiding this comment

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

binding protocol ์—๋Ÿฌ์˜ ๊ฒฝ์šฐ EX_USAGE, ๊ทธ ์™ธ์˜ ๊ฒฝ์šฐ๋Š” EXIT_FAILURE๋กœ ์ข…๋ฃŒํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

binding protocol์—๋Ÿฌ๋Š” -2, ๊ทธ ์™ธ์˜ ๊ฒฝ์šฐ๋Š” -1์„ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

memcached.c Outdated
uint32_t cache_memory_limit = settings.maxbytes / (1024 * 1024);
#ifdef ENABLE_STICKY_ITEM
uint32_t sticky_memory_limit = settings.sticky_limit / (1024 * 1024);
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

cache_memory_limit๊ณผ sticky_memory_limit์€ 0์„ ์ดˆ๊ธฐ ๊ฐ’์œผ๋กœ ๊ฐ€์ ธ๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cache_memory_limit์™€ sticky_memory_limit ๊ฐ’์„ 0์œผ๋กœ ์„ค์ •ํ•˜๋ฉด,
config ํŒŒ์ผ์—์„œ ํ•ด๋‹น ๊ฐ’๋“ค์ด ๋ณ„๋„๋กœ ํ• ๋‹น๋˜์ง€ ์•Š๋”๋ผ๋„ ๊ธฐ๋ณธ๊ฐ’์ด ์•„๋‹Œ 0์œผ๋กœ ๋ฐ”๋€Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์„ ์•„๋ž˜์ฒ˜๋Ÿผ ๋ช…์‹œ์ ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ํ˜น์‹œ ํ–ฅํ›„ ๊ธฐ๋ณธ๊ฐ’์ด ๋ณ€๊ฒฝ๋  ๊ฐ€๋Šฅ์„ฑ์„ ๊ณ ๋ คํ•˜์—ฌ ํ˜„์žฌ์™€ ๊ฐ™์ด ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

uint32_t cache_memory_limit = 64;
#ifdef ENABLE_STICKY_ITEM
uint32_t sticky_memory_limit = 0;
#endif

๋‹ค๋ฅธ ํ˜•ํƒœ๋ฅผ ์›ํ•˜์‹ ๋‹ค๋ฉด ์•„๋ž˜ ํ˜•ํƒœ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

#define DEFAULT_MEMORY_LIMIT 64
#define DEFAULT_STICKY_LIMIT 0

...

static void settings_init(void)
{
  ...
  settings.maxbytes = DEFAULT_MEMORY_LIMIT * 1024 * 1024;
  settings.sticky_limit = DEFAULT_STICKY_LIMIT * 1024 * 1024;
}

static int load_config_file(const char *path)
{
  uint32_t cache_memory_limit = DEFAULT_MEMORY_LIMIT;
#ifdef ENABLE_STICKY_ITEM
  uint32_t sticky_memory_limit = DEFAULT_STICKY_LIMIT;
#endif
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

cache_memory_limit์™€ sticky_memory_limit๋Š” ๋กœ์ปฌ ๋ณ€์ˆ˜์ธ ๋ฐ,
์ด์— ๋Œ€ํ•ด ํŠน๋ณ„ํ•œ ์ดˆ๊ธฐ ๊ฐ’์„ ์„ค์ •ํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค ์•„๋ž˜ ํ˜•ํƒœ์˜ ์ฝ”๋“œ๊ฐ€ ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

static int load_config_file(const char *path)
{
  uint32_t cache_memory_limit = 0;
#ifdef ENABLE_STICKY_ITEM
  uint32_t sticky_memory_limit = 0;
#endif

  . . .

  if (cache_memory_limit > 0) {
    settings.maxbytes = (size_t)cache_memory_limit * 1024 * 1024;
  }
#ifdef ENABLE_STICKY_ITEM
  if (sticky_memory_limit > 0) {
    settings.sticky_limit = (size_t)sticky_memory_limit * 1024 * 1024;
  }
#endif
}

@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch from b0f4957 to d4efac0 Compare January 2, 2026 00:39
@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch from 4e4d057 to a7f7913 Compare January 2, 2026 03:04
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

์ผ๋ถ€ ๋ฆฌ๋ทฐ

@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch from a7f7913 to c245ed4 Compare January 2, 2026 03:22
# -----------------------------------------------------------------------------
# Maximum memory to use for item storage. (Default: 64M)
# Use suffixes: K, M, G, T (case-insensitive)
memory_limit=64M
Copy link
Collaborator

Choose a reason for hiding this comment

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

์—ฌ๊ธฐ๋Š” ๋‹จ์œ„๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

๋ฐ˜๋ฉด, ๊ตฌ๋™ ์˜ต์…˜์œผ๋กœ ์ฝ์„ ๋•Œ๋Š” ๋‹จ์œ„๋ฅผ MB๋กœ ์ธ์‹ํ•˜๊ณ  ์žˆ๋Š” ๋ฐ, ์ด ๋ถ€๋ถ„์ด ์ด์ƒํ•œ ๊ฒƒ์ด๊ตฐ์š”.
์—ฌ๊ธฐ ๋‹จ์œ„๋ฅผ ํฌํ•จํ•˜์—ฌ ์ฝ๋Š”๋‹ค๋ฉด, settings.maxbytes๋กœ ๋ฐ”๋กœ ์ฝ์–ด ๋“ค์—ฌ๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

sticky_limit ์ง€์ • ์‹œ์—๋„ ๋‹จ์œ„๋ฅผ ์ง€์ •ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ํ•˜๊ตฌ์š”.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ing-eoking @namsic
์—ฌ๊ธฐ ์„ค์ •๊ณผ ์•„๋ž˜ load_config_file() ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด,
์ด๋ ‡๊ฒŒ ์„ค์ •ํ•œ ๊ฒƒ์œผ๋กœ ํ…Œ์ŠคํŠธ๋ฅผ ํ•œ๋ฒˆ๋„ ์•ˆ ํ•ด ๋ณธ ๊ฒƒ ๊ฐ™์€๋ฐ์š”. ์–ด๋–ค๊ฐ€์š”?

Copy link
Collaborator Author

@ing-eoking ing-eoking Jan 5, 2026

Choose a reason for hiding this comment

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

memory_limit์— ๋Œ€ํ•œ ์„ค๋ช…์ด ํ•ด๋‹น ๋‚ด์šฉ์œผ๋กœ ์“ฐ์—ฌ์žˆ๋Š” ์ง€ ๋ชฐ๋ž์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ ํ…Œ์ŠคํŠธ๋Š” ๋‚ด๋ถ€ ๊ฐ’๊นŒ์ง€ ๋ชจ๋‘ ๊ฒ€์ฆํ•˜๊ณ  ์žˆ์ง€๋Š” ์•Š๊ณ ,
์„ค์ • ํŒŒ์ผ๋กœ ๋™์ž‘์‹œํ‚จ ๋’ค ๊ด€๋ จ ๋ช…๋ น์–ด๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋Š”์ง€ ์ •๋„๋งŒ ํ™•์ธํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ดํ›„ ํ…Œ์ŠคํŠธ๋Š” stats settings๋ฅผ ํ†ตํ•ด ์ถœ๋ ฅ๋œ ๊ฐ’๋“ค์ด ์‹ค์ œ ์„ค์ • ๊ฐ’๊ณผ ์ผ์น˜ํ•˜๋Š”์ง€๊นŒ์ง€ ํ™•์ธํ•˜๋„๋ก ํ…Œ์ŠคํŠธ๋ฅผ ๋ณด์™„ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ธฐ์กด ๊ตฌ๋™ ์˜ต์…˜ ๋ฐ config ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” memory_limit๊ณผ sticky_limit ๊ฐ’์ด ๋ชจ๋‘ MB ๋‹จ์œ„์ด๊ธฐ ๋•Œ๋ฌธ์—,
ํ˜„์žฌ ๊ตฌํ˜„ ๋ฐฉ์‹๋Œ€๋กœ ๋™์ž‘ํ•˜๋Š” ๊ฒƒ์ด ๋งž๋‹ค๊ณ  ์ƒ๊ฐ๋˜๋ฉฐ, ์„ค๋ช…์„ sticky_limit๊ณผ ๋™์ผํ•˜๊ฒŒ ๋ณ€๊ฒฝํ•˜๋Š” ํŽธ์ด ์ข‹์„ ๊ฒƒ์œผ๋กœ ์ƒ๊ฐ๋ฉ๋‹ˆ๋‹ค.

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

ํ•œํŽธ config_parser์—์„œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ๋‹จ์œ„(k, m, g, t)๋ฅผ ์ง€์›ํ•˜๊ณ  ์žˆ์–ด, ์ˆซ์ž ํ˜•ํƒœ์˜ ๊ฐ’์„ ์ฝ์–ด๋“ค์ผ ๋•Œ ๋‹จ์œ„๋ฅผ ํ•จ๊ป˜ ์ฝ๋Š” ๊ฒƒ์ด ๊ฐ•์ œ๋ฉ๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ ์˜ˆ๋ฅผ ๋“ค์–ด 64M๋ฅผ ์„ค์ •ํ•˜๋ฉด ์‹ค์ œ ๋‚ด๋ถ€ ๊ฐ’์€ 64T๋กœ ํ•ด์„๋˜์–ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

cache_size=70368744177664

memory_limit ๊ฐ’์„ MB ๋‹จ์œ„(1024 * 1024)๋กœ ๋ณ€ํ™˜ํ•˜์ง€ ์•Š๊ณ  ์ˆซ์ž ๊ทธ๋Œ€๋กœ ์ฒ˜๋ฆฌํ•˜๋„๋ก ๊ตฌํ˜„ํ•  ๊ฒฝ์šฐ, ์„ค์ • ํŒŒ์ผ์— 1024 * 1024๋ณด๋‹ค ์ž‘์€ ๊ฐ’์„ ์ง€์ •ํ•˜๋ฉด ๋‚ด๋ถ€์ ์œผ๋กœ๋Š” ํ•ด๋‹น ๊ฐ’์ด ๊ทธ๋Œ€๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.
ํ•˜์ง€๋งŒ config ๋ช…๋ น์–ด์—์„œ๋Š” ๊ฐ’์„ 1024 * 1024๋กœ ๋‚˜๋ˆ„์–ด ์ถœ๋ ฅํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ๊ฒฐ๊ณผ์ ์œผ๋กœ 0์œผ๋กœ ํ‘œ์‹œ๋˜๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

Copy link
Collaborator

Choose a reason for hiding this comment

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

maxbytes ์„ค์ •์˜ ์ตœ์ข… ๋ฐฉ์•ˆ์„ ๊ฒฐ์ •ํ•˜์—ฌ ์•Œ๋ ค์ฃผ์„ธ์š”.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

config ํŒŒ์ผ์—์„œ MB ๋‹จ์œ„๋กœ ๊ฐ’์„ ์ง€์ •ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ, Warning ์„ฑ๊ฒฉ์˜ ๋กœ๊ทธ ๋ฉ”์‹œ์ง€๋งŒ ๋‚จ๊ธฐ๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.

@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch 4 times, most recently from c35f177 to 622d768 Compare January 5, 2026 08:24
@ing-eoking ing-eoking marked this pull request as draft January 5, 2026 08:27
@ing-eoking ing-eoking marked this pull request as ready for review January 5, 2026 08:37
@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch 3 times, most recently from 60c3cb6 to 7dcf3be Compare January 6, 2026 02:45
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ์™„๋ฃŒ

@ing-eoking ing-eoking marked this pull request as draft January 6, 2026 07:33
@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch 2 times, most recently from a7fda32 to 2719eb8 Compare January 7, 2026 02:05
@ing-eoking ing-eoking force-pushed the singsangssong/configfile branch from 2719eb8 to 0ec139c Compare January 7, 2026 02:06
@ing-eoking ing-eoking marked this pull request as ready for review January 7, 2026 02:06
@ing-eoking ing-eoking requested review from jhpark816 and namsic January 7, 2026 02:12
@jhpark816
Copy link
Collaborator

@namsic ์ตœ์ข… ๋ฆฌ๋ทฐ๋งŒ ํ•œ๋ฒˆ ํ•ด ์ฃผ์„ธ์š”.

@jhpark816
Copy link
Collaborator

@ing-eoking
์ˆ˜๊ณ ํ–ˆ์Šต๋‹ˆ๋‹ค.

@jhpark816 jhpark816 merged commit 7e3e541 into develop Jan 7, 2026
1 check passed
@ing-eoking ing-eoking deleted the singsangssong/configfile branch January 7, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants