Skip to content

connection.js #2

@alinsilvian

Description

@alinsilvian

In connection.js -> processRequest this implementation is faster.

if (request.data) connection.write(request.command + '\r\n' + request.data + '\r\n');
else connection.write(request.command + '\r\n');

Using 2 writes instead of only one usually causes this ( on the memcache side ):
read(72, 0x7f6b7d72304f, 3) = -1 EAGAIN (Resource temporarily unavailable)
It tries to read the bytes but they are not available, still it waits and tries again , and the second time the correct data is received ( however in set, for example, it may or may not succeed ). Sending it all at once solves this problem and makes the command perform faster

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions