GithubHelp home page GithubHelp logo

shaygalon / memcache-perf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leverich/mutilate

17.0 17.0 9.0 230 KB

Load generator for memcached (multi threaded, multi machine)

License: BSD 3-Clause "New" or "Revised" License

C++ 44.93% C 54.19% Shell 0.14% Makefile 0.74%

memcache-perf's People

Contributors

dschatzberg avatar dterei avatar jty2 avatar lcp avatar leverich avatar shay-cavium avatar shaygalon avatar shaygoog avatar syang0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

memcache-perf's Issues

TX bytes are calculated incorrectly when using --binary mode

Hello,

The following calculation in Connection::issue_set() is incorrect for little-endian hosts:

l = 24 + h.body_len;

The value is set to network-byte order (big-endian) earlier in the code:

htonl(keylen + 8 + length)};

The code already handles this for issue_get_req() but it looks like it was missed in issue_set(). One possible fix is the following code diff:

--- Connection.cc.orig	2021-12-07 16:40:55.000000000 -0600
+++ Connection.cc	2021-12-07 16:47:28.000000000 -0600
@@ -259,15 +259,16 @@
     read_state = WAITING_FOR_SET;
 
   if (options.binary) {
+    uint32_t body_len = keylen + 8 + length;
     // each line is 4-bytes
     binary_header_t h = { 0x80, CMD_SET, htons(keylen),
                           0x08, 0x00, {htons(0)}, //TODO(syang0) get actual vbucket?
-                          htonl(keylen + 8 + length)};
+                          htonl(body_len)};
 
     bufferevent_write(bev, &h, 32); // With extras
     bufferevent_write(bev, key, keylen);
     bufferevent_write(bev, value, length);
-    l = 24 + h.body_len;
+    l = 24 + body_len;
   } else {
     l = evbuffer_add_printf(bufferevent_get_output(bev),
                                 "set %s 0 0 %d\r\n", key, length);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.