(十二)Nepxion-Thunder分散RPC集積フレームワーク-構成チューニング


詳細
Nepxion-Thunder(QQ群471164539)は、https://github.com/Nepxion/
 
1.ローカル構成
ローカル構成が開始された場合、XMLでconfig=「local」を構成する必要があります.

 
ビジネスエンジニアリングを新規作成する場合は、関連パスの下にthunder-ext.propertiesを新規作成します.設定値の優先順位はthunder-ext.properties->thunderです.properties(thunder.jar).コンフィギュレーション名が同じ場合は、優先度の高い値をとります.これは統合型の構成であり、通信ミドルウェアに対して、どれを適用すればどれを構成するか、内容は以下の通りである.
#      hessian ,   Hessian Servlet Web module  
# Web module path, if that is provided as a web service
path = /thunder

#    XML   ,             
# Spring XML    async,          
# Method invoke with async false, that is a default value
async = false

#    XML   ,             
# Spring XML    broadcast,           
# Method invoke with broadcast false, that is a default value
broadcast = false

#    XML   ,               
# Spring XML         timeout,          30 ,    30 ,       ,       
# Sync method timeout, that is a default value
syncTimeout = 30 * 1000

#    XML   ,               
# Spring XML         timeout,          60 ,    5  ,         ,       ,     
# Async method timeout, aysnc cache will be remove when timeout, that is a default value
asyncTimeout = 5 * 60 * 1000

#                 ,  10     ,     XML   
# Async method scan interval, thread will start to clear timeout cache every scan interval
asyncScan = 10 * 1000

#       ,          CPU   ,          
#     ,2KB-20KB    ,      ,   TPS    20%-30%;         CPU  
#     Netty  ,       JdkZlib     ,      
# Compress transport data, maybe it works well for 2KB-20KB
compress = false

#      (         ) ,     ,Thunder         ,        。             ,              。  
#     ,   Netty Hessian。MQ           ,            ,           。  
# Load Balance Configuration (used for Netty and Hessian)
#       ,  true,        ,           ;  false,       
loadBalanceRetry = true
#     
loadBalanceRetryTimes = 10000
#          
loadBalanceRetryDelay = 5 * 1000

#               
# If event notification is true, all produce and consume failure will be thrown out via an async event, so that will make the invocation do a retry 
eventNotification = true

#      ,         
# If event notification and smtp mail notification are all true, all produce and consume failure will be sent as a mail
#       
smtpNotification = false

#            (                   ),   ,          
# Load balance log will help to indicate which server will be selected (used for Netty and Hessian)
loadBalanceLogPrint = true

#          (                  ,        )
# Transport log will help to indicate the transport information
transportLogPrint = true

#          (         Netty         ),   ,          
# Heart beat log will help to indicate the data channel is alive or not (used for Netty)
heartBeatLogPrint = true

#                         (                ,           )
# Serializer log will help to indicate the byte array length
serializerLogPrint = false

#         ,    ,                ,     
# Failure Notification exclusion, use "," to separate
smtpNotificationExclusion = com.nepxion.thunder.security.SecurityException
#    Ssl  
smtpSsl = true
#         
smtpHost = smtp.qq.com
#       
smtpUser = *******@qq.com
#         
smtpPassword = 
#          
smtpMailFrom = *******@qq.com
#           ,     
smtpMailTo = *******@qq.com,*******@qq.com
#          ,     
smtpMailCC = 
#          ,     
smtpMailBCC = 

#      
# Thread Pool Configuration
#     ,    true,            
# Multi thread pool
threadPoolMultiMode = false
# CPU unit
threadPoolServerCorePoolSize = 4
# CPU unit
threadPoolServerMaximumPoolSize = 8
threadPoolServerKeepAliveTime = 15 * 60 * 1000
threadPoolServerAllowCoreThreadTimeout = false
# CPU unit
threadPoolClientCorePoolSize = 4
# CPU unit
threadPoolClientMaximumPoolSize = 8
threadPoolClientKeepAliveTime = 15 * 60 * 1000
threadPoolClientAllowCoreThreadTimeout = false
# LinkedBlockingQueue, ArrayBlockingQueue, SynchronousQueue
threadPoolQueue = LinkedBlockingQueue
# CPU unit (Used for LinkedBlockingQueue or ArrayBlockingQueue)
threadPoolQueueCapacity = 1024
# BlockingPolicyWithReport, CallerRunsPolicyWithReport, AbortPolicyWithReport, RejectedPolicyWithReport, DiscardedPolicyWithReport
# BlockingPolicyWithReport :            ,     ,      ,         BlockingQueue.put         
# CallerRunsPolicyWithReport :  Caller-Runs(     )    ,     ,      ,                                
# AbortPolicyWithReport :     ,     ,    
# RejectedPolicyWithReport :        RejectedRunnable  ,                ,   FIFO               ,      
# DiscardedPolicyWithReport :      FIFO               ,      
threadPoolRejectedPolicy = BlockingPolicyWithReport

#    ,     FST         
# FST Object Pool Configuration
# CPU unit
fstObjectPoolMaxTotal = 64
# CPU unit
fstObjectPoolMaxIdle = 32
# CPU unit
fstObjectPoolMinIdle = 16
fstObjectPoolMaxWaitMillis = 3000
fstObjectPoolTimeBetweenEvictionRunsMillis = 1000 * 60 * 15
fstObjectPoolMinEvictableIdleTimeMillis = 1000 * 60 * 30
fstObjectPoolSoftMinEvictableIdleTimeMillis = 1000 * 60 * 30
fstObjectPoolBlockWhenExhausted = true
fstObjectPoolLifo = true
fstObjectPoolFairness = false

# Netty    
# Netty Configuration
nettySoBacklog = 128
nettySoSendBuffer = 64 * 1024
nettySoReceiveBuffer = 64 * 1024
nettyWriteBufferHighWaterMark = 32 * 1024
nettyWriteBufferLowWaterMark = 8 * 1024
nettyMaxMessageSize = 1 * 1024 * 1024
nettyWriteIdleTime = 90 * 1000
nettyReadIdleTime = 60 * 1000
nettyAllIdleTime = 45 * 1000
nettyWriteTimeout = 5 * 1000
nettyReadTimeout = 5 * 1000
nettyConnectTimeout = 10 * 1000
nettyReconnectDelay = 1000

# Hessian    
# Hessian Configuration
hessianReadTimeout = 30 * 1000
hessianConnectTimeout = 10 * 1000

# Redis    
# Redis Configuration
# CPU unit
redisObjectPoolMaxTotal = 30
# CPU unit
redisObjectPoolMaxIdle = 10
# CPU unit
redisObjectPoolMinIdle = 10
redisObjectPoolMaxWaitMillis = 1000 * 3
redisObjectPoolTimeBetweenEvictionRunsMillis = 1000 * 30
redisObjectPoolMinEvictableIdleTimeMillis = 1000 * 60
redisObjectPoolSoftMinEvictableIdleTimeMillis = 1000 * 60
redisObjectPoolBlockWhenExhausted = true
redisObjectPoolLifo = true
redisObjectPoolFairness = false
redisSoTimeout = 5 * 1000
redisConnectionTimeout = 5 * 1000
redisDataExpiration = 15 * 24 * 60 * 1000
# Setinel parameters
redisReconnectionWait = 5
redisDatabase = 0
# Cluster parameters
redisMaxRedirections = 5

# Splunk  
# Splunk Configuration
splunkMaximumTime = 60

#         
# Kafka Configuration
kafka.producer.acks = all
kafka.producer.linger.ms = 0
kafka.producer.retries = 0
kafka.producer.buffer.memory = 33554432
kafka.producer.send.buffer.bytes = 131072
kafka.producer.receive.buffer.bytes = 32768
kafka.producer.max.request.size = 1048576
kafka.producer.batch.size = 16384
kafka.producer.timeout.ms = 30000
kafka.producer.request.timeout.ms = 30000
kafka.producer.connections.max.idle.ms = 540000
kafka.producer.reconnect.backoff.ms = 50
kafka.producer.retry.backoff.ms = 100
kafka.producer.max.block.ms = 60000
kafka.producer.max.in.flight.requests.per.connection = 5
kafka.producer.metadata.max.age.ms = 300000
kafka.producer.metadata.fetch.timeout.ms = 60000

kafka.consumer.server.poll.timeout.ms = 1000
kafka.consumer.client.poll.timeout.ms = 1000
kafka.consumer.enable.auto.commit = true
kafka.consumer.auto.offset.reset = latest
kafka.consumer.send.buffer.bytes = 131072
kafka.consumer.receive.buffer.bytes = 32768
kafka.consumer.max.partition.fetch.bytes = 1048576
kafka.consumer.fetch.min.bytes = 1024
kafka.consumer.fetch.max.wait.ms = 500
kafka.consumer.auto.commit.interval.ms = 10000
kafka.consumer.heartbeat.interval.ms = 3000
kafka.consumer.session.timeout.ms = 30000
kafka.consumer.request.timeout.ms = 40000
kafka.consumer.connections.max.idle.ms = 540000
kafka.consumer.reconnect.backoff.ms = 50
kafka.consumer.retry.backoff.ms = 100
kafka.consumer.metadata.max.age.ms = 300000

# MQ Common Configuration (used for ActiveMQ and Tibco)
mqRetryNotificationDelay = 5 * 1000
mqReconnectOnException = true

# CacheConnectionFactory Configuration (used for ActiveMQ and Tibco)
mqSessionCacheSize = 20
mqCacheConsumers = true
mqCacheProducers = true

# PoolConnectionFactory Configuration (used for ActiveMQ and Tibco)
mqMaxConnections = 20
mqMaximumActiveSessionPerConnection = 100
mqIdleTimeout = 30 * 1000
mqExpiryTimeout = 0
mqBlockIfSessionPoolIsFull = true
mqBlockIfSessionPoolIsFullTimeout = -1
mqTimeBetweenExpirationCheckMillis = -1
mqCreateConnectionOnStartup = true

# DefaultMessageListenerContainer Configuration (used for ActiveMQ and Tibco)
mqConcurrentConsumers = 10
mqMaxConcurrentConsumers = 1
mqReceiveTimeout = 1000
mqRecoveryInterval = 5000
mqIdleConsumerLimit = 1
mqIdleTaskExecutionLimit = 1
mqCacheLevel = 4
mqAcceptMessagesWhileStopping = false

# Apache HttpComponent  ,      ,           ,      
# Apache Configuration
apacheBacklogSize = 128
apacheSendBufferSize = 64 * 1024
apacheReceiveBufferSize = 64 * 1024
apacheSoTimeout = 5 * 1000
apacheConnectTimeout = 5 * 1000
# CPU unit
apacheMaxTotal = 32

# Zookeeper  
# Zookeeper Configuration
zookeeperSessionTimeout = 15 * 1000
zookeeperConnectTimeout = 15 * 1000
zookeeperConnectWaitTime = 1000


# Zookeeper     ,     Spring XML 
# Zookeeper Connection Configuration
zookeeperAddress = localhost:2181

# Redis       ,  Netty Hessian   /    ,       
# Redis Sentinel Connection Configuration
redisSentinel = 192.168.126.151:16379;192.168.126.151:26379;192.168.126.151:36379
redisMasterName = mymaster
redisClientName =  
redisPassword = 

# Redis       ,       ,              ,       
# Redis Cluster Connection Configuration
# redisCluster = 192.168.126.131:7001;192.168.126.131:7002;192.168.126.131:7003;192.168.126.131:7004;192.168.126.131:7005;192.168.126.131:7006

# Splunk       
# Splunk Connection Configuration
splunkHost = localhost
splunkPort = 8089
splunkUserName = admin
splunkPassword = admin

# Kafka     
# Kafka Connection Configuration
kafka-1.kafka.producer.bootstrap.servers = localhost:9092
kafka-1.kafka.consumer.bootstrap.servers = localhost:9092

# ActiveMQ     
# ActiveMQ Connection Configuration
activeMQ-1.mqUrl = failover://(tcp://localhost:61616)?initialReconnectDelay=1000&jms.prefetchPolicy.all=5
# activeMQ-1.mqUrl = failover://(tcp://broker1:61616,tcp://broker2:61616)?randomize=true
# SingleConnectionFactory, CachingConnectionFactory, PooledConnectionFactory
activeMQ-1.mqConnectionFactoryType = CachingConnectionFactory
activeMQ-1.mqUserName = admin
activeMQ-1.mqPassword = admin
# activeMQ-1.mqJndiName = ConnectionFactory

# Tibco     
# Tibco Connection Configuration
tibco-1.mqUrl = tcp://localhost:7222
# SingleConnectionFactory, CachingConnectionFactory, PooledConnectionFactory
tibco-1.mqConnectionFactoryType = CachingConnectionFactory
tibco-1.mqUserName = admin
tibco-1.mqPassword =
tibco-1.mqJndiName = seashellConnectionFactory

tibco-2.mqUrl = tcp://localhost:7222
# SingleConnectionFactory, CachingConnectionFactory, PooledConnectionFactory
tibco-2.mqConnectionFactoryType = CachingConnectionFactory
tibco-2.mqUserName = admin
tibco-2.mqPassword =
tibco-2.mqJndiName = FTQueueConnectionFactory

 2. リモート構成
ローカル構成が開始された場合は、XMLでconfig=「remote」を構成する必要があります.

設定値の優先順位は、リモート構成->thunder-ext.properties->thunderです.properties(thunder.jar).
リモート構成の方法については、(9)Thunder分散RPCフレームワーク-ガバナンスセンターを参照してください.