bulldog2011 / bigqueue

A big, fast and persistent queue based on memory mapped file.
http://bulldog2011.github.com/bigqueue
Apache License 2.0
558 stars 219 forks source link

Performance of bigqueue when read and write mixed. #31

Open choiyoung206 opened 6 years ago

choiyoung206 commented 6 years ago

I had written a program to test the performance of bigqueue, the program have 1 producer thread and 1 consumer thread. I'm adding messages in 1 thread and reading messages in another thread simultaneously. I have got following result : Producer thread written 9 million messages with speed of around 125 MB/S. Consumer thread managed to read just over 2 a million record in same time with speed of around 35 MB/S.

Now when I read separately the reading speed is around 95 MB/S.

The significant difference between the reading speed when I read sequentially and when I read randomly due is due to synchronization or this is abnormal and I'm doing it in wrong way.

Kindly let me know