Search code examples
membaseenyim

Enyim Performance issue


I'm using enyim to provide access to a membase server for a multi-threaded queue readers. These readers access an AQMP queue, check the cache to see if the item has already been processed and if not inserts it into the database and into the cache. The issue is that accessing the cache eats up the CPU. With 4 threads processing messages the CPU is at 80-90%. I've implemented a custom serializer that feeds bytes to enyim. If I switch to my in memory fall back and I can go up to 9 threads before the CPU usage gets to high. The only difference with the in-memory caching and the membase cache is that the bytes are being stored in memory instead of the cache. Any idea of what I could be doing wrong with eynim that could be causing this high CPU usage or is normal? At max the clients are performing about 2.5k ops/s according to the membase console.


Solution

  • One known bottle neck is creating a new MembaseClient every time you want to access cache. The recommendation is to make one instance of the MembaseClient and pass that same instance around. Check this link for details about it:

    https://github.com/enyim/EnyimMemcached/wiki/MembaseClient-Usage