我有一个疯狂的cpu使用mysqld +600%这里是我的cnf文件
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file
我的代码有两个任务,第一个任务消耗CPU 0.3%,第二个任务消耗CPU 80%。这两个作业重复工作,如下所示:
while True:
job1()
job2()
我发现在第一次循环后,即使在job1()中工作,CPU消耗也没有下降,消耗始终是80%。
所以我像这样修改了代码:
n = 0
while True:
n += 1
if n > 1:
print 'to sleep'
time.sleep(100000000)
continue
job1()
job2()
我发现当它在sleep()中时,CPU消耗是80%。为
我在两台机器上安装了Tomcat系统的Liferay 6:
Machine 1: Windows 2003 Server 2GB RAM, 2Gh CPU Mysql Ver 14.14 Distrib 5.1.49 Liferay 6.0.6 with Tomcat 6
Machine 2: Linux CentOS 5.5 4GB RAM, 2Gh CPU Mysql Ver 14.14 Distrib 5.5.10 Liferay 6.0.6 with Tomcat 6
两个救生筏系统都有相同的启动参数和mysql配置。救生筏系统包含一个自定义主题和一个检查每个URL访问的servlet