add inter_dc_tcp_nodelay option

patch by Marcus Eriksson; reviewed by jbellis for CASSANDRA-5148
This commit is contained in:
Jonathan Ellis 2013-01-11 16:12:25 -06:00
parent 8d9510ae40
commit 6487bc50bb
5 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,5 @@
1.2.1
* add inter_dc_tcp_nodelay setting (CASSANDRA-5148)
* re-allow wrapping ranges for start_token/end_token range pairing (CASSANDRA-5106)
* fix validation compaction of empty rows (CASSADRA-5136)
* nodetool methods to enable/disable hint storage/delivery (CASSANDRA-4750)

View File

@ -643,3 +643,9 @@ client_encryption_options:
# dc - traffic between different datacenters is compressed
# none - nothing is compressed.
internode_compression: all
# Enable or disable tcp_nodelay for inter-dc communication.
# Disabling it will result in larger (but fewer) network packets being sent,
# reducing overhead from the TCP protocol itself, at the cost of increasing
# latency if you block for cross-datacenter responses.
inter_dc_tcp_nodelay: true

View File

@ -162,6 +162,8 @@ public class Config
public String row_cache_provider = SerializingCacheProvider.class.getSimpleName();
public boolean populate_io_cache_on_flush = false;
public boolean inter_dc_tcp_nodelay = true;
private static boolean loadYaml = true;
private static boolean outboundBindAny = false;

View File

@ -1256,4 +1256,9 @@ public class DatabaseDescriptor
{
return conf.internode_compression;
}
public static boolean getInterDCTcpNoDelay()
{
return conf.inter_dc_tcp_nodelay;
}
}

View File

@ -263,7 +263,14 @@ public class OutboundTcpConnection extends Thread
{
socket = poolReference.newSocket();
socket.setKeepAlive(true);
socket.setTcpNoDelay(true);
if (isLocalDC(poolReference.endPoint()))
{
socket.setTcpNoDelay(true);
}
else
{
socket.setTcpNoDelay(DatabaseDescriptor.getInterDCTcpNoDelay());
}
out = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), 4096));
if (targetVersion >= MessagingService.VERSION_12)