hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hive QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-21210) CombineHiveInputFormat Thread Pool Sizing
Date Wed, 06 Feb 2019 21:50:00 GMT

    [ https://issues.apache.org/jira/browse/HIVE-21210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16762172#comment-16762172
] 

Hive QA commented on HIVE-21210:
--------------------------------



Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12957816/HIVE-21210.6.patch

{color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 2 failed/errored test(s), 15773 tests executed
*Failed tests:*
{noformat}
org.apache.hadoop.hive.cli.TestEncryptedHDFSCliDriver.testCliDriver[encryption_insert_partition_static]
(batchId=185)
org.apache.hadoop.hive.llap.security.TestLlapSignerImpl.testSigning (batchId=336)
{noformat}

Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/15971/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/15971/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-15971/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.YetusPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 2 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12957816 - PreCommit-HIVE-Build

> CombineHiveInputFormat Thread Pool Sizing
> -----------------------------------------
>
>                 Key: HIVE-21210
>                 URL: https://issues.apache.org/jira/browse/HIVE-21210
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 4.0.0, 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Major
>         Attachments: HIVE-21210.1.patch, HIVE-21210.2.patch, HIVE-21210.3.patch, HIVE-21210.4.patch,
HIVE-21210.5.patch, HIVE-21210.6.patch
>
>
> Threadpools.
> Hive uses threadpools in several different places and each implementation is a little
different and requires different configurations. I think that Hive needs to reign in and standardize
the way that threadpools are used and threadpools should scale automatically without manual
configuration. At any given time, there are many hundreds of threads running in the HS2 as
the number of simultaneous connections increases and they surely cause contention with one-another.
> Here is an example:
> {code:java|title=CombineHiveInputFormat.java}
>   // max number of threads we can use to check non-combinable paths
>   private static final int MAX_CHECK_NONCOMBINABLE_THREAD_NUM = 50;
>   private static final int DEFAULT_NUM_PATH_PER_THREAD = 100;
> {code}
> When building the splits for a MR job, there are up to 50 threads running per query and
there is not much scaling here, it's simply 1 thread : 100 files ratio.  This implies that
to process 5000 files, there are 50 threads, after that, 50 threads are still used. Many Hive
jobs these days involve more than 5000 files so it's not scaling well on bigger sizes.
> This is not configurable (even manually), it doesn't change when the hardware specs increase,
and 50 threads seems like a lot when a service must support up to 80 connections:
> [https://www.cloudera.com/documentation/enterprise/5/latest/topics/admin_hive_tuning.html]
> Not to mention, I have never seen a scenario where HS2 is running on a host all by itself
and has the entire system dedicated to it. Therefore it should be more friendly and spin up
fewer threads.
> I am attaching a patch here that provides a few features:
>  * Common module that produces {{ExecutorService}} which caps the number of threads it
spins up at the number of processors a host has. Keep in mind that a class may submit as much
work units ({{Callables}} as they would like, but the number of threads in the pool is capped.
>  * Common module for partitioning work. That is, allow for a generic framework for dividing
work into partitions (i.e. batches)
>  * Modify {{CombineHiveInputFormat}} to take advantage of both modules, performing its
same duties in a more Java OO way that is currently implemented
>  * Add a partitioning (batching) implementation that enforces partitioning of a {{Collection}}
based on the natural log of the {{Collection}} size so that it scales more slowly than a simple
1:100 ratio.
>  * Simplify unit test code for {{CombineHiveInputFormat}}
> My hope is to introduce these tools to {{CombineHiveInputFormat}} and then to drop it
into other places.  One of the things I will introduce here is a "direct thread" {{ExecutorService}}
so that even if there is a configuration for a thread pool to be disabled, it will still use
an {{ExecutorService}} so that the project can avoid logic like "if this function is services
by a thread pool, use a {{ExecutorService}} (and remember to close it later!) otherwise, create
a single thread" so that things like [HIVE-16949] can be avoided in the future.  Everything
will just use an {{ExecutorService}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message