[SERVER-57856] Performance degradation in docker when limit the resource with --cpus Created: 21/Jun/21 Updated: 21/Jun/21 Resolved: 21/Jun/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | fred chen | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
I deployed a mongodb with docker for testing, with following cmd ``` docker run --rm --name mongodb -p 27017:27017 -v /mnt/mongo/data:/data/db -m 2g --cpus=2 -d mongo:latest ``` The host VM is a Ubuntu18.04, with 4 cores and 16G mem. The testing works as following: Insert 2,000,000 documents into mongodb with python. the document is like following: ``` { event_time: '2021-06-02T11:40:26', src_addr: '192.168.75.190', src_port: 58612, dst_addr: '161.125.178.34', dst_port: 786, url: 'http://www.orozco.net/', mime_type: 'text/css', md5: '6aa1af2ba586a0dfae3f880e155f9fdb', file_name: 'apply.jpeg', server_token: 'Varnish', user_agent: 'Mozilla/5.0 (compatible; MSIE 8.0; Windows 98; Trident/4.1)' }``` Index were set on: event_time, src_addr, src_port, dst_addr, dst_port and file_name. The performance is extremely slow: about 200/s. I adjust the host VM to 2 cores and 16G mem, and redo the testing, the interesting thing happened. The inserting performance became about 15000/s.
I think the key point is the core number of the host VM and the index. When I remove the index, the performance is about 25000/s even the limited core number is less than the host VM's core. When the index is setup, the performance became very slow when the limited core number is not equal to the host VM's.
Thanks! Fred
|
| Comments |
| Comment by Eric Sedor [ 21/Jun/21 ] |
|
Thanks chw_throx@163.com; we'll close this ticket and continue in |
| Comment by fred chen [ 21/Jun/21 ] |
|
Sorry, Something is wrong than I created a duplicated case with 57855, pls help to ingore for I don't know how to close. |