[JAVA-203] get different throughput when using db.slaveOk() versus db.collection.addOption(Bytes.QUERYOPTION_SLAVEOK) Created: 26/Oct/10  Updated: 29/Oct/10  Resolved: 27/Oct/10

Status: Closed
Project: Java Driver
Component/s: Performance
Affects Version/s: 2.2
Fix Version/s: 2.3

Type: Bug Priority: Major - P3
Reporter: Alvin Richards (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

EC2 / Ubuntu 10.04
1.6.3
2.2 Java Driver


Attachments: Text File SlaveTest.java     Text File SlaveTest.java    

 Description   

Problem:
Get the following results

Case 1: db.slaveOk()
Queries : 120

Case 2: db.collection.addOption(Bytes.QUERYOPTION_SLAVEOK)
Queries : 412095

Workaround:
Don't use db.slaveOk()

Reproduce:
See attached SlaveTest.java

  • compile with Java 2.2 Driver
  • Case 1 : java -cp mongo-2.2.jar:. com.test.SlaveTest "10.202.215.63:27000,10.243.7.47
    :27000" test blogs 1 3
  • Case 2 : java -cp mongo-2.2.jar:. com.test.SlaveTest "10.202.215.63:27000,10.243.7.47
    :27000" test blogs 2 3

Business Case:

  • performance


 Comments   
Comment by Eliot Horowitz (Inactive) [ 27/Oct/10 ]

changed count() to make it more intuitive

Comment by auto [ 27/Oct/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: count follows collection options JAVA-203
http://github.com/mongodb/mongo-java-driver/commit/304b27451a3121a3f28f14817a6c69c824b920c8

Comment by Eliot Horowitz (Inactive) [ 27/Oct/10 ]

No - i actually made sure to query things so the sub system was initialized

Comment by Eliot Horowitz (Inactive) [ 27/Oct/10 ]

with 5% for me after modifying test to initialize slave connections before starting timer

Comment by Alvin Richards (Inactive) [ 27/Oct/10 ]

Actually, looking at the results there is a 4x perf drop using db.slaveOk() versus collection.addOption(Bytes.QUERYOPTION_SLAVEOK).

Comment by Alvin Richards (Inactive) [ 27/Oct/10 ]

Appears to be resolved with the master

$ java -cp mongo.jar:./bin com.test.SlaveTest "10.196.130.32:27000,10.203.61.5:27000" test blogs 1 3
Inserting data :
type:1
doCount:3
Querying data :
Queries : 104759
Rows found : 2095180
Finished :

$ java -cp mongo.jar:./bin com.test.SlaveTest "10.196.130.32:27000,10.203.61.5:27000" test blogs 2 3
Inserting data :
type:2
doCount:3
Querying data :
Queries : 396038
Rows found : 7920760
Finished :

Comment by Eliot Horowitz (Inactive) [ 27/Oct/10 ]

Did you try master?
This is likely the same issue as we saw/fixed before

Generated at Thu Feb 08 08:51:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.