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 D6B1D200C67 for ; Mon, 15 May 2017 19:44:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D53BD160BCE; Mon, 15 May 2017 17:44:09 +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 037AF160BA9 for ; Mon, 15 May 2017 19:44:08 +0200 (CEST) Received: (qmail 33786 invoked by uid 500); 15 May 2017 17:44:08 -0000 Mailing-List: contact commits-help@helix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@helix.apache.org Delivered-To: mailing list commits@helix.apache.org Received: (qmail 33738 invoked by uid 99); 15 May 2017 17:44:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2017 17:44:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id BC17AC05B0 for ; Mon, 15 May 2017 17:44:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id NO1tfP_zSAGW for ; Mon, 15 May 2017 17:44:06 +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 9C5675FB40 for ; Mon, 15 May 2017 17:44:05 +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 C3C2EE0BCD for ; Mon, 15 May 2017 17:44:04 +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 4EC6724350 for ; Mon, 15 May 2017 17:44:04 +0000 (UTC) Date: Mon, 15 May 2017 17:44:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@helix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HELIX-655) Helix per-participant concurrent task throttling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 15 May 2017 17:44:10 -0000 [ https://issues.apache.org/jira/browse/HELIX-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16010971#comment-16010971 ] ASF GitHub Bot commented on HELIX-655: -------------------------------------- Github user jiajunwang commented on a diff in the pull request: https://github.com/apache/helix/pull/89#discussion_r116555244 --- Diff: helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateOutput.java --- @@ -260,13 +260,72 @@ public Message getPendingState(String resourceName, Partition partition, String return partitionSet; } + /** + * Get the partitions count for each participant with the pending state and given resource state model + * @param resourceStateModel specified resource state model to look up + * @param state specified pending resource state to look up + * @return set of participants to partitions mapping + */ + public Map getPartitionCountWithPendingState(String resourceStateModel, String state) { + Map pendingPartitionCount = new HashMap(); + for (String resource : _pendingStateMap.keySet()) { + String stateModel = _resourceStateModelMap.get(resource); + if (stateModel != null && stateModel.equals(resourceStateModel) --- End diff -- I don't think most of us need to google to know that... But I agree that it could be safer to add parentheses, just to make it safer. Thanks. > Helix per-participant concurrent task throttling > ------------------------------------------------ > > Key: HELIX-655 > URL: https://issues.apache.org/jira/browse/HELIX-655 > Project: Apache Helix > Issue Type: New Feature > Components: helix-core > Affects Versions: 0.6.x > Reporter: Jiajun Wang > Assignee: Junkai Xue > > h1. Overview > Currently, all runnable jobs/tasks in Helix are equally treated. They are all scheduled according to the rebalancer algorithm. Means, their assignment might be different, but they will all be in RUNNING state. > This may cause an issue if there are too many concurrently runnable jobs. When Helix controller starts all these jobs, the instances may be overload as they are assigning resources and executing all the tasks. As a result, the jobs won't be able to finish in a reasonable time window. > The issue is even more critical to long run jobs. According to our meeting with Gobblin team, when a job is scheduled, they allocate resource for the job. So in the situation described above, more and more resources will be reserved for the pending jobs. The cluster will soon be exhausted. > For solving the problem, an application needs to schedule jobs in a relatively low frequency (what Gobblin is doing now). This may cause low utilization. > A better way to fix this issue, at framework level, is throttling jobs/tasks that are running concurrently, and allowing setting priority for different jobs to control total execute time. > So given same amount of jobs, the cluster is in a better condition. As a result, jobs running in that cluster have a more controllable execute time. > Existing related control mechanisms are: > * ConcurrentTasksPerInstance for each job > * ParallelJobs for each workflow > * Threadpool limitation on the participant if user customizes TaskStateModelFactory. > But none of them can directly help when concurrent workflows or jobs number is large. If an application keeps scheduling jobs/jobQueues, Helix will start any runnable jobs without considering the workload on the participants. > The application may be able to carefully configures these items to achieve the goal. But they won't be able to easily find the sweet spot. Especially the cluster might be changing (scale out etc.). > h2. Problem summary > # All runnable tasks will start executing, which may overload the participant. > # Application needs a mechanism to prioritize important jobs (or workflows). Otherwise, important tasks may be blocked by other less important ones. And allocated resource is wasted. > h2. Feature proposed > Based on our discussing, we proposed 2 features that can help to resolve the issue. > # Running task throttling on each participant. This is for avoiding overload. > # Job priority control that ensures high priority jobs are scheduled earlier. > In addition, application can leverage workflow/job monitor items as feedback from Helix to adjust their stretgy. -- This message was sent by Atlassian JIRA (v6.3.15#6346)