brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [5/7] incubator-brooklyn git commit: Riak Linux - sysctl optimizations
Date Tue, 17 Mar 2015 19:44:48 GMT
Riak Linux - sysctl optimizations


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/66bdefb0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/66bdefb0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/66bdefb0

Branch: refs/heads/master
Commit: 66bdefb0432be09f67013a7688411cd03c5d088a
Parents: 6b0af95
Author: Valentin Aitken <bostko@gmail.com>
Authored: Tue Mar 17 18:05:11 2015 +0200
Committer: Valentin Aitken <bostko@gmail.com>
Committed: Tue Mar 17 18:12:06 2015 +0200

----------------------------------------------------------------------
 .../entity/nosql/riak/RiakNodeSshDriver.java    | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/66bdefb0/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
index f1d2465..00e304f 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
@@ -26,7 +26,6 @@ import java.util.Map;
 
 import brooklyn.util.ssh.BashCommands;
 import brooklyn.util.task.ssh.SshTasks;
-import com.google.api.client.util.Joiner;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,6 +42,7 @@ import brooklyn.util.os.Os;
 import brooklyn.util.task.DynamicTasks;
 import brooklyn.util.text.Strings;
 
+import com.google.common.base.Joiner;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -253,6 +253,25 @@ public class RiakNodeSshDriver extends AbstractSoftwareProcessSshDriver
implemen
             commands.add(sudo("chown -R riak:riak " + getRiakEtcDir()));
         }
 
+        if(osDetails.isLinux()) {
+            ImmutableMap<String, String> sysctl = ImmutableMap.<String, String>builder()
+                    .put("vm.swappiness", "0")
+                    .put("net.core.somaxconn", "40000")
+                    .put("net.ipv4.tcp_max_syn_backlog", "40000")
+                    .put("net.ipv4.tcp_sack",  "1")
+                    .put("net.ipv4.tcp_window_scaling",  "15")
+                    .put("net.ipv4.tcp_fin_timeout",     "1")
+                    .put("net.ipv4.tcp_keepalive_intvl", "30")
+                    .put("net.ipv4.tcp_tw_reuse",        "1")
+                    .put("net.ipv4.tcp_moderate_rcvbuf", "1")
+                    .build();
+
+            // TODO platform_*_dir
+            // TODO riak config log
+
+            commands.add( sudo("sysctl " + Joiner.on(' ').withKeyValueSeparator("=").join(sysctl)));
+        }
+
         ScriptHelper customizeScript = newScript(CUSTOMIZING)
                 .failOnNonZeroResultCode()
                 .body.append(commands);


Mime
View raw message