mirror of
https://github.com/ceph/ceph
synced 2024-12-13 23:17:07 +00:00
* ms_tcp_nodelay
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1278 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
c6a2e156b1
commit
786bf56c01
@ -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!
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user