linux – ps aux用java进程挂在高cpu / IO上

前端之家收集整理的这篇文章主要介绍了linux – ps aux用java进程挂在高cpu / IO上前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在 java进程和nrpe检查方面遇到了一些问题.我们有一些进程有时在32核系统上使用1000%cpu.在您执行此操作之前,系统非常敏感
  1. ps aux

或尝试在/ proc / pid#中做任何事情

  1. [root@flume07.domain.com /proc/18679]# ls
  2. hangs..

ps aux的一个片段

  1. stat("/etc/localtime",{st_mode=S_IFREG|0644,st_size=2819,...}) = 0
  2. stat("/etc/localtime",...}) = 0
  3. stat("/dev/pts1",0x7fffb8526f00) = -1 ENOENT (No such file or directory)
  4. stat("/dev/pts",{st_mode=S_IFDIR|0755,st_size=0,...}) = 0
  5. readlink("/proc/15693/fd/2","/dev/pts/1",127) = 10
  6. stat("/dev/pts/1",{st_mode=S_IFCHR|0620,st_rdev=makedev(136,1),...}) = 0
  7. write(1,"root 15693 15692 0 06:25 pt"...,55root 15693 15692 0 06:25 pts/1 00:00:00 ps -Af
  8. ) = 55
  9. stat("/proc/18679",{st_mode=S_IFDIR|0555,...}) = 0
  10. open("/proc/18679/stat",O_RDONLY) = 5
  11. read(5,"18679 (java) S 1 18662 3738 3481"...,1023) = 264
  12. close(5) = 0
  13. open("/proc/18679/status",O_RDONLY) = 5
  14. read(5,"Name:\tjava\nState:\tS (sleeping)\nT"...,1023) = 889
  15. close(5) = 0
  16. open("/proc/18679/cmdline",O_RDONLY) = 5
  17. read(5,

java进程正在运行并且完成得很好但是问题是它让我们的监控变得疯狂,因为它等待ps aux完成超时.

我尝试过这样的事情

  1. nice -19 ionice -c1 /usr/lib64/nagios/plugins/check_procs -w 1:1 -c 1:1 -a 'diamond' -u root -t 30

没有运气

编辑

系统规格

> 32核心英特尔(R)Xeon(R)cpu E5-2650 0 @ 2.00GHz
> 128gig的ram
> 12个4Tb 7200驱动器
> CentOS 6.5
>我不确定模型,但供应商是SuperMicro

发生这种情况时的负荷约为90-160ish,持续1分钟.

奇怪的是我可以进入任何其他/ proc / pid#并且它工作得很好.当我进入ssh时,系统会响应.就像当我们收到高负荷的警报时,我可以直接判断.

另一个编辑

我一直在使用调度程序的截止日期

  1. [root@dn07.domain.com ~]# for i in {a..m}; do cat /sys/block/sd${i}/queue/scheduler; done
  2. noop anticipatory [deadline] cfq
  3. noop anticipatory [deadline] cfq
  4. noop anticipatory [deadline] cfq
  5. noop anticipatory [deadline] cfq
  6. noop anticipatory [deadline] cfq
  7. noop anticipatory [deadline] cfq
  8. noop anticipatory [deadline] cfq
  9. noop anticipatory [deadline] cfq
  10. noop anticipatory [deadline] cfq
  11. noop anticipatory [deadline] cfq
  12. noop anticipatory [deadline] cfq
  13. noop anticipatory [deadline] cfq
  14. noop anticipatory [deadline] cfq

山看起来像

  1. [root@dn07.manage.com ~]# mount
  2. /dev/sda3 on / type ext4 (rw,noatime,barrier=0)
  3. proc on /proc type proc (rw)
  4. sysfs on /sys type sysfs (rw)
  5. devpts on /dev/pts type devpts (rw,gid=5,mode=620)
  6. tmpfs on /dev/shm type tmpfs (rw)
  7. /dev/sda1 on /boot type ext2 (rw)
  8. none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
  9. /dev/sdb1 on /disk1 type xfs (rw,nobarrier)
  10. /dev/sdc1 on /disk2 type xfs (rw,nobarrier)
  11. /dev/sdd1 on /disk3 type xfs (rw,nobarrier)
  12. /dev/sde1 on /disk4 type xfs (rw,nobarrier)
  13. /dev/sdf1 on /disk5 type xfs (rw,nobarrier)
  14. /dev/sdg1 on /disk6 type xfs (rw,nobarrier)
  15. /dev/sdh1 on /disk7 type xfs (rw,nobarrier)
  16. /dev/sdi1 on /disk8 type xfs (rw,nobarrier)
  17. /dev/sdj1 on /disk9 type xfs (rw,nobarrier)
  18. /dev/sdk1 on /disk10 type xfs (rw,nobarrier)
  19. /dev/sdl1 on /disk11 type xfs (rw,nobarrier)
  20. /dev/sdm1 on /disk12 type xfs (rw,nobarrier)

好的我尝试安装tuned并将其设置为吞吐量性能.

  1. [root@dn07.domain.com ~]# tuned-adm profile throughput-performance
  2. Switching to profile 'throughput-performance'
  3. Applying deadline elevator: sda sdb sdc sdd sde sdf sdg sdh[ OK ] sdk sdl sdm
  4. Applying ktune sysctl settings:
  5. /etc/ktune.d/tunedadm.conf: [ OK ]
  6. Calling '/etc/ktune.d/tunedadm.sh start': [ OK ]
  7. Applying sysctl settings from /etc/sysctl.d/99-chef-attributes.conf
  8. Applying sysctl settings from /etc/sysctl.conf
  9. Starting tuned: [ OK ]

解决方法

一般来说,我已经看到这种情况发生了,因为停止阅读.你的strace输出证实了这一点.在运行ps aux命令时,读取/ proc / xxxx / cmdline文件的尝试会挂起.

I / O中的瞬间峰值正在使系统资源匮乏.如果与存储子系统相关,那么90-160的负载是非常坏的消息.

对于存储阵列,您能否告诉我们是否有硬件RAID控制器?服务器上的主要应用程序是否存在写入偏差?您提到的磁盘(12 x 4TB)是低速近线SAS或SATA磁盘.如果驱动器阵列前面没有write caching形式,则写入能够推动系统负载.如果这些是Supermicro背板上的纯SATA驱动器,请不要打折possibility of other disk problems(超时,故障驱动器,背板等)这是否会在所有Hadoop节点上发生?

一个简单的测试是尝试在发生这种情况时运行iotop.此外,由于这是EL6.5,你有没有启用任何tuned-adm settings?是否启用了写入障碍?

如果您尚未更换服务器的I / O电梯,则可能会产生影响.如果您已将其更改为CFQ以外的任何内容(此服务器应该在deadline),则ionice不会有任何区别.

编辑:

我在生产环境中看到的另一件奇怪的事情.这些是Java进程,我认为它们是多线程的.你是怎么做PID的? kernel.pid_max的sysctl值是多少?我曾经遇到过以前耗尽PID的情况,并导致高负荷.

另外,你提到了内核版本2.6.32-358.23.2.el6.x86_64.这是一年多了,是CentOS 6.4版本的一部分,但你服务器的其余部分是6.5.你有没有在yum.conf中列出内核更新?您可能应该使用内核2.6.32-431.x.x或更新版本的系统. There could be a hugepages issue with the older kernel you have.如果您无法更改内核,请尝试使用以下命令禁用它们:

echo never> / SYS /内核/ MM / redhat_transparent_hugepage /启用.

猜你在找的Linux相关文章