[SERVER-9897] PHP tests for write concern Created: 10/Jun/13  Updated: 13/Nov/14  Resolved: 08/Oct/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Albert Aguirre Assignee: Andrew Ryder (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

uname -a
Linux idm-mdb2-s01c 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


Attachments: Text File wcLagSnippet.txt    
Participants:

 Description   

I created a PHP script that times how long an insert cursor takes to insert data per each write concern.

See results below: (write concerns are based off of the PHP driver doc)

=======================================
Write concern: 0 : Fire and forget
Cursor return: 0.0001230240

Write concern: 1 : Write acknowledged by the primary only
Cursor return: 0.0548999310 <-- SLOWEST????

Write concern: 2 : Write confirmed in 2 secondaries
Cursor return: 0.0135748386

Write concern: 3 : Write confirmed in 3 secondaries
Cursor return: 0.0042228699

Write concern: majority : Write confirmed in the majority of secondaries
Cursor return: 0.0204229355

Write concern: j : write acknowledged by primary and the journal flushed to disk
Cursor return: 0.0119099617
=======================================

Do you know why I would see a much higher time in microseconds with write concern 1 (acknowledgement from the primary) compared to all others?



 Comments   
Comment by Andrew Ryder (Inactive) [ 19/Sep/13 ]

Hi Albert,

Haven't heard back about this and we still haven't been able to reproduce the issue. Have you had a chance to get the MongoDB setup we previously requested?

If I haven't heard back within a couple days I will close this as "unable to reproduce".

Thanks for your time.

– Andrew

Comment by Andrew Ryder (Inactive) [ 30/Jul/13 ]

Hi Albert,

I've not been able to reproduce your results. Can you please confirm;

  • MongoDB set-up (replica hosts, shards).

EDIT: sorry, I realised you gave the PHP and Client OS above.

These are the results I get running your script from MacOS 10.8, PHP 5.5 interactive shell connecting to a Mongo cluster with 5 hosts (no shards).

Write concern: 0 : Fire and forget
Cursor return: 0.0000770092

Write concern: 1 : Write acknowledged by the primary
Cursor return: 0.0006430149

Write concern: 2 : Write confirmed in 2 secondaries
Cursor return: 0.0028929710

Write concern: 3 : Write confirmed in 3 secondaries
Cursor return: 0.0025188923

Write concern: majority : Write confirmed in the majority of secondaries
Cursor return: 0.0025908947

Regards,
Andrew

Comment by Albert Aguirre [ 17/Jun/13 ]

Write concern php code snippet

Comment by Albert Aguirre [ 17/Jun/13 ]

Of course...

Mongo version: 2.2
PHP version: PHP 5.3.2-1ubuntu4.19
Used PHP CLI on Ubuntu

Heres where I got my write concern PHP info:
http://php.net/manual/en/mongo.writeconcerns.php

Code snippet attached

Comment by Stennie Steneker (Inactive) [ 16/Jun/13 ]

Hi Albert,

In order to help us try to reproduce your results, can you please:

  • confirm the specific versions of the MongoDB PHP driver & your PHP interpreter
  • attach your PHP test script that sets write concerns & measures timing

Thanks,
Stephen

Generated at Thu Feb 08 03:21:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.