[SERVER-24384] Extremely slow writes on OSX with WiredTiger and constant collection/index creation+drop Created: 02/Jun/16  Updated: 14/Jul/16  Resolved: 03/Jun/16

Status: Closed
Project: Core Server
Component/s: WiredTiger
Affects Version/s: 3.2.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Daniel Doubrovkine Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Darwin 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

db version v3.2.6
git version: 05552b562c7a0b3143a729aaa0838e558dc49b25
OpenSSL version: OpenSSL 1.0.2h 3 May 2016
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64

(can't figure out how to find the wiredtiger version, so labeling as last, but I could be wrong)


Attachments: Text File mongo.log    
Issue Links:
Duplicate
duplicates SERVER-17675 Support file per database for WiredTiger Closed
Related
Operating System: ALL
Participants:

 Description   

Default installation of MongoDB 3.2.6 via brew.

Basic commands like creating an index or dropping a collection take a long time.

2016-04-13T11:02:19.970-0400 I COMMAND  [conn30] command mongoid_collection_snapshot_test.custom_connection_snapshots command: insert { insert: "custom_connection_snapshots", documents: [ { _id: ObjectId('570e5f789b0b5842f3b5e516'), workspace_basename: "snapshot", _slugs: [ "snapshot" ], max_collection_snapshot_instances: 2, created_at: new Date(1460559739398) } ], ordered: true } ninserted:1 keyUpdates:0 writeConflicts:0 numYields:0 reslen:40 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { w: 1, W: 1 } }, Collection: { acquireCount: { w: 1, W: 1 } } } protocol:op_query 1128ms
2016-04-13T11:04:37.898-0400 I COMMAND  [conn39] command gravity_test_imports.artist_similarity_indices.output.snapshot command: drop { drop: "artist_similarity_indices.output.snapshot" } keyUpdates:0 writeConflicts:0 numYields:0 reslen:125 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { W: 1 } } } protocol:op_query 1077ms

Switching storage to mmapv1 resolves the problem.

Disabling journaling doesn't help.

Attached a log where there're a few restarts switching between different configurations and some test queries.



 Comments   
Comment by Daniel Pasette (Inactive) [ 05/Jun/16 ]

Daniel, have you tried using the ephemeralForTest storage engine? I wasn't sure if in your last comment you meant that you don't have control over the storage engine setting or not, but for local unit-testing against a standalone mongod server, this could be a good approach for you.

Comment by Daniel Doubrovkine [ 03/Jun/16 ]

Just to be clear, we don't always have control in development over configuration options of a database, for example in Travis-CI.

Comment by Daniel Doubrovkine [ 03/Jun/16 ]

FWIW the big advantage of MongoDB is that it is (was) really cheap to bring up and tear down a database for every test, and that is what most Ruby developers using MongoDB do via libraries like database_cleaner. It's literally the default setup I've seen in just about any project.

Comment by Ramon Fernandez Marina [ 03/Jun/16 ]

dblock, what the log shows is the following in a loop:

  • lots of index creations
  • lots of collection drops

WiredTiger uses one file per collection and one file per index, so in this workload your system is very busy creating and removing files, which would explain the timings you're seeing.

MMAPv1 uses a file per database and all your collections and indexes seem to be on the same database, so file allocation and deletion is not an issue.

I'm going to close this ticket as a duplicate of SERVER-17675, which you may want to vote for and follow for updates. If your testing represents your actual workload (i.e.: constant collection/index creation followed by drops) then I'd recommend you use MMAPv1.

Regards,
Ramón.

Comment by Daniel Doubrovkine [ 02/Jun/16 ]

This is a vanilla installation, no data, and clearing /usr/local/var/mongodb every time.

Generated at Thu Feb 08 04:06:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.