title: MongoDB replica set on a single machine for better reads?
body: <p>I have a single mongod (2.0.2) running on a (Intel Xeon 8 core 2.1 Ghz, 32 GB RAM) server. Here are some sample stats from mongostat (usual normal calm day):</p>
  
  <pre><code>insert  query update delete getmore command flushes mapped  vsize    res faults locked % idx miss %     qr|qw   ar|aw  netIn netOut  conn repl       time
   0    186      3      0       0       5       0  42.6g  87.8g  22.6g      2      0.8          0       0|0     0|0    35k     1m   319    M   20:36:00
   0    177      3      0       0       4       0  42.6g  87.8g  22.5g      2      0.7          0       0|0     0|0    28k   993k   319    M   20:36:30
   0    181      3      0       0       3       0  42.6g  87.8g  22.6g      1      0.6          0       0|0     0|1    28k   878k   319    M   20:37:00
   0    177      4      0       0       4       0  42.6g  87.8g  22.6g      2      0.7          0       0|0     0|0    31k   851k   319    M   20:37:30
   0    171      2      0       0       3       0  42.6g  87.8g  22.6g      2      0.4          0       0|0     1|0    25k   912k   319    M   20:38:00
   0    133      1      0       0       3       0  42.6g  87.8g  22.5g      0      0.3          0       0|0     0|0    20k   673k   319    M   20:38:30
   0    180      3      0       0       4       0  42.6g  87.8g  22.5g      1      0.6          0       0|0     1|0    29k   890k   319    M   20:39:00
  </code></pre>
  
  <p>But sometimes when there are 500-600 users online (I store visit counters in Mongo, so there are a lot of updates when visitors come) queries jump up to ~500 per second and read queue grows quickly and stays at around 40-50 for few minutes which makes scripts time out.</p>
  
  <p>Can adding a replica set member on the same machine (I don't have any more physical servers) help me? I want to set the read preference to point to the secondary member so that writes on the primary instance do not block the reads.</p>