* ms_tcp_nodelay

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1278 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
sageweil 2007-03-21 21:20:47 +00:00
parent c6a2e156b1
commit 786bf56c01
3 changed files with 13 additions and 1 deletions

View File

@ -118,6 +118,7 @@ md_config_t g_conf = {
ms_overlay_clients: false,
ms_die_on_failure: false,
ms_tcp_nodelay: true,
/*tcp_skip_rank0: false,
tcp_overlay_clients: false, // over osds!

View File

@ -105,6 +105,7 @@ struct md_config_t {
bool ms_skip_rank0;
bool ms_overlay_clients;
bool ms_die_on_failure;
bool ms_tcp_nodelay;
// mon
int mon_tick_interval;

View File

@ -18,6 +18,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#include "config.h"
@ -413,6 +415,14 @@ void Rank::Pipe::writer()
}
}
// disable Nagle algorithm
if (g_conf.ms_tcp_nodelay) {
int flag = 1;
int r = ::setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(flag));
if (r < 0)
dout(0) << "pipe(" << peer_addr << ' ' << this << ").writer couldn't set TCP_NODELAY: " << strerror(errno) << endl;
}
// loop.
lock.Lock();
while (!q.empty() || !done) {
@ -621,7 +631,7 @@ int Rank::Pipe::write_message(Message *m)
}
#else
if (0) {
if (1) {
// one big chunk
env->nchunks = -blist.length();