java 设置线程大小_java – 设置线程池的理想大小

参见英文答案 >

Performance Issues with newFixedThreadPool vs newSingleThreadExecutor1

有什么区别 –

newSingleThreadExecutor vs newFixedThreadPool(20)

在操作系统和编程方面的观点.

每当我使用newSingleThreadExecutor运行我的程序,我的程序工作得很好,端到端延迟(第95百分位数)约5ms.

但是一旦我开始运行我的程序,

的newFixedThreadPool(20)

我的程序性能下降,我开始看到端到端的延迟为37ms.

那么现在我正在从架构的角度来理解这个线程是什么意思呢?并且如何决定什么是我应该选择的最佳线程数量?

如果我使用更多的线程,那会发生什么?

如果有人可以用外行语言向我解释这些简单的事情,那对我来说是非常有用的.谢谢您的帮助.

我的机器配置规范 – 我从Linux机器运行我的程序 –

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 45

model name : Intel(R) Xeon(R) cpu E5-2670 0 @ 2.60GHz

stepping : 7

cpu MHz : 2599.999

cache size : 20480 KB

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm arat pln pts

bogomips : 5199.99

clflush size : 64

cache_alignment : 64

address sizes : 40 bits physical,48 bits virtual

power management:

processor : 1

vendor_id : GenuineIntel

cpu family : 6

model : 45

model name : Intel(R) Xeon(R) cpu E5-2670 0 @ 2.60GHz

stepping : 7

cpu MHz : 2599.999

cache size : 20480 KB

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm arat pln pts

bogomips : 5199.99

clflush size : 64

cache_alignment : 64

address sizes : 40 bits physical,48 bits virtual

power management:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值