Skip to content

Commit 41015d1

Browse files
committed
PYTHON-5059 Update default maxMessageSizeBytes and maxWriteBatchSize
1 parent dc18231 commit 41015d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pymongo/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060

6161
# Defaults until we connect to a server and get updated limits.
6262
MAX_BSON_SIZE = 16 * (1024**2)
63-
MAX_MESSAGE_SIZE: int = 2 * MAX_BSON_SIZE
63+
MAX_MESSAGE_SIZE = 48 * 1000 * 1000
6464
MIN_WIRE_VERSION = 0
6565
MAX_WIRE_VERSION = 0
66-
MAX_WRITE_BATCH_SIZE = 1000
66+
MAX_WRITE_BATCH_SIZE = 100000
6767

6868
# What this version of PyMongo supports.
6969
MIN_SUPPORTED_SERVER_VERSION = "4.0"

pymongo/hello.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def max_bson_size(self) -> int:
133133

134134
@property
135135
def max_message_size(self) -> int:
136-
return self._doc.get("maxMessageSizeBytes", 2 * self.max_bson_size)
136+
return self._doc.get("maxMessageSizeBytes", common.MAX_MESSAGE_SIZE)
137137

138138
@property
139139
def max_write_batch_size(self) -> int:

0 commit comments

Comments
 (0)