Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleListing 2: Aggregation using a callback in MasterServer.cc that gets invoked via objectMap.forEach()
/**
* Aggregation Callback
*/
void
aggregateCallback(LogEntryHandle handle, uint8_t type,
                      void *cookie)
{
        const Object* obj = handle->userData<Object>();
        MasterServer *server = reinterpret_cast<MasterServer*>(cookie);

        int *p;
        p = (int*) obj->data;
        server->sum += (uint64_t)*p;
}

Benchmarking

The benchmarks below have been executed using a separate server for client and server connected via Infiniband. After each run, the equality of the client-side and server-side calculated sum has been checked. The benchmarks allow the following conclusions:

  • By executing the aggregation on the server-side a performance improvement up to a factor of 50 can be seen.
  • When traversing a set of distinct objects, retrieving a single object takes about 7-8?s (or a RAMCloud client can request about 130.000 objects/sec from a single RAMCloud server).
  • Invoking the hashTable forEach method comes at a penalty of around 200 ms (presumably to due the Callback).
  • When traversing large amounts of objects the forEach method is 1.6-1.8x faster that looking up each individual object.

#number of objects

client-side aggregation

server-side aggregation
  via hashtable hash table lookup

server-side aggregation
 via hashtable hash table forEach

10.000

75 ms

2 ms

238 ms

100.000

766 ms

23 ms

251 ms

1.000.000

7604 ms

233 ms

369 ms

10.000.000

76515 ms

2662 ms

1444 ms

100.000.000

770761 ms

30049 ms

18752 ms

...