Enyim 性能问题
我使用 enyim 为多线程队列读取器提供对 membase 服务器的访问。这些读取器访问 AQMP 队列,检查缓存以查看该项目是否已被处理,如果没有,则将其插入数据库和缓存中。问题是访问缓存会占用 CPU 资源。使用 4 个线程处理消息时,CPU 利用率为 80-90%。我已经实现了一个自定义序列化器,它将字节提供给 enyim。如果我切换到内存回退,我可以在 CPU 使用率变高之前最多使用 9 个线程。内存缓存和 membase 缓存的唯一区别是字节存储在内存中而不是缓存中。知道我对 eynim 做错了什么可能会导致 CPU 使用率如此高还是正常的?根据 membase 控制台,客户端最多执行约 2.5k ops/s。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个已知的瓶颈是每次想要访问缓存时都会创建一个新的 MembaseClient。建议创建一个 MembaseClient 实例并传递该同一实例。检查此链接以获取有关详细信息:
https://github.com/enyim/EnyimMemcached/wiki /MembaseClient-用法
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