Skip to content

cache_memlimit command for tuning runtime maxbytes#170

Closed
dormando wants to merge 1 commit into
memcached:nextfrom
dormando:runtime_maxbytes
Closed

cache_memlimit command for tuning runtime maxbytes#170
dormando wants to merge 1 commit into
memcached:nextfrom
dormando:runtime_maxbytes

Conversation

@dormando

@dormando dormando commented Jun 23, 2016

Copy link
Copy Markdown
Member

Allows dynamically increasing the memory limit of a running system, if memory
isn't being preallocated.

cache_memlimit N where N is a value in megabytes. Value can go up or down.

If -o modern is in use, can also dynamically lower memory usage. pages are
free()'ed back to the OS via the slab rebalancer as memory is freed up. Does
not guarantee the OS will actually give the memory back for other applications
to use, that depends on how the OS handles memory.

Allows dynamically increasing the memory limit of a running system, if memory
isn't being preallocated.

If `-o modern` is in use, can also dynamically lower memory usage. pages are
free()'ed back to the OS via the slab rebalancer as memory is freed up. Does
not guarantee the OS will actually give the memory back for other applications
to use, that depends on how the OS handles memory.
Comment thread memcached.c

static void process_memlimit_command(conn *c, token_t *tokens, const size_t ntokens) {
uint32_t memlimit;
assert(c != NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we're checking for c != NULL, why isn't they're also a NULL check for tokens?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think the assert() there is cargo culted by me and could be done once at the top of the process_* stack. Tokens can't be null because you can't get to that function if it's null.

@dormando dormando closed this Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants