Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand INFO & MEMORY & CLIENT LIST command #4504

Open
soloestoy opened this issue Dec 4, 2017 · 1 comment
Open

Expand INFO & MEMORY & CLIENT LIST command #4504

soloestoy opened this issue Dec 4, 2017 · 1 comment

Comments

@soloestoy
Copy link
Collaborator

This issue is an additional version of #4493 about show more memory info, and I implement it in PR #4502:

  1. Show overhead_ht_main, overhead_ht_expires and rehashidx in keyspace section.

    Notice that in issue Redis 4.0.2 crashed by signal: 11 when dataset size reaches 200+ GB #4493, used_memory_overhead:137439490190 the overhead memory is too big, I guess redis was doing rehash, so I think it's useful to show the overhead memory of dbs and rehash progress.

  2. Bugfix for function getMemoryOverheadData.

    We lost monitor clients when we get normal clients buffers.

             listRewind(server.clients,&li);
              while((ln = listNext(&li))) {
                  client *c = listNodeValue(ln);
     -            if (c->flags & CLIENT_SLAVE)
     +            if (c->flags & CLIENT_SLAVE && !(c->flags & CLIENT_MONITOR))
                      continue;
                  mem += getClientOutputBufferMemoryUsage(c);
                  mem += sdsAllocSize(c->querybuf);
                  mem += sizeof(client);
              }
    
  3. Distinguish pubsub clients from normal clients.

    We set different limits for normal slave and pubsub clients.

    client-output-buffer-limit normal 0 0 0
    client-output-buffer-limit slave 256mb 64mb 60
    client-output-buffer-limit pubsub 32mb 8mb 60
    

    So I think it's necessary to show the overhead memory of them respectively, not only in memory stats but also in info memory and memory doctor commands.

  4. Make all overhead human readable in the memory section of info command.

  5. Show the pubsub flag in the result of client list, and add a sub command client list type xxx in PR Client list type #4503.


P.S. BTW, why we take overhead memory into bytes_per_key?

    /* Metrics computed after subtracting the startup memory from
     * the total memory. */
    size_t net_usage = 1;
    if (zmalloc_used > mh->startup_allocated)
        net_usage = zmalloc_used - mh->startup_allocated;
    mh->dataset_perc = (float)mh->dataset*100/net_usage;
    mh->bytes_per_key = mh->total_keys ? (net_usage / mh->total_keys) : 0;

I think just take dataset into account is enough and evident.

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

No branches or pull requests

1 participant