红联Linux门户
Linux帮助

一个关于cpu运算速度的问题

发布时间:2008-09-25 16:18:03来源:红联作者:hnlgdxwmx
[font=Times New Roman] [/font]
[font=宋体]本人刚开始接触[/font][font=Times New Roman]linux[/font][font=宋体],在此想请教大家一个有关[/font][font=Times New Roman]cpu[/font][font=宋体]运算速度的问题,如蒙赐教,不胜感激。[/font]


[font=宋体]我用[/font][font=Times New Roman]linux[/font][font=宋体]主要是做计算,常用的有两台服务器,一个叫[/font][font=Times New Roman]TB[/font][font=宋体],我是[/font][font=Times New Roman]root[/font][font=宋体],另一个叫[/font][font=Times New Roman]lpg[/font][font=宋体],我是普通用户。两台机器的配置接近,[/font][font=Times New Roman]TB[/font][font=宋体]比[/font][font=Times New Roman]lpg[/font][font=宋体]稍微好一些。两台机器均上网,操作系统相同,为[/font][font=Times New Roman]centos[/font][font=宋体]。后面将会列出[/font][font=Times New Roman]cpu[/font][font=宋体]和硬盘的情况。如果还需要别的参数请告诉我,[/font][font=Times New Roman]TB[/font][font=宋体]的都有,[/font][font=Times New Roman]lpg[/font][font=宋体]我不是[/font][font=Times New Roman]root[/font][font=宋体]。[/font]
[font=Times New Roman] [/font]
[font=宋体]我的问题是:同样的[/font][font=Times New Roman]code[/font][font=宋体],同样的编译器,计算同样的一个任务,在[/font][font=Times New Roman]lpg[/font][font=宋体]上大约要计算[/font][font=Times New Roman]1.7[/font][font=宋体]个小时(我重复了三次,都在[/font][font=Times New Roman]1.68~1.76[/font][font=宋体]小时之间,[/font][font=Times New Roman]1.7[/font][font=宋体]是平均),而在[/font][font=Times New Roman]TB[/font][font=宋体]上计算,则需要[/font][font=Times New Roman]2.7[/font][font=宋体]个小时,耗时多了[/font][font=Times New Roman]50%[/font][font=宋体]。我平时的一个任务都要一个多星期,因此,多这么长时间实在是难以忍受的。请问我这是为什么,我是否应该进行配置的调整。[/font]
[font=Times New Roman] [/font]
[font=Times New Roman]TB[/font][font=宋体]的[/font][font=Times New Roman]cpu[/font][font=宋体]情况如下:[/font][/color]
[color=#3366ff][font=Times New Roman][mengxi@localhost p]$ cat /proc/cpuinfo[/font]

[font=Times New Roman]processor
: 0[/font]

[font=Times New Roman]vendor_id
: GenuineIntel[/font]

[font=Times New Roman]cpu family
: 6[/font]

[font=Times New Roman]model
: 7[/font]

[font=Times New Roman]model name
: Intel(R) Xeon(R) CPU
E5420
@ 2.50GHz[/font]

[font=Times New Roman]stepping
: 6[/font]

[font=Times New Roman]cpu MHz
: 2497.000[/font]

[font=Times New Roman]cache size
: 6144 KB[/font]

[font=Times New Roman]physical id
: 1[/font]

[font=Times New Roman]siblings
: 4[/font]

[font=Times New Roman]core id
: 4[/font]

[font=Times New Roman]cpu cores
: 4[/font]

[font=Times New Roman]fpu
: yes[/font]

[font=Times New Roman]fpu_exception
: yes[/font]

[font=Times New Roman]cpuid level
: 10[/font]

[font=Times New Roman]wp
: yes[/font]

[font=Times New Roman]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 ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr lahf_lm[/font]

[font=Times New Roman]bogomips
: 4990.89[/font]

[font=Times New Roman]clflush size
: 64[/font]

[font=Times New Roman]cache_alignment : 64[/font]
[font=Times New Roman]address sizes
: 38 bits physical, 48 bits virtual[/font]

[font=Times New Roman]power management:[/font]
[font=宋体]共[/font][font=Times New Roman]8[/font][font=宋体]个[/font][font=Times New Roman]core[/font][font=宋体],后面[/font][font=Times New Roman]7[/font][font=宋体]个省略[/font][/color]
[font=Times New Roman] [/font]
[color=#9900cc][font=Times New Roman]Lpg[/font]
[font=宋体]的[/font][font=Times New Roman]cpu[/font][font=宋体]的情况如下:[/font][/color]
[color=#9900cc][font=Times New Roman][mengxi@lpg01 ~]$ cat /proc/cpuinfo[/font]

[font=Times New Roman]processor
: 0[/font]

[font=Times New Roman]vendor_id
: GenuineIntel[/font]

[font=Times New Roman]cpu family
: 6[/font]

[font=Times New Roman]model
: 7[/font]

[font=Times New Roman]model name
: Intel(R) Xeon(R) CPU
E5420
@ 2.50GHz[/font]

[font=Times New Roman]stepping
: 6[/font]

[font=Times New Roman]cpu MHz
: 1998.000[/font]

[font=Times New Roman]cache size
: 6144 KB[/font]

[font=Times New Roman]physical id
: 1[/font]

[font=Times New Roman]siblings
: 4[/font]

[font=Times New Roman]core id
: 4[/font]

[font=Times New Roman]cpu cores
: 4[/font]

[font=Times New Roman]fpu
: yes[/font]

[font=Times New Roman]fpu_exception
: yes[/font]

[font=Times New Roman]cpuid level
: 10[/font]

[font=Times New Roman]wp
: yes[/font]

[font=Times New Roman]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 ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr lahf_lm[/font]

[font=Times New Roman]bogomips
: 3993.50[/font]

[font=Times New Roman]clflush size
: 64[/font]

[font=Times New Roman]cache_alignment : 64[/font]
[font=Times New Roman]address sizes
: 38 bits physical, 48 bits virtual[/font]

[font=Times New Roman]power management:[/font]
[font=宋体]共[/font][font=Times New Roman]8[/font][font=宋体]个[/font][font=Times New Roman]core[/font][font=宋体],后面[/font][font=Times New Roman]7[/font][font=宋体]个省略[/font][/color]
[font=Times New Roman] [/font]
[color=#3366ff][font=Times New Roman]TB[/font]
[font=宋体]硬盘的情况如下:[/font][/color]
[font=Times New Roman]
Vendor: ATA
Model: ST3750330AS
Rev: SD15[/font]

[font=Times New Roman]
Type:
Direct-Access

ANSI SCSI revision: 05[/font]

[font=Times New Roman]SCSI device sda: 1465149168 512-byte hdwr sectors (750156 MB)[/font]
[font=Times New Roman]SCSI device sda: drive cache: write back[/font]
[font=Times New Roman]SCSI device sda: 1465149168 512-byte hdwr sectors (750156 MB)[/font]
[font=Times New Roman]SCSI device sda: drive cache: write back[/font]
[color=#9900cc][font=Times New Roman] [/font]

[font=Times New Roman]Lpg[/font][font=宋体]硬盘的情况:[/font][/color]
[font=Times New Roman]
Vendor: ATA
Model: ST3500320NS
Rev: SN04[/font]

[font=Times New Roman]
Type:
Direct-Access
ANSI SCSI revision: 05[/font]

[font=Times New Roman]SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)[/font]
[font=Times New Roman]SCSI device sda: drive cache: write back[/font]
[font=Times New Roman]SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)[/font]
[font=Times New Roman]SCSI device sda: drive cache: write back[/font]
[font=Times New Roman] [/font]
[font=宋体]根据硬盘型号,我已经查了转速相同。[/font]
[font=Times New Roman] [/font]
[color=#3366ff][font=Times New Roman]TB[/font]
[font=宋体]使用[/font][font=Times New Roman]top[/font][font=宋体]命令得到的运行情况如下:[/font][/color]
[color=#3366ff][font=Times New Roman][mengxi@TB c]$ top i[/font]

[font=Times New Roman]top - 15:33:59 up
3:59,
1 user,
load average: 4.30, 6.70, 7.32[/font]

[font=Times New Roman]Tasks: 115 total,
5 running, 110 sleeping,
0 stopped,
0 zombie[/font]

[font=Times New Roman]Cpu0
:
0.3% us,
0.0% sy,
0.0% ni, 99.7% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu1
:
0.0% us,
0.3% sy,
0.0% ni, 99.7% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu2
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu3
:
0.0% us,
0.0% sy,
0.0% ni, 100.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu4
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu5
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu6
:
0.0% us,
0.0% sy,
0.0% ni, 100.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu7
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Mem:
4024608k total,
3265880k used,
758728k free,
44336k buffers[/font]

[font=Times New Roman]Swap:
2031608k total,
0k used,
2031608k free,
2928420k cached[/font]

[font=Times New Roman] [/font]
[font=Times New Roman]
PID USER
PR
NI %CPU
TIME+
%MEM
VIRT
RES
SHR S COMMAND[/font]

[font=Times New Roman]
6882 mengxi
25
0
100
42:24.62
0.7 29320
27m
800 R 5-fr-1-c[/font]

[font=Times New Roman]
6903 mengxi
25
0
100
41:49.09
0.7 29248
27m
800 R 5-fr-2-c[/font]

[font=Times New Roman]
6931 mengxi
25
0
100
41:08.80
0.7 28400
26m
800 R 5-fr-1-c[/font]

[font=Times New Roman]
6994 mengxi
25
0
100
0:19.63
0.8 32484
30m
800 R 5-st-1-c[/font]

[font=Times New Roman]
6995 mengxi
16
0
0
0:00.03
0.0
6156 1160
848 R top[/font]

[font=Times New Roman] [/font]
[font=Times New Roman] [/font]
[font=Times New Roman]Lpg[/font][font=宋体]使用[/font][font=Times New Roman]top[/font][font=宋体]命令得到的运行情况如下:[/font][/color]
[color=#9900cc][font=Times New Roman] [/font]

[font=Times New Roman][mengxi@lpg01 ~]$ top i[/font]
[font=Times New Roman]top - 15:31:55 up 20 days,
4:59,
2 users,
load average: 4.07, 4.02, 4.00[/font]

[font=Times New Roman]Tasks: 139 total,
5 running, 134 sleeping,
0 stopped,
0 zombie[/font]

[font=Times New Roman]Cpu0
:
0.0% us,
0.0% sy,
0.0% ni, 100.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu1
:
0.0% us,
0.0% sy,
0.0% ni, 100.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu2
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu3
:
0.0% us,
0.0% sy,
0.0% ni, 100.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu4
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu5
:
0.0% us,
0.0% sy,
0.0% ni, 100.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu6
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Cpu7
: 100.0% us,
0.0% sy,
0.0% ni,
0.0% id,
0.0% wa,
0.0% hi,
0.0% si[/font]

[font=Times New Roman]Mem:
4024608k total,
3384232k used,
640376k free,
38448k buffers[/font]

[font=Times New Roman]Swap:
2031608k total,
224k used,
2031384k free,
2982588k cached[/font]

[font=Times New Roman] [/font]
[font=Times New Roman]
PID USER
PR
NI
VIRT
RES
SHR S %CPU %MEM
TIME+
COMMAND[/font]

[font=Times New Roman]12421 iggy
25
0 10556 4596
836 R
100
0.1
1524:28 piling[/font]

[font=Times New Roman]12512 iggy
25
0 10528 4568
836 R
100
0.1
1488:59 piling[/font]

[font=Times New Roman]12513 iggy
25
0 10496 4536
836 R
100
0.1
1486:02 piling[/font]

[font=Times New Roman]12514 iggy
25
0 10572 4612
836 R
100
0.1
1484:10 piling[/font]

[font=Times New Roman]16243 mengxi
16
0
6288 1180
848 R
1
0.0

0:00.08 top[/font]

[font=Times New Roman] [/font]
[font=Times New Roman] [/font]
[font=宋体]谢谢[/font]
[font=Times New Roman] [/font]
[font=宋体]天北[/font][font=Times New Roman]2008-9-25[/font][font=宋体]于悉尼[/font]
[font=Times New Roman] [/font]
文章评论

共有 1 条评论

  1. cwqing1973 于 2008-09-27 15:36:28发表:

    你认为TB就一定要比其他的要快吗?这是有一定的误会的,其中有许多其他的因素所限制。