此CPU设置并发java多线程并发数多少最合适

此CPU设置并发线程数多少最合适? - ITeye问答
cpuinfo如下:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model name : Intel(R) Xeon(R) CPU
stepping : 2
cache size : 12288 KB
physical id : 0
siblings : 8
cpu cores : 4
initial apicid : 0
fpu_exception : yes
cpuid level : 11
: 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 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4266.49
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 name : Intel(R) Xeon(R) CPU
stepping : 2
cache size : 12288 KB
physical id : 0
siblings : 8
cpu cores : 4
initial apicid : 2
fpu_exception : yes
cpuid level : 11
: 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 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4266.49
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model name : Intel(R) Xeon(R) CPU
stepping : 2
cache size : 12288 KB
physical id : 0
siblings : 8
cpu cores : 4
initial apicid : 18
fpu_exception : yes
cpuid level : 11
: 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 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4266.49
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model name : Intel(R) Xeon(R) CPU
stepping : 2
cache size : 12288 KB
physical id : 0
siblings : 8
cpu cores : 4
initial apicid : 20
fpu_exception : yes
cpuid level : 11
: 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 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4266.49
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 6
model name : Intel(R) Xeon(R) CPU
stepping : 2
cache size : 12288 KB
physical id : 1
siblings : 8
cpu cores : 4
initial apicid : 32
fpu_exception : yes
cpuid level : 11
: 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 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4266.58
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 6
model name : Intel(R) Xeon(R) CPU
stepping : 2
cache size : 12288 KB
physical id : 1
siblings : 8
cpu cores : 4
initial apicid : 34
fpu_exception : yes
cpuid level : 11
: 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 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4266.58
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
请详细解释一下该机器的CPU信息,以及并发线程数设置多少最佳?
对于计算密集型任务,在拥有Ncpu个处理器的系统上,当线程池大小为N+1时,通常能实现最优的利用率,(即当计算密集型任务偶尔由于页缺失故障或者其他原因而暂停时,这个额外的现线程也能够确保CPU的时钟周期不会被浪费。)
对于包含IO操作或者其他阻塞操作的任务,由于线程并不会一直执行,因此线程池的规模应该更大.要正确的设置线程池的大小,你必须估算出任务的等待时间和计算时间的比值。这种估算不需要很精确,并且可以通过一些分析活监控工具老获得。
还可以通过另外一种方法来调节线程池的大小,在某个基准负载下,分别设置不同大小的线程池来运行应用程序,并观察CPU的利用水平。
Ncpu = number of CPUs
Ucpu = target CPU utilization, 0 &= Ucpu &= 1
W
-& =& ratio of wait time to compute time
C
要使处理器达到期望的利用率,线程池的最优大小为:
Nthreads = Ncpu * Ucpu * (1 + W/C)
参考&&java concurrency in practise&& P141
一般线程数设置为 (cpu(核数)+1)*线程处理时间,四核cpu (4+1)*5 = 20 (线程池数量)
3DNOW A multimedia extension created by AMD for its processors, based on / almost equivalent to Intel’s MMX extensions
3DNOWEXT 3DNOW Extended. Also known as AMD’s 3DNow!Enhanced 3DNow!Extensions
APIC Advanced Programmable Interrupt Controller
CLFSH/CLFlush Cache Line Flush
CMOV Conditional Move/Compare Instruction
CMP_Legacy Register showing the CPU is not Hyper-Threading capable
Constant_TSC on Intel P-4s, the TSC runs with constant frequency independent of cpu frequency when EST is used
CR8Legacy -unknown-
CX8 CMPXCHG8B Instruction. (Compare and exchange 8 bytes. Also known as F00F, which is an abbreviation of the hexadecimal encoding of an instruction that exhibits a design flaw in the majority of older Intel Pentium CPU).
CX16 CMPXCHG16B Instruction. (CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword) data types. This is useful for high resolution counters that could be updated by multiple processors (or cores). Without CMPXCHG16B the only way to perform such an operation is by using a critical section.)&
DE Debugging Extensions
DS Debug Store
DS_CPL CPL qualified Debug Store (whatever CPL might mean in this context)
DTS Could mean Debug Trace Store or Digital Thermal Sensor, depending on source
EIST/EST Enhanced Intel SpeedsTep
EPT extended Page Tables (Intel, similar to NPT on AMD)
FXSR FXSAVE/FXRSTOR. (The FXSAVE instruction writes the current state of the x87 FPU, MMX technology, Streaming SIMD Extensions, and Streaming SIMD Extensions 2 data, control, and status registers to the destination operand. The destination is a 512-byte memory location. FXRSTOR will restore the state saves).&
FXSR_OPT -unknown-
HT Hyper-Transport. Note that the same abbreviation might is also used to indicate Hyper Threading (see below)
HTT/HT Hyper-Threading. An Intel technology that allows quasi-parallel execution of different instructions on a single core. The single core is seen by applications as if it were two (or potentially more) cores. However, two true CPU cores are almost always faster than a single core with HyperThreading. This flag indicates support in the CPU when checking the flags in /proc/cpuinfo on Linux systems. For more info how you can detect active HyperThreading, see the first comment in my blog post about this page at [2]
HVM Hardware support for virtual machines (Xen abbreviation for AMD SVM / Intel VMX)
LAHF_LM Load Flags into AH Register, Long Mode.
LM Long Mode. (64bit Extensions, AMD’s AMD64 or Intel’s EM64T).
MCA Machine Check Architecture
MCE Machine Check Exception
MMX It is rumoured to stand for MultiMedia eXtension or Multiple Math or Matrix Math eXtension, but officially it is a meaningless acronym trademarked by Intel
MMXEXT MMX Extensions – an enhanced set of instructions compared to MMX
MON/MONITOR CPU Monitor
MSR RDMSR and WRMSR Support
MTRR Memory Type Range Register
NPT Nested Page Tables (AMD, similar to EPT on Intel)
NX No eXecute, a flag that can be set on memory pages to disable execution of code in these pages
PAE Physical Address Extensions. PAE is the added ability of the IA32 processor to address more than 4 GB of physical memory using Intel’s 36bit page addresses instead of the standard 32bit page addresses to access a total of 64GB of RAM. Also supported by many AMD chips
PAT Page Attribute Table
PBE Pending Break Encoding
PGE PTE Global Bit
PNI Prescott New Instruction. This was the codename for SSE3 before it was released on the Intel Prescott processor (which was later added to the Pentium 4 family name).
PSE Page Size Extensions. (See PSE36)
PSE36 Page Size Extensions 36. IA-32 supports two methods to access memory above 4 GB (32 bits), PSE and PAE. PSE is the older and far less used version. For more information, take a look at [1].
SEP SYSENTER and SYSEXIT
SS Self-Snoop
SSE Streaming SIMD Extensions. Developed by Intel for its Pentium III but also implemented by AMD processors from Athlon XP onwards
SSE2 Streaming SIMD Extensions 2. (An additional 144 SIMDs.) Introduced by Intel Pentium 4, on AMD since Athlon 64
SSE3 Streaming SIMD Extensions 3. (An additional 13 instructions) introduced with “Prescott” revision Intel Pentium 4 processors. AMD introduced SSE3 with the Athlon 64 “Venice” revision
SSSE3 Supplemental Streaming SIMD Extension 3. (SSSE3 contains 16 new discrete instructions over SSE3.) Introduced on Intel Core 2 Duo processors. No AMD chip supports SSSE3 yet.
SSE4 Streaming SIMD Extentions 4. Introduced with “Nehalem” processor in 2008. Also known as “Nehalem New Instructions (NNI)”
SSE4_1 Streaming SIMD Extentions 4.1
SSE4_2 Streaming SIMD Extentions 4.2
SVM Secure Virtual Machine. (AMD’s virtualization extensions to the 64-bit x86 architecture, equivalent to Intel’s VMX, both also known as HVM in the Xen hypervisor.)
TM Thermal Monitor
TM2 Thermal Monitor 2
tpr_shadow Shadowed Task Priority Registers (for virtualization)
TSC Time Stamp Counter
VME Virtual-8086 Mode Enhancement
VMX Intel’s equivalent to AMD’s SVM
VNMI virtual NMI (non-maskable interrupts) (for virtualization)
VPID Virtual Processor ID (for virtualization)
XTPR TPR register chipset update control messenger. Part of the APIC code
6 CPU * 4 Core * 2 HT =48 Threading.
已解决问题
未解决问题2015年8月 C/C++大版内专家分月排行榜第三2015年5月 C/C++大版内专家分月排行榜第三2015年3月 C/C++大版内专家分月排行榜第三2015年1月 C/C++大版内专家分月排行榜第三
2007年9月 C/C++大版内专家分月排行榜第三2007年8月 C/C++大版内专家分月排行榜第三2006年11月 C/C++大版内专家分月排行榜第三
2013年 总版技术专家分年内排行榜第三
2012年 总版技术专家分年内排行榜第七
2011年9月 C/C++大版内专家分月排行榜第二2011年4月 C/C++大版内专家分月排行榜第二2010年11月 C/C++大版内专家分月排行榜第二
2011年6月 C/C++大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。你真的了解:IIS连接数、IIS并发连接数、IIS最大并发工作线程数、应用程序池的队列长度、应用程序池的... - 推酷
你真的了解:IIS连接数、IIS并发连接数、IIS最大并发工作线程数、应用程序池的队列长度、应用程序池的...
一般购买过虚拟主机的朋友都熟悉购买时,会限制IIS连接数,这边先从普通不懂代码用户角度理解IIS连接数
顾名思义即为IIS服务器可以同时容纳客户请求的最高连接数,准确的说应该叫“IIS限制连接数”
这边客户请求的连接内容包括:
1、网站html请求,html中的图片资源,html中的脚本资源,其他需要连接下载的资源等等,任何一个资源的请求即一次连接(虽然有的资源请求连接响应很快)
2、如果网页采用框架(框架内部嵌套网页请求),那么一个框架即一次连接
3、如果网页弹出窗口(窗口内部嵌套网页请求),那么一个窗口一个连接
虚拟主机供应商在IIS(6.2版本,以下所有截图均此版本)中 &“点击网站”-&“右击切换到功能视图”-&“点击界面右侧的‘限制’链接”-&“编辑网站限制”
限制连接数即为虚拟主机供应公开的IIS连接数标准,如果购买的IIS连接数为50,那么我们不得不考虑网站的内容框架和访问量
如果网站图片够多,弹窗窗口随意(可能连时间选择框、简单条件筛选框也用弹出新窗口),加上不得已的打开新页面浏览内容,那么仅仅能容忍10个人同时操作也很正常,我不会把这个操作描述为很多网站说的“10同时在线”,这很容易让人误解,在用户的一次请求(表面上可能是刷新一次网页,实际上内部请求不止一次,事实上很少只有一次)都完成得到服务器响应完毕之后,连接全部会被释放,当然在你看到展示的页面之前,内部嵌套如果有请求图片等连接请求,连接会早早的被释放
事实上,很多企业门户网站访问量低的惊人,IIS连接数为50也是绰绰有余了
这边给出更加详细参考链接:/info/html/IDCzixun/zhujizuyong/7.html
IIS并发连接数
“管理网站”-&“高级设置”-&&限制&-&&最大并发连接数&
其实,普通用户常说的“IIS链接数”就是这边的“最大并发连接数”,如果PC端有IIS的朋友,可以测试上面两个图片的设置,是相互影响的
这边默认最大并发连接数为:,这是一个很惊人的数字,难道这代表着网站能具有并发执行连接数为的能力?
这边我做几个假设:
1、很多虚拟主机供应商所说的无并发连接数限制真的成立吗?
2、每个连接的处理,IIS都会开启一个线程去处理,假设这个处理方式成立,那么个并发连接请求来了是否IIS会立即启动个线程去处理?
对于1:很显然不成立,最大并发连接数的设置绝对有上限
对于2: 这是很多朋友的误区,假设并发连接同时来了,IIS不会立即启动个线程去处理,因为这不现实,对于处理连接,IIS是有“ 最大并发工作线程数 ”限制的,这是我下面要介绍的,我从一些资料上查阅到, 该数字跟操作系统 相关,win7 系统的IIS的值是10(或者其他不确定),VS2012自带的IIS Express的值是80。对于w
indows 服务器版本的系统 的具体值不清楚,即个并发连接来了后,(这边以win7下的10为例),iis第一时间只能启动10个工作线程去处理,那么其他 85 必须排队,排队对用户的体验来说就是网页正在加载,但是什么都不显示,然后此时购买了据虚拟主机供应商所说的无并发连接数限制的客户就要开始狂暴了,为何购买了所谓的“无限并发连接数”,还是会一直在加载的情况,我只能说这就是IIS处理能力有限的问题了
当然服务器没有直接返回“
HTTP Error 503. The service is unavailable.”应该也算是一些你花更多钱的安慰吧,因为你只购买了IIS连接数为50的话,那么第50+1个连接请求操作得到的就直接是“HTTP Error 503. The service is unavailable.”了
另外,如果web服务器的硬件设备够爽朗(牛逼),那么IIS的工作线程也会处理的更快,那么响应的用户等待的时间也会更短(前提是你的IIS连接数够大哦,否则就直接503了哦)
总的来说,最大并发连接数,影响了排队的数量,
很多时候需要我们评估自己的网站的最大并发连接数,然后来进行设置最佳数量
这边给出更加详细参考链接:
/system/win/93.shtml
http://blog.csdn.net/shigaofei1/article/details/8222048
IIS最大并发工作线程数
这个在上面有所涉及,简单的说就是IIS在并发连接请求过来时的处理机制,它会更机智的以某个数量级为单位来分批处理,让没有处理连接请求排队等待,用户浏览器中对于排队等待的响应就是“正在加载”,这比页面直接显示“ HTTP Error 503. The service is unavailable. ”更加能让人接受,但是切勿气急败坏的怒点刷新按钮,因为点的越多,你的请求在排队队伍中越靠后。
当然很多朋友会说,为什么我有时候第一次刷不出来,重新多刷一次内容就出来了,
1、页面脚本哪个地方下载或者处理出了问题,导致页面显示异常或者直接不显示
2、你重新刷新的那个秒级别的操作,web服务器更快速的已经处理好了其他队列的请求或者他人放弃了对web服务器连接请求的操作
3、路由或者宽带网络运营商问题(不稳定)
4、浏览器或者本身电脑问题
我不知道“IIS最大并发工作线程数”有无地方可以设置,知道的朋友可以给我留言,谢谢
那么现在问题来了,最大并发连接数,影响了排队的数量,那么有没有进步影响排队数量的设置? 有的:队列长度
假设最大连接数设置为100,1000个并发连接请求过来了,首先900直接返回给客户“HTTP Error 503. The service is unavailable.”
然后IIS先启动(假设最大并发工作线程数为10)10个线程处理请求,其他90个进入排队状态,如果此时如下操作:
找到网站的所属应用程序池,“右击高级设置”-&&常规&-&&列队长度&,设置为20
那么实际情况又会变成什么样子呢?只会有20个进入排队状态了,70(90-20)个请求也会立刻返回“HTTP Error 503. The service is unavailable”
iis默认队列长度设置是1000,范围在10-65535 之间
最大工作进程数
IIS 6.0允许将应用程序池配置成一个Web园(Web Garden)
找到网站的所属应用程序池,“右击高级设置”-&&进程模型&-&&最大工作进程数&,默认1
如果这个值大于 1,那么当有连接请求时会启动多个新的工作进程实例,可启动的最多进程数为您所指定的最大工作进程数,后续更多的请求将以循环的方式发送至工作进程,这个每个工作进程都能承担负载一些连接请求,当然是以消耗cpu等硬件做代价,这是值得的,如果web服务器cpu使用率很低但是又需要更高效的处理并发连接请求,为何不这么做呢?
如果网站中用到了依赖进程的Session和Cache等对象,则不能保存在服务器内存中,存储方式选用StateServer或者SQLServer会更好,另外多个工作进程切换时会有上下文复制,这也是资源消耗更多地方
最大工作进程数的设置方法:(拷贝)按照每工作进程能承载30个并发的原则来确定应用程序池的最大工作进程数。同时要注意,每个工作进程大约会占用200M左右的系统内存,在设置最大工作进程数的时候,要主要最大工作进程数与200M的乘积不要超过系统最大可用内存数。一般情况下,建议按照每次增加5个工作进程数的方式对最大工作进程数进行调整,调整完后对网站观察一段时间,如依然无法满足要求,再继续增加5个工作进程数。
这边给出更加详细参考链接:
/174816.html
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致

我要回帖

更多关于 cpu内核线程 并发数量 的文章

 

随机推荐