public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Performance test result between per-vhost kthread disable and enable
@ 2010-11-23  2:13 lidong chen
  2010-11-23  6:29 ` Huang, Zhiteng
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: lidong chen @ 2010-11-23  2:13 UTC (permalink / raw)
  To: tj, sri, mst, Avi Kivity, kvm

I test the performance between per-vhost kthread disable and enable.

Test method:
Send the same traffic load between per-vhost kthread disable and
enable, and compare the cpu rate of host os.
I run five vm on kvm, each of them have five nic.
the vhost version which per-vhost kthread disable we used is rhel6
beta 2(2.6.32.60).
the vhost version which per-vhost kthread enable we used is rhel6 (2.6.32-71).

Test result:
with per-vhost kthread disable, the cpu rate of host os is 110%.
with per-vhost kthread enable, the cpu rate of host os is 130%.

In 2.6.32.60,the whole system only have a kthread.
[root@rhel6-kvm1 ~]# ps -ef | grep vhost
root       973     2  0 Nov22 ?        00:00:00 [vhost]

In 2.6.32.71,the whole system have 25 kthread.
[root@kvm-4slot ~]# ps -ef | grep vhost-
root     12896     2  0 10:26 ?        00:00:00 [vhost-12842]
root     12897     2  0 10:26 ?        00:00:00 [vhost-12842]
root     12898     2  0 10:26 ?        00:00:00 [vhost-12842]
root     12899     2  0 10:26 ?        00:00:00 [vhost-12842]
root     12900     2  0 10:26 ?        00:00:00 [vhost-12842]

root     13022     2  0 10:26 ?        00:00:00 [vhost-12981]
root     13023     2  0 10:26 ?        00:00:00 [vhost-12981]
root     13024     2  0 10:26 ?        00:00:00 [vhost-12981]
root     13025     2  0 10:26 ?        00:00:00 [vhost-12981]
root     13026     2  0 10:26 ?        00:00:00 [vhost-12981]

root     13146     2  0 10:26 ?        00:00:00 [vhost-13088]
root     13147     2  0 10:26 ?        00:00:00 [vhost-13088]
root     13148     2  0 10:26 ?        00:00:00 [vhost-13088]
root     13149     2  0 10:26 ?        00:00:00 [vhost-13088]
root     13150     2  0 10:26 ?        00:00:00 [vhost-13088]
...

Code difference:
In 2.6.32.60,in function vhost_init, create the kthread for vhost.
vhost_workqueue = create_singlethread_workqueue("vhost");

In 2.6.32.71,in function vhost_dev_set_owner, create the kthread for
each nic interface.
dev->wq = create_singlethread_workqueue(vhost_name);

Conclusion:
with per-vhost kthread enable, the system can more throughput.
but deal the same traffic load with per-vhost kthread enable, it waste
more cpu resource.

In my application scene, the cpu resource is more important, and one
kthread for deal with traffic load is enough.

So i think we should add a param to control this.
for the CPU-bound system, this param disable per-vhost kthread.
for the I/O-bound system, this param enable per-vhost kthread.
the default value of this param is enable.

If my opinion is right, i will give a patch for this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-12-09 13:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23  2:13 Performance test result between per-vhost kthread disable and enable lidong chen
2010-11-23  6:29 ` Huang, Zhiteng
2010-11-23  6:52   ` lidong chen
2010-11-23  6:54     ` Huang, Zhiteng
2010-11-23  7:09       ` lidong chen
2010-11-23 11:12 ` Michael S. Tsirkin
2010-11-23 13:23   ` lidong chen
2010-11-23 13:41     ` Michael S. Tsirkin
2010-11-23 16:00       ` Sridhar Samudrala
2010-11-24  6:49         ` lidong chen
2010-11-24 10:46           ` Michael S. Tsirkin
2010-11-24 16:31             ` lidong chen
2010-12-09 13:31 ` Michael S. Tsirkin
2010-12-09 13:34   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox