Because do not enter the database, this article does not represent MongoDB performance, only in this and IO to do a simple comparison of the performance is not scientific, but also from the side to explain a certain problem, to the development of a certain hint.
Attached: This test and in early 2012, due to the late entry of the blog, may be different, welcome to provide the latest data.
Test data size: 531M
Read Data size: 10^7 bytes
Because the fastest memory file read and write in MongoDB is roughly as follows (does not enter the database):
Read (unsigned int noffset, void *lpstore, unsigned int nstorelen), whose each read has been offset by default for a similar seek, so the test uses seek and no seek while testing, resulting as follows (unit: MS):
Read 1 bytes at a time, read 10^7 times, (Seek corresponds 10^7 times)
Without seek |
Seek |
Mongodb |
265 |
5678 |
3885 |
281 |
5601 |
3916 |
265 |
5612 |
3791 |
272 |
5726 |
3842 |
264 |
5709 |
3850 |
280 |
5702 |
3872 |
265 |
5600 |
3940 |
266 |
5631 |
3912 |
Read 10 bytes at a time, read 10^6 times:
390
Without seek |
seek |
MongoDB |
- |
608 |
390 |
" p>31 |
562 |
406 |
To |
5 |
390 |
$ |
577 |
390 |
|
577 |
375 |
|
577 |
390 |
to |
562 |
422 |
|
577 | td>
|
562 |
390 |
Reading 10^7 BYTE is nearly as close to reading a large memory block.
Summary: In the test MongoDB for continuous read performance about only about 1/10 of Io, but relative to the value of each offset after a significant advantage (such as moving the mouse to obtain image values, as shown below), for reading large memory, MongoDB performance and IO difference is negligible. Therefore, the greater the granularity, the MongoDB performance is closer to Io, if the MongoDB as the bottom, you need to avoid frequent small granularity of access (Zecundi).
This paper simply tests the MongoDB not to enter the database under Read, and does not represent the performance of MongoDB itself, can only explain how to better apply it.