Nagle’s Algorithm
for (i=0; i<100000; i++) write(socket, &buffer[i], 1);
if you have only a few bytes to send, wait until
- you have more to fill a packet
- or the server acknowledges all outstanding data
- or you time out
Slide 13
Slide 13 text
hi! Here's packet 1.
ok I’m bored. here’s an ack.
great! here’s the
second packet!!!
sweet! we’re done here.
Slide 14
Slide 14 text
Chapter 3
oints
[2015-05-12 23:05:47.9372] Caused by:
com.mongodb.MongoException: BSONObj
size: -286331154 (0xEEEEEEEE) is
invalid. Size must be between 0 and
16793600(16MB) First element: oints: ?
type=112
Slide 15
Slide 15 text
Buffers! fsync!
• `fsync` flushes all pending writes to the database
• and the optional `lock` parameter locks writes, so
nothing else comes in.