Skip to content

Commit

Permalink
[tx] increase timeres on TX pressure and reduce log noise
Browse files Browse the repository at this point in the history
when TX sockets are overloaded, we spend more time spitting out
logs than recovering from the overload. ifdef the logging on
critical path out (still available with debug build).

also drastically reduce the waiting time by 64x.

this changes increases UDP perf on 3 nodes by 200%

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Feb 13, 2017
1 parent 0a3f48a commit 74c94be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libknet/threads_tx.c
Expand Up @@ -74,12 +74,14 @@ static int _dispatch_to_links(knet_handle_t knet_h, struct knet_host *dst_host,
} else {
progress = 0;
}
#ifdef DEBUG
log_debug(knet_h, KNET_SUB_TX, "Unable to send all (%d/%d) data packets to host %s (%u) link %s:%s (%u)",
sent_msgs, msg_idx,
dst_host->name, dst_host->host_id,
dst_host->link[dst_host->active_links[link_idx]].status.dst_ipaddr,
dst_host->link[dst_host->active_links[link_idx]].status.dst_port,
dst_host->link[dst_host->active_links[link_idx]].link_id);
#endif
goto retry;
}
if (!progress) {
Expand Down
4 changes: 3 additions & 1 deletion libknet/transport_sctp.c
Expand Up @@ -306,8 +306,10 @@ static int sctp_transport_tx_sock_error(knet_handle_t knet_h, int sockfd, int re
break;
}
if (recv_errno == EAGAIN) {
#ifdef DEBUG
log_debug(knet_h, KNET_SUB_TRANSP_SCTP, "Sock: %d is overloaded. Slowing TX down", sockfd);
usleep(KNET_THREADS_TIMERES * 4);
#endif
usleep(KNET_THREADS_TIMERES / 16);
return 1;
}
return -1;
Expand Down
4 changes: 3 additions & 1 deletion libknet/transport_udp.c
Expand Up @@ -356,8 +356,10 @@ static int udp_transport_tx_sock_error(knet_handle_t knet_h, int sockfd, int rec
{
if (recv_err < 0) {
if ((recv_errno == ENOBUFS) || (recv_errno == EAGAIN)) {
#ifdef DEBUG
log_debug(knet_h, KNET_SUB_TRANSP_UDP, "Sock: %d is overloaded. Slowing TX down", sockfd);
usleep(KNET_THREADS_TIMERES * 4);
#endif
usleep(KNET_THREADS_TIMERES / 16);
return 1;
}
read_errs_from_sock(knet_h, sockfd);
Expand Down

0 comments on commit 74c94be

Please sign in to comment.