CentOS 6.5峰值 [英] CentOS 6.5 spike

查看:111
本文介绍了CentOS 6.5峰值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用C语言开发了一个应用程序。我正在 Red Hat Enterprise Linux Server 5.8版(Tikanga)上运行该应用程序,一切看起来都不错,但是当我们在 CentOS 6.5版(最终版)上部署该应用程序时,它将启动做问题。它占用更多的cheche内存,并且在30-45分钟后会猛增一个峰值,所有cpu均会在1-2秒内显示出100%的cpu利用率。

I have developed an application in C. I am running this application on "Red Hat Enterprise Linux Server release 5.8 (Tikanga)" and everything looks good but when we deploy this application on "CentOS release 6.5 (Final)" it starts doing problem. It occupies more chache memory and after 30-45 minutes it shoot up a spike and all cpu shows 100% cpu utilization for 1-2 second.

我在此问题上进行了搜索,发现 Cent OS 6.3上的usleep的CPU高使用率

I google this issue and found that CPU high usage of the usleep on Cent OS 6.3

由于我的应用程序中有一个进程正在使用10睡着了RedHat占用的CPU不到3%,但是CentOS占用的CPU却高达90%。在读取链接后,当我将睡眠时间从10 usleep更改为1000 usleep或1 us时,它将占用40%的CPU。

Since one process in my application is using 10 usleep. It is taking less than 3% CPU in RedHat, however it is taking quite high in CentOS around 90%. After reading the link when I change the sleep from 10 usleep to 1000 usleep or 1 us then it takes 40% CPU.

我需要知道CentOS 6.5的内核是否正在使用高速计时器,或者在编译内核时需要设置任何配置。

I need to know that the Kernel of CentOS 6.5 is using high speed timers or not or I need to set any configuration in compiling the Kernel.

推荐答案

首先,您正在比较苹果和橙子:CentOS 6对应于RHEL6。您的代码在RHEL 6.5上的行为与在CentOS 6.5上的行为很可能相同,在CentOS 5.8上与RHEL 5.8的行为相同。将问题描述为RHEL和CentOS之间的差异是令人误解的。

In the first place, you are comparing apples and oranges: CentOS 6 corresponds to RHEL 6. Very likely your code would behave the same on RHEL 6.5 as it does on CentOS 6.5, and the same on CentOS 5.8 as on RHEL 5.8. It is misleading to describe the issue as a difference between RHEL and CentOS.

第二,如果您的CPU利用率受几次usleep()调用的影响很大, (显然,执行了很多次),那么您的代码就有缺陷,应该对其进行修复。构建一个自定义内核来掩盖问题将是相当落后的。不过,如果目标不是转移到CentOS,而是转移到CentOS 5,而不是CentOS 6。

In the second place, if your CPU utilization is that strongly affected by a few usleep() calls (executed, apparently, very many times), then your code is flawed and you should fix it. Building a custom kernel to mask the problem would be pretty backward. Nevertheless, if the objective is more to move over to CentOS than to move up to a (somewhat) more up-to-date environment, then switch to CentOS 5 instead of to CentOS 6.

这篇关于CentOS 6.5峰值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆