Spring.xml配置文件中
<mongo:options
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"/>
</mongo:mongo>
将
write-fsync=" true"/>
修改为
write-fsync="false"/>
即可.
测试发现.true时,插入需要45毫秒左右.改为false.只需3,4毫秒.差距还是比较大的.
mongodb数据插入慢
猜你喜欢
转载自sanyecao2314.iteye.com/blog/2221665
今日推荐
周排行