第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

mongodb的參數(shù)理解

mongodb的參數(shù)理解

富國(guó)滬深 2018-08-16 15:27:35
求問(wèn)大神,對(duì)于mongodb以下幾個(gè)參數(shù)我的理解對(duì)不對(duì)?maxWaitTime=120000 是指已經(jīng)連接到mongodb,正在等待數(shù)據(jù)返回,這個(gè)等待的時(shí)間connectTimeout=10000 是指請(qǐng)求mongodb連接,還沒(méi)有連接上,正在等待連接的時(shí)間socketTimeout=0 是指已經(jīng)連接上了,正在傳輸數(shù)據(jù),傳輸數(shù)據(jù)過(guò)程中會(huì)有耗時(shí),這里就是等數(shù)據(jù)傳遞結(jié)束的等待時(shí)間
查看完整描述

2 回答

?
眼眸繁星

TA貢獻(xiàn)1873條經(jīng)驗(yàn) 獲得超9個(gè)贊

MongoDB Client驅(qū)動(dòng)設(shè)置中網(wǎng)絡(luò)相關(guān)的等待設(shè)置比較多,依次介紹如下:

1、Client找Server所需要等待的時(shí)間,在RS或者Shard環(huán)境下,Client需要找到它所需的Server

對(duì)應(yīng)的參數(shù):ServerSelctionTimeOut

2、找到Server之后就需要建立Connection

1)每次都創(chuàng)建Connection,對(duì)應(yīng)的網(wǎng)絡(luò)等待的參數(shù)就是:connectTimeout
2)Connection pooling的話,從Connection Pool取得Connection,對(duì)應(yīng)的網(wǎng)絡(luò)等待的參數(shù):maxWaitTime.

3、找到Connection之后,就有了Socket通信,在客戶端和MonogoDB的Socket通信過(guò)程中的網(wǎng)絡(luò)等待時(shí)間的參數(shù)就是:socketTimeout

供參考。

Love MongoDB!Have Fun!


查看完整回答
反對(duì) 回復(fù) 2018-08-26
?
慕慕森

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超17個(gè)贊

Stackoverflow上有一個(gè)有140次贊的回答:How to configure MongoDB Java driver MongoOptions for production use?

  • connectTimeout. As the name suggest number of milliseconds the driver will wait before a connection attempt is aborted. Set timeout to something long (15-30 seconds) unless there's a realistic, expected chance this will be in the way of otherwise succesful connection attempts. Normally if a connection attempt takes longer than a couple of seconds your network infrastructure isn't capable of high throughput.

  • maxWaitTime. Number of ms a thread will wait for a connection to become available on the connection pool, and raises an exception if this does not happen in time. Keep default.

  • socketTimeout. Standard socket timeout value. Set to 60 seconds (60000).


查看完整回答
反對(duì) 回復(fù) 2018-08-26
  • 2 回答
  • 0 關(guān)注
  • 777 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)