<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个线程同时被创建,如果是,则会按照该参数,延迟指定时间创建。 如果拒绝,则线程不会被重建。
|
分享到:
相关推荐
用户应用new SparkContext后,集群就会为在Worker上分配executor,但是增加executor的时候需要考虑好内存消耗,因为一台机器的内存分配给越多的executor,每个executor的内存就越小,以致出现过多的数据spill over...
hadoop自带的Container-executor在配置yarn-kerberos时存在问题,以及在配置cgroup时需要把container-executor.cfg的上级目录拥有者均改为root,带来不便。 所以需要重新编译Container-executor,这边提供重新编译好...
Executor框架主要由3部分组成: 任务 。包括被执行任务需要实现的接口:Runnable接口或者Callable接口。 任务的执行 。包括任务执行机制的核心接口Executor,以及继承自Executor的ExecutorService接口。...
并发编程之Executor线程池原理与源码解读.pdf
APACHE 2.2.9+TOMCAT6.0.18配置负载均衡 目标: 使用 apache 和 tomcat 配置一个可以应用的 web 网站,要达到以下要求: 1、 Apache 做为 HttpServer ,后面连接多个 tomcat 应用实例,并进行负载均衡。 2、 为系统...
hadoop自带的Container-executor在配置yarn-kerberos时存在问题,这边给出编译后的Container-executor,默认加载配置文件路径/etc/container-executor.cfg,大家不用再重新编译了
FANUC C Language Executor
mybatis中的sqlsession--executor实现 mybatis中的sqlsession--executor实现
高效率 快捷操作
基于Android开发的Executor线程池示例
一、为什么要引入Executor框架? 1、如果使用new Thread(…).start()的方法处理多线程,有如下缺点: ① 开销大。对于JVM来说,每次新建线程和销毁线程都会有很大的开销。 ② 线程缺乏管理。没有一个池来限制线程的...
该文档详细记录了Executor框架结构、使用示意图、ThreadPoolExecutor使用示例、线程池原理分析、几种常见线程池(FixedThreadPool、SingleThreadExecutor、CachedThreadPool)的详解以及线程池大小确定等内容
非常好的Java并发框架Executor图例,结构清晰,继承关系清楚。
executor 查找工具,方便查找应用软件,可以自定义文件快捷键。
executor快速启动工具,超炫,实用
要考虑:磁盘io、带宽、内存、cpu、以及内核配置中的tcp各种状态,甚至是各种打开文件限制;修改Tomcat Connector运行模式为APR;把Executor 打开,设置Executor 和Connector;reloadable设为false;
xxl-job-executor-go-master
NULL 博文链接:https://jsx112.iteye.com/blog/865884
Macintosh OS 模拟程序
4.newSingleThreadExecutor 创建一个使用单个 worker 线程的 Executor,以无界队列方式来运行该线程。它只会用唯一的工作线程来执行任务,保证所有任务按照指定顺序(FIFO, LIFO, 优先级)执行。``