Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I successfully basic configure my replica set, but i noticed slow read performance. I have 2 mongo servers and 1 arbiter in my replica set. All are running on Centos 6.3 minimal setup (just database).

I also have single mongo instance on Windows server 2012.

Before i build my replica set, my web server was on same OS as Mongo (that windows instance). Performance was fine, results was like

C# .NET 4.5 (IIS and Mongo on same VM) Read 2000 rows : ~250ms at AvgObj 2600 bytes

Now with my replica set i have very slow read performance. When my web server access replica set, i`m getting result like

C# .NET 4.5 (separated, IIS and Mongo on Centos Replica) Read 2000 rows : ~2500ms at AvgObj 2600 bytes

I tried to read from my single Mongo instant from remote IIS and result is like

C# .NET 4.5 (separated, IIS and Single Mongo on Windows) Read 2000 rows : ~600ms at AvgObj 2600 bytes

All servers are running in single physical machine with Hyper-V core server.

Im using latest C# MongoDB Driver 1.7 version. From what i tested, on all mongo servers my query is executed in 10ms.

Can anyone give me suggestions why my replica set on separated Centos servers have slow read performance?

share|improve this question
add comment

1 Answer

If you try to read directly from a Replica without setting slaveok=true, the replica will proxy the read from the master and relay. This is likely the source of most of your latency. Double check your preference mode to be sure you're setting one that permits reading directly from non-master nodes.

share|improve this answer
    
We can choose ReadPreferenceMode eq ReadPreferenceMode.PrimaryPreferred in new drivers –  Novkovski Stevo Bato Dec 20 '12 at 22:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.