当前位置: 动力学知识库 > 问答 > 编程问答 >

MongoDB shard with PHP mongdb driver for storing session is slow, why?

问题描述:

My company uses Php with php mongo driver connecting to a sharded (5) mongo DB. The main thing it does is to store web session. So there is lots of write.

The shard key is the session id which is random ,and it is well balanced.

There are about 360 writes per second per shard. not a lot though. each session data is only few KB.

The problem we observer is that, once there are many data already in Mongo. The write for new sessions become very slow and we see a lot of disk write instead of just accessing the memory.

Why is that? is that normal? or something we have to watch for? I suspect that's the problem from the Php mongo driver because I didn't have that with the node-mongo driver before.

any insight will be helpful. :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: