Review Board 1.7.22


Better thread management for HiveServer2 async threads

Review Request #14719 - Created Oct. 17, 2013 and updated

Vaibhav Gumashta
trunk
HIVE-5229
Reviewers
hive
thejas
hive-git
Improves the current strategy by not keeping all the async threads alive when there are no corresponding requests. The async threads terminate after a configurable keepalive time if there are no new requests to handle.
TestEmbeddedThriftBinaryCLIService, TestThriftBinaryCLIService, TestJdbcDriver2
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
Revision fb3570b New Change
[20] 754 lines
[+20] [+] public class HiveConf extends Configuration {
755
    HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS("hive.server2.thrift.min.worker.threads", 5),
755
    HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS("hive.server2.thrift.min.worker.threads", 5),
756
    HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS("hive.server2.thrift.max.worker.threads", 500),
756
    HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS("hive.server2.thrift.max.worker.threads", 500),
757

    
   
757

   
758
    // Configuration for async thread pool in SessionManager
758
    // Configuration for async thread pool in SessionManager
759
    // Number of async threads
759
    // Number of async threads
760
    HIVE_SERVER2_ASYNC_EXEC_THREADS("hive.server2.async.exec.threads", 50),
760
    HIVE_SERVER2_ASYNC_EXEC_THREADS("hive.server2.async.exec.threads", 100),
761
    // Number of seconds HiveServer2 shutdown will wait for async threads to terminate
761
    // Number of seconds HiveServer2 shutdown will wait for async threads to terminate
762
    HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT("hive.server2.async.exec.shutdown.timeout", 10),
762
    HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT("hive.server2.async.exec.shutdown.timeout", 10),

    
   
763
    // Size of the wait queue for async thread pool in HiveServer2.

    
   
764
    // After hitting this limit, the async thread pool will reject new requests.

    
   
765
    HIVE_SERVER2_ASYNC_EXEC_WAIT_QUEUE_SIZE("hive.server2.async.exec.wait.queue.size", 100),

    
   
766
    // Number of seconds that an idle HiveServer2 async thread (from the thread pool)

    
   
767
    // will wait for a new task to arrive before terminating

    
   
768
    HIVE_SERVER2_ASYNC_EXEC_KEEPALIVE_TIME("hive.server2.async.exec.keepalive.time", 10),
763

    
   
769

   
764

    
   
770

   
765
    // HiveServer2 auth configuration
771
    // HiveServer2 auth configuration
766
    HIVE_SERVER2_AUTHENTICATION("hive.server2.authentication", "NONE"),
772
    HIVE_SERVER2_AUTHENTICATION("hive.server2.authentication", "NONE"),
767
    HIVE_SERVER2_KERBEROS_KEYTAB("hive.server2.authentication.kerberos.keytab", ""),
773
    HIVE_SERVER2_KERBEROS_KEYTAB("hive.server2.authentication.kerberos.keytab", ""),
[+20] [20] 525 lines
conf/hive-default.xml.template
Revision b7234b4 New Change
 
service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
Revision f6adf92 New Change
 
service/src/java/org/apache/hive/service/cli/session/SessionManager.java
Revision f392d62 New Change
 
  1. common/src/java/org/apache/hadoop/hive/conf/HiveConf.java: Loading...
  2. conf/hive-default.xml.template: Loading...
  3. service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java: Loading...
  4. service/src/java/org/apache/hive/service/cli/session/SessionManager.java: Loading...