mongodb数据插入慢

Spring.xml配置文件中
connections-per-host="8"
threads-allowed-to-block-for-connection-multiplier="4"
connect-timeout="1000"
max-wait-time="1500"
auto-connect-retry="true"
socket-keep-alive="true"
socket-timeout="1500"
slave-ok="true"
write-number="1"
write-timeout="0"
write-fsync="true"/>



write-fsync=" true"/>
修改为
write-fsync="false"/>
即可.
测试发现.true时,插入需要45毫秒左右.改为false.只需3,4毫秒.差距还是比较大的.

你可能感兴趣的:(mongodb)