Skip to content

Commit 43647ed

Browse files
committed
Increase buffer size
1 parent 6b518db commit 43647ed

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dtmd/include/limits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define MAX_TRANSACTIONS 4096
55

6-
#define BUFFER_SIZE (64 * 1024)
6+
#define BUFFER_SIZE (256 * 1024)
77
#define LISTEN_QUEUE_SIZE 100
88
#define MAX_STREAMS 4096
99

dtmd/src/server.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ bool server_start(server_t server) {
128128
return true;
129129
}
130130

131+
long sent_messages;
132+
long sent_bytes;
133+
131134
static bool stream_flush(stream_t stream) {
132135
int tosend = stream->output.ready;
133136
if (tosend == 0) {
@@ -138,12 +141,14 @@ static bool stream_flush(stream_t stream) {
138141
char *cursor = stream->output.data;
139142
while (tosend > 0) {
140143
// repeat sending until we send everything
141-
int sent = send(stream->fd, cursor, tosend, 0);
144+
int sent = send(stream->fd, cursor, tosend, 0);
142145
if (sent == -1) {
143146
shout("failed to flush the stream\n");
144147
stream->good = false;
145148
return false;
146149
}
150+
sent_messages += 1;
151+
sent_bytes += sent;
147152
cursor += sent;
148153
tosend -= sent;
149154
assert(tosend >= 0);

0 commit comments

Comments
 (0)