return 0;
}
-static int create_fifo_fds(struct logger *server, int fifo_id, int *write_fd, int *read_fd)
+static int create_fifo_fds(struct logger *server, int fifo_id, int *write_fd, int *read_fd, bool dump)
{
assert(write_fd);
assert(read_fd);
goto finish;
}
+ /* Speed up dumping dlogutils by increasing their pipe size,
+ * as otherwise this pipe's size becomes a major bottleneck.
+ *
+ * Continuous connections don't really care if the initial
+ * burst of "historic" logs is slow and the following flow
+ * of logs is just fine with a small pipe. Meanwhile they
+ * live for a long time during which they would take away
+ * from the valuable total pipe size. */
+ if (dump)
+ fcntl(*write_fd, F_SETPIPE_SZ, 4*PIPE_REQUESTED_SIZE);
+
finish:
unlink(fifo_path);
return ret;
goto cleanup;
} else if (wr) {
int write_fd = -1, read_fd = -1;
- retval = create_fifo_fds(server, wr->fd_entity.fd, &write_fd, &read_fd);
+ retval = create_fifo_fds(server, wr->fd_entity.fd, &write_fd, &read_fd, reader->dumpcount);
if (retval < 0)
goto cleanup;