centos6 – CPU亲和力设置不粘

前端之家收集整理的这篇文章主要介绍了centos6 – CPU亲和力设置不粘前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图在使用OpenVZ虚拟化并运行CentOS 6.x的4vcpu VPS上设置 mysql(最新的Percona Server)的亲和力.

我正在运行的命令是taskset -pc 0-1 1026.我也试过了0,1.输出是:

pid 1026's current affinity list: 0-3
pid 1026's new affinity list: 0-3

所以,它似乎并没有“坚持”.可以通过再次运行taskset来确认查找进程可用的cpu.这可能是我的虚拟化类型的问题吗?

我这样做是因为我时不时地需要MysqL运行得非常努力,超过2个小时超过2.0-4.0会让我重新启动我当前的提供商.

是否有明确原因导致无法正常工作,还是需要进行更多故障排除?

CPU affinity masks are ignored inside OpenVZ containers.你将无法让它“工作”.

In RHEL5-based kernels we had the notion of virtual cpus: tasks were
scheduled on vcpus while the vcpus were somehow distributed among
physical cpus. The sched_setaffinity syscall could be used to bind
tasks to vcpus then.

This concept was cumbersome and often sub-optimal so in RHEL6 we
decided to drop it: currently setting nr_cpus limit for a container
is actually equivalent to setting cpulimit. The decision is justified
by the fact that the latest Linux scheduler is smart enough to gather
actively interacting tasks together so that there is no need to limit
parallelism artificially.

As a result,cpu affinity support was dropped. Tasks can still use the sched_setaffinity syscall,but it will be ignored.

原文链接:https://www.f2er.com/centos/373764.html

猜你在找的CentOS相关文章