tomcat7调优之Executor

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>

 

The default implementation supports the following attributes:

Attribute Description
threadPriority

(int) The thread priority for threads in the executor, the default is Thread.NORM_PRIORITY  线程优先级(默认优先级)

daemon

(boolean) Whether the threads should be daemon threads or not, the default is true(是否以后台进程方式运行,默认是)

namePrefix

(String) The name prefix for each thread created by the executor. The thread name for an individual thread will be namePrefix+threadNumber(由线程前缀+线程数)

maxThreads

(int) The max number of active threads in this pool, default is 200

最大线程数(默认200)

 

[root@M600-52 ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16384
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
max user processes (-u) 16384:最大进程数
cat /proc/sys/kernel/threads-max: 最大线程数

minSpareThreads

(int) The minimum number of threads always kept alive, default is 25

最小空闲时,还要保存的线程数。默认25

maxIdleTime

(int) The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads. Default value is 60000 (1 minute)   最大空闲时间 默认60000(1分钟)

maxQueueSize

(int) The maximum number of runnable tasks that can queue up awaiting execution before we reject them. Default value is Integer.MAX_VALUE

在拒绝之前,会保存到队列当中,等待处理。  队列的最大长度为Integer.MAX_VALUE

 

prestartminSpareThreads

(boolean) Whether minSpareThreads should be started when starting the Executor or not, the default is false  Executor刚启动时,是否就开启最小的线程数

threadRenewalDelay

After a context is stopped, threads in the pool are renewed. To avoid renewing all threads at the same time, this delay is observed between 2 threads being renewed. Value is in ms, default value is 1000ms. If negative, threads are not renewed.  当线程停止后,如果有需要,会进行重建,为了避免多个线程,该设置可以检测是否有2个线程同时被创建,如果是,则会按照该参数,延迟指定时间创建。 如果拒绝,则线程不会被重建。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值