[SERVER-1746] Perf: count() inconsistent response times Created: 07/Sep/10  Updated: 03/Sep/11  Resolved: 03/Sep/11

Status: Closed
Project: Core Server
Component/s: Performance
Affects Version/s: 1.6.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alvin Richards (Inactive) Assignee: Unassigned
Resolution: Incomplete Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

EC2


Attachments: PDF File Munin.pdf    
Operating System: ALL
Participants:

 Description   

Problem:
Depending on moderate load (see attach munin report), I'm seeing inconsistent time for count()

Mon Sep 6 15:45:33
> db.blogs.count()
169096641
Mon Sep 6 15:54:22

Mon Sep 6 19:06:20
> db.blogs.count()
170166577
Mon Sep 6 19:06:29

The second clocks in a 9 seconds (when there is no load on the system), the first at 9 minutes with a system under moderate load.

I'm guessing that the count is a computed value rather than stored. If we use a stored value in future, then insert and delete operations will be gated by the latch time for the counter, so its a trade off.

Environment:

  • 3 shard cluster, 2 members per shard, plus a config and router node (all separate machines)

Reproduce:
See steps above

Business Case:
Scalability


Generated at Thu Feb 08 02:57:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.