簡單的鍵值儲存測試
This is the first follow-up to my post on a simple test of KVS alternatives. To recap, I tested a simple single table schema in MySQL using the NDB and InnoDB storage engines. To have a Key-Value store to compare with, I did the same test in MongoDB. All tests were done of the same system, an 8-core AMD Linux box with 16 Gb RAM. The tests consisted of reading 1.000.000 rows, out of the total 105.000.000 in the table, distributed over 100 threads 10 times, a total of 10.000.000 rows read then. The test program I use makes sure that the same random ID's of the table are reused each time and the same are used for all servers.
Now, firstly, after some checking I realized that I had not fully cached the InnoDB engine, so it was doing a certain, small, amount of disk I/O still. I fixed this and the number now looks like this:
1. MongoDB - 110.000 rows read per second.
2. InnoDB - 39.000 rows read per second.
3. NDB - 32.000 rows read per second.
So now InnoDB is faster than NDB. But NDB has some tricks up it's sleeve, like running with multiple mysqld servers, and I have today finished my test-program to support just this. Also, I have had some useful hints of NDB engine tuning, so I'll try that one too, but testing NDB takes more time as restarting NDB is much, much slower than MongoDB or MySQL with InnoDB.
Now, firstly, after some checking I realized that I had not fully cached the InnoDB engine, so it was doing a certain, small, amount of disk I/O still. I fixed this and the number now looks like this:
1. MongoDB - 110.000 rows read per second.
2. InnoDB - 39.000 rows read per second.
3. NDB - 32.000 rows read per second.
So now InnoDB is faster than NDB. But NDB has some tricks up it's sleeve, like running with multiple mysqld servers, and I have today finished my test-program to support just this. Also, I have had some useful hints of NDB engine tuning, so I'll try that one too, but testing NDB takes more time as restarting NDB is much, much slower than MongoDB or MySQL with InnoDB.
But I have another test result today! I realized that although I no big fan of the query cache, I should be able to use that here too. And I don't need that a big a cache, as I am only reading some 1.000.000 rows. So off I went, turned on and tuned in, without dropping out, the query cache and ran my test again. I soon realized one thing: Warming up the query cache was going to be real slow. But warming up MongoDB is just as slow, MongoDB really is targeted for as much as possible in RAM, the disk I/O the do is hardly optimized (they use mmap, so what can you expect).
Once the query cache was nice and warm, I ran my benchmark (this was using the mysqld with InnoDB, which matters less as all reads are now done in the query cache). And what I got was about 34.000 rows read per second. This is not a 100% fair comparison of course, as the query cache doesn't need to cache that much (only 1.000.000 queries), but really, it should have been faster than caching in InnoDB, I was a bit disappointed with this and I'll see if I can find the bottleneck somewhere in the code.
But I'm not finished yet. The MEMORY engine and NDB with a few more mysqld servers remains to be tested, as well as Tarantool, the MySQL HANDLER interface and NDBAPI eventually. Not necessarily in that order.
And before closing, if you are wondering, the test program is written in plain C, no C++ or Java or anything or fancy stuff like that. Also, the test program uses proper multi-threading, I do not have multiple processes running around here,
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-741254/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 實現鍵值對儲存(二):以現有鍵值對儲存為模型模型
- 用鍵值儲存實現MVCC模式MVC模式
- 981-基於時間的鍵值儲存
- 實現鍵值對儲存(一):什麼是鍵值對儲存,為什麼要實現它
- MySQL的鍵值儲存以及與MongoDB的對比MySqlMongoDB
- 簡單測試在儲存過程中臨時表與union all的效能差別儲存過程
- MySQL federated儲存引擎測試MySql儲存引擎
- 提升Raft以加速分散式鍵值儲存Raft分散式
- 進階篇_map容器(儲存鍵值對)
- 實現鍵值對儲存(0):目錄
- 簡單的造數儲存過程儲存過程
- 簡單分析oracle的資料儲存Oracle
- 簡單的儲存過程分頁儲存過程
- 簡單的分頁儲存過程儲存過程
- 建立測試用例以及測試結果儲存
- 簡單的 ping 測試
- 實現鍵值對儲存(四):API設計API
- vmware測試1 儲存劃分
- Postmark測試後端儲存效能後端
- 我的測試儲存過程程式碼儲存過程
- 簡單檔案的上傳與儲存
- mysql簡單效能測試MySql
- sql trace 簡單測試SQL
- 讓 API 測試變的簡單API
- Linux的OOMkiller簡單測試LinuxOOM
- Oracle RAC的TAF簡單測試Oracle
- [原創]儲存過程效能測試儲存過程
- 全面的儲存過程 測試可用儲存過程
- HDU-安卓程式開發之簡單儲存/內部儲存/外部儲存 & 捉蟲安卓
- Hive的壓縮儲存和簡單優化Hive優化
- Go實現簡單的K-V儲存Go
- 簡單描述桌面虛擬化儲存的概念
- 學習一個簡單的儲存過程儲存過程
- 【火爐煉AI】機器學習003-簡單線性迴歸器的建立,測試,模型儲存和載入AI機器學習模型
- mysql 儲存過程簡單例項MySql儲存過程單例
- mysql儲存過程簡單例項MySql儲存過程單例
- Android鍵值對儲存成XML檔案SharedPreferencesAndroidXML
- 實現鍵值對儲存(五):雜湊表實現