Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 989B0200C5F for ; Sun, 9 Apr 2017 00:25:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8CACA160B96; Sat, 8 Apr 2017 22:25:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D35B0160B93 for ; Sun, 9 Apr 2017 00:25:46 +0200 (CEST) Received: (qmail 14057 invoked by uid 500); 8 Apr 2017 22:25:45 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 14046 invoked by uid 99); 8 Apr 2017 22:25:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Apr 2017 22:25:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7DD01C1517 for ; Sat, 8 Apr 2017 22:25:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BBtoc2YFc4Dp for ; Sat, 8 Apr 2017 22:25:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C745B5FB40 for ; Sat, 8 Apr 2017 22:25:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E4140E0629 for ; Sat, 8 Apr 2017 22:25:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5954B24066 for ; Sat, 8 Apr 2017 22:25:42 +0000 (UTC) Date: Sat, 8 Apr 2017 22:25:42 +0000 (UTC) From: "Michael Han (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2748) Four-letter command to voluntarily drop client connections MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 08 Apr 2017 22:25:47 -0000 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15961969#comment-15961969 ] Michael Han commented on ZOOKEEPER-2748: ---------------------------------------- Four letter words will be deprecated in future so we currently are reluctant to accept proposals of new features related to four letter words. If you'd like to teach server to drop connections, the ZooKeeperAdmin class introduced in 3.5.3 would be a good place for such extension. At a broader scope, it would be good to address ZOOKEEPER-571 which will implicitly fix this issue as well. That JIRA might be a better place for the efforts on load balancing loads between servers in an ensemble to go. > Four-letter command to voluntarily drop client connections > ---------------------------------------------------------- > > Key: ZOOKEEPER-2748 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2748 > Project: ZooKeeper > Issue Type: New Feature > Components: server > Reporter: Marco P. > Assignee: Marco P. > Priority: Minor > > In certain circumstances, it would be useful to be able to move clients from one server to another. > One example: a quorum that consists of 3 servers (A,B,C) with 1000 active client session, where 900 clients are connected to server A, and the remaining 100 are split over B and C (see example below for an example of how this can happen). > A will do a lot more work than B, C. > Overall throughput will benefit by having the clients more evenly divided. > In case of A failure, all its client will create an avalanche by migrating en masse to a different server. > There are other possible use cases for a mechanism to move clients: > - Migrate away all clients before a server restart > - Migrate away part of clients in response to runtime metrics (CPU/Memory usage, ...) > - Shuffle clients after adding more server capacity (i.e. adding Observer nodes) > The simplest form of rebalancing which does not require major changes of protocol or client code consists of requesting a server to voluntarily drop some number of connections. > Clients should be able to transparently move to a different server. > Patch introducing 4-letter commands to shed clients: > https://github.com/apache/zookeeper/pull/215 > -- -- -- > How client imbalance happens in the first place, an example. > Imagine servers A, B, C and 1000 clients connected. > Initially clients are spread evenly (i.e. 333 clients per server). > A: 333 (restarts: 0) > B: 333 (restarts: 0) > C: 334 (restarts: 0) > Now restart servers a few times, always in A, B, C order (e.g. to pick up a software upgrades or configuration changes). > Restart A: > A: 0 (restarts: 1) > B: 499 (restarts: 0) > C: 500 (restarts: 0) > Restart B: > A: 250 (restarts: 1) > B: 0 (restarts: 1) > C: 750 (restarts: 0) > Restart C: > A: 625 (restarts: 1) > B: 375 (restarts: 1) > C: 0 (restarts: 1) > The imbalance is pretty bad already. C is idle while A has a lot of work. > A second round of restarts makes the situation even worse: > Restart A: > A: 0 (restarts: 2) > B: 688 (restarts: 1) > C: 313 (restarts: 1) > Restart B: > A: 344 (restarts: 2) > B: 657 (restarts: 1) > C: 0 (restarts: 1) > Restart C: > A: 673 (restarts: 2) > B: 328 (restarts: 1) > C: 0 (restarts: 1) > Large cluster (5, 7, 9 servers) make the imbalance even more evident. -- This message was sent by Atlassian JIRA (v6.3.15#6346)