Skip to content

seconds hang up report #4983

Description

@northhurricane

We have 10 thousand connections on a redis server . The server is occasionally hang up.

We found in function "clientsCronResizeQueryBuffer", condition (querybuf_size > 1024 && idletime > 2) is matched many times, and a lot of connections release their querybuf at cron job at the same time.The hang up happened at the same time when bulk release.

if (((querybuf_size > PROTO_MBULK_BIG_ARG) &&
     (querybuf_size/(c->querybuf_peak+1)) > 2) ||
     (querybuf_size > 1024 && idletime > 2))
{
    /* Only resize the query buffer if it is actually wasting space. */
    if (sdsavail(c->querybuf) > 1024) {
        c->querybuf = sdsRemoveFreeSpace(c->querybuf);
    }
}

=====
As we found querybuff is initially allocated with 32 * 1024 bytes. So we change the condition to "querybuf_size > 1024 * 32 && idletime > 2". The hang up is fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions