Skip to contentSkip to conversation

less cores more iops / speed

DISCUSSION Stefan Priebe 7 participants 21 messages Nov 7, 2012 – Nov 9, 2012

lore
Share & tools
lore
#0 lore raw

Hello again,

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8 cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Why does less kvm cores mean more speed?

Greets,
Stefan

#1 lore raw
Quoted 4 lines · Stefan Priebe

Hello again,

I've noticed something really interesting.

Quoted 8 lines

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8 cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Why does less kvm cores mean more speed?

Totally going on a limb here, but might be related to the cache maybe? When you have more cores your threads may bounce around the cores and invalidate cache entries as they go by; will less cores you might end up with some sort of twisted, forced cpu affinity that allows you to take advantage of caching.

But I don't know, really. I would be amazed if what I just wrote had an ounce of truth, and would be completely astonished if that was the cause for such a sudden increase on iops.

-Joao

Quoted 7 lines

Greets,
Stefan

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

Openstack - Boot From New Volume

Hi All,

I've been looking for this bit of code for awhile how to make open stack create a VM with the dashboard with a attached/imaged volume to avoid the current multistep process of creating a vm with ceph volume.

Here's the code, thanks goes out to vishy on openstack-dev's and I've added a couple of bits to allow for downloading status and better vol naming.

Enjoy!

https://github.com/qgrasso/nova/commit/340210a7f62e9e34bcc15972d97e81eb282fddd6

https://github.com/qgrasso/nova/commit/31f6839a2c2dd72e2cc44c37cb316610b42598bd

** use at your own risk as always etc etc, :)

Regards,
Quenten

#3 lore raw
In reply to Joao Eduardo Luis
Quoted 12 lines · Joao Eduardo Luis
Quoted 11 lines · Stefan Priebe

Hello again,

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8 cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Quoted 7 lines
Quoted 1 line

Why does less kvm cores mean more speed?

Totally going on a limb here, but might be related to the cache maybe? When you have more cores your threads may bounce around the cores and invalidate cache entries as they go by; will less cores you might end up with some sort of twisted, forced cpu affinity that allows you to take advantage of caching.

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores. Stefan, what tool were you using to do writes?

Quoted 4 lines

But I don't know, really. I would be amazed if what I just wrote had an ounce of truth, and would be completely astonished if that was the cause for such a sudden increase on iops.

Yeah, it's seems pretty surprising that there would be any significant effect at this level of performance.

Quoted 16 lines

-Joao

Quoted 7 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#14 lore raw
In reply to Joao Eduardo Luis
Quoted 12 lines · Joao Eduardo Luis
Quoted 11 lines · Stefan Priebe

Hello again,

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8 cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Quoted 7 lines
Quoted 1 line

Why does less kvm cores mean more speed?

Totally going on a limb here, but might be related to the cache maybe? When you have more cores your threads may bounce around the cores and invalidate cache entries as they go by; will less cores you might end up with some sort of twisted, forced cpu affinity that allows you to take advantage of caching.

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores. Stefan, what tool were you using to do writes?

Quoted 4 lines

But I don't know, really. I would be amazed if what I just wrote had an ounce of truth, and would be completely astonished if that was the cause for such a sudden increase on iops.

Yeah, it's seems pretty surprising that there would be any significant effect at this level of performance.

Quoted 16 lines

-Joao

Quoted 7 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#15 lore raw
In reply to Stefan Priebe
Quoted 10 lines

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8 cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Why does less kvm cores mean more speed?

There is a serious bug in the kvm vhost code. Do you use virtio-net with vhost?

see: http://lists.nongnu.org/archive/html/qemu-devel/2012-11/msg00579.html

Please test using the e1000 driver instead.

#16 lore raw
Quoted 12 lines
Quoted 11 lines

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8
cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Why does less kvm cores mean more speed?

Quoted 7 lines

There is a serious bug in the kvm vhost code. Do you use virtio-net with vhost?

see: http://lists.nongnu.org/archive/html/qemu-devel/2012-
11/msg00579.html

Please test using the e1000 driver instead.

Or update the guest kernel (what guest kernel do you use?). AFAIK 3.X kernels does not trigger the bug.

#18 lore raw
In reply to Dietmar Maurer

Am 08.11.2012 um 06:42 schrieb Dietmar Maurer <[email protected]>:

Quoted 9 lines
Quoted 9 lines

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8 cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Quoted 7 lines
Quoted 1 line

Why does less kvm cores mean more speed?

There is a serious bug in the kvm vhost code. Do you use virtio-net with vhost?

see: http://lists.nongnu.org/archive/html/qemu-devel/2012-11/msg00579.html

Please test using the e1000 driver instead.

Why is vhost net driver involved here at all? Kvm guest only uses ssh here.

Stefan

#19 lore raw
Quoted 1 line

Why is vhost net driver involved here at all? Kvm guest only uses ssh here.

I though you are testing things (rdb) which depends on KVM network speed?

#17 lore raw
In reply to Dietmar Maurer

Am 08.11.2012 um 06:49 schrieb Dietmar Maurer <[email protected]>:

Quoted 15 lines
Quoted 15 lines
Quoted 11 lines

I've noticed something really interesting.

I get 5000 iops / VM for rand. 4k writes while assigning 4 cores on a 2.5 Ghz Xeon.

When i move this VM to another kvm host with 3.6Ghz i get 8000 iops (still 8
cores) when i then LOWER the assigned cores from 8 to 4 i get 14.500 iops. If i assign only 2 cores i get 16.000 iops...

Why does less kvm cores mean more speed?

There is a serious bug in the kvm vhost code. Do you use virtio-net with vhost?

Quoted 6 lines
Quoted 4 lines

see: http://lists.nongnu.org/archive/html/qemu-devel/2012-
11/msg00579.html

Please test using the e1000 driver instead.

Or update the guest kernel (what guest kernel do you use?). AFAIK 3.X kernels does not trigger the bug.

Guest and Host habe 3.6.6 installed.

Quoted 1 line
#20 lore raw
In reply to Dietmar Maurer

Am 08.11.2012 um 06:54 schrieb Dietmar Maurer <[email protected]>:

Quoted 3 lines
Quoted 1 line

Why is vhost net driver involved here at all? Kvm guest only uses ssh here.

I though you are testing things (rdb) which depends on KVM network speed?

Kvm process uses librbd and both are running on host not in guest.

Stefan

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Mark Nelson

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Quoted 1 line

Stefan, what tool were you using to do writes?

as always: fio ;-)

Stefan

#5 lore raw
Quoted 2 lines
Quoted 2 lines

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Do you have tried to compare virtio-blk and virtio-scsi ?

Do you have tried directly from the host with the rbd kernel module ?

----- Mail original -----

De: "Stefan Priebe - Profihost AG" <[email protected]>
À: "Mark Nelson" <[email protected]>
Cc: "Joao Eduardo Luis" <[email protected]>, [email protected] Envoyé: Jeudi 8 Novembre 2012 09:45:17
Objet: Re: less cores more iops / speed

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Quoted 1 line

Stefan, what tool were you using to do writes?

as always: fio ;-)

Stefan

Signature · 7 lines
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in 
the body of a message to [email protected] 
More majordomo info at http://vger.kernel.org/majordomo-info.html 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

Am 08.11.2012 09:58, schrieb Alexandre DERUMIER:

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Do you have tried to compare virtio-blk and virtio-scsi ?

How to change? Right now i'm using the PVE defaults => scsi-hd.

Quoted 1 line

Do you have tried directly from the host with the rbd kernel module ?

No don't know how to use ;-)

Stefan

Quoted 11 lines

----- Mail original -----

De: "Stefan Priebe - Profihost AG" <[email protected]>
À: "Mark Nelson" <[email protected]>
Cc: "Joao Eduardo Luis" <[email protected]>, [email protected] Envoyé: Jeudi 8 Novembre 2012 09:45:17
Objet: Re: less cores more iops / speed

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

Quoted 8 lines

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Quoted 1 line

Stefan, what tool were you using to do writes?

as always: fio ;-)

Stefan

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 2 lines

Do you have tried to compare virtio-blk and virtio-scsi ?

Quoted 1 line

How to change? Right now i'm using the PVE defaults => scsi-hd.

(virtio-blk is "classic" virtio ;)

Quoted 2 lines
Quoted 2 lines

Do you have tried directly from the host with the rbd kernel module ? No don't know how to use ;-)

http://ceph.com/docs/master/rbd/rbd-ko/
#modprobe rbd
#sudo rbd map {image-name} --pool {pool-name} --id {user-name}

(then you'll have a /dev/rbd1)

----- Mail original -----

De: "Stefan Priebe - Profihost AG" <[email protected]>
À: "Alexandre DERUMIER" <[email protected]>
Cc: "Joao Eduardo Luis" <[email protected]>, [email protected], "Mark Nelson" <[email protected]> Envoyé: Jeudi 8 Novembre 2012 10:02:23
Objet: Re: less cores more iops / speed

Am 08.11.2012 09:58, schrieb Alexandre DERUMIER:

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Do you have tried to compare virtio-blk and virtio-scsi ?

How to change? Right now i'm using the PVE defaults => scsi-hd.

Quoted 1 line

Do you have tried directly from the host with the rbd kernel module ?

No don't know how to use ;-)

Stefan

Quoted 11 lines

----- Mail original -----

De: "Stefan Priebe - Profihost AG" <[email protected]>
À: "Mark Nelson" <[email protected]>
Cc: "Joao Eduardo Luis" <[email protected]>, [email protected] Envoyé: Jeudi 8 Novembre 2012 09:45:17
Objet: Re: less cores more iops / speed

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

Quoted 8 lines

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

Quoted 1 line

Stefan, what tool were you using to do writes?

as always: fio ;-)

Stefan

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Am 08.11.2012 10:05, schrieb Alexandre DERUMIER:

Quoted 10 lines
Quoted 2 lines

Do you have tried to compare virtio-blk and virtio-scsi ?

Quoted 1 line

How to change? Right now i'm using the PVE defaults => scsi-hd.

(virtio-blk is "classic" virtio ;)

Quoted 2 lines
Quoted 2 lines

Do you have tried directly from the host with the rbd kernel module ? No don't know how to use ;-)

http://ceph.com/docs/master/rbd/rbd-ko/
#modprobe rbd
#sudo rbd map {image-name} --pool {pool-name} --id {user-name}

this gives me also 8000 iops on the host with 3.6 Ghz. So this is the same like in KVM.

Stefan

#9 lore raw
In reply to Stefan Priebe - Profihost AG
Quoted 5 lines · Stefan Priebe - Profihost AG

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

in this case, is fio bouncing around between cores?

Quoted 3 lines
Quoted 2 lines

Stefan, what tool were you using to do writes?

as always: fio ;-)

You could try using numactl to pin fio to a specific core. Also, it may be interesting to try multiple concurrent fio processes, and then concurrent fio processes with each pinned.

Quoted 2 lines

Stefan

#10 lore raw

Am 08.11.2012 14:19, schrieb Mark Nelson:

Quoted 8 lines · Stefan Priebe - Profihost AG
Quoted 5 lines

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

in this case, is fio bouncing around between cores?

Thanks you're correct. If i bind fio to two cores on a 8 core VM it runs with 16.000 iops.

So it is a problem of KVM which let's the processes jump between cores a lot.

Greets,
Stefan

#11 lore raw
Quoted 2 lines
Quoted 2 lines

So it is a problem of KVM which let's the processes jump between cores a lot.

maybe numad from redhat can help ?
http://fedoraproject.org/wiki/Features/numad

It's try to keep process on same numa node and I think it's also doing some dynamic pinning.

----- Mail original -----

De: "Stefan Priebe - Profihost AG" <[email protected]>
À: "Mark Nelson" <[email protected]>
Cc: "Joao Eduardo Luis" <[email protected]>, [email protected] Envoyé: Jeudi 8 Novembre 2012 16:14:32
Objet: Re: less cores more iops / speed

Am 08.11.2012 14:19, schrieb Mark Nelson:

Quoted 8 lines · Stefan Priebe - Profihost AG
Quoted 5 lines

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

in this case, is fio bouncing around between cores?

Thanks you're correct. If i bind fio to two cores on a 8 core VM it runs with 16.000 iops.

So it is a problem of KVM which let's the processes jump between cores a lot.

Greets,
Stefan

Signature · 7 lines
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in 
the body of a message to [email protected] 
More majordomo info at http://vger.kernel.org/majordomo-info.html 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw
Quoted 7 lines · Alexandre DERUMIER
Quoted 2 lines
Quoted 2 lines

So it is a problem of KVM which let's the processes jump between cores a lot.

maybe numad from redhat can help ?
http://fedoraproject.org/wiki/Features/numad

It's try to keep process on same numa node and I think it's also doing some dynamic pinning.

Numad keeps only memory chunks on the preferred node, cpu pinning, which is a primary goal there, should be done separately via libvirt or manually for qemu process via cpuset(libvirt does pinning via taskset and seems that it is broken at least in debian wheezy - even affinity mask is set for qemu process, load spreads all over numa node, including cpus outside the set).

Quoted 25 lines

----- Mail original -----

De: "Stefan Priebe - Profihost AG" <[email protected]>
À: "Mark Nelson" <[email protected]>
Cc: "Joao Eduardo Luis" <[email protected]>, [email protected] Envoyé: Jeudi 8 Novembre 2012 16:14:32
Objet: Re: less cores more iops / speed

Am 08.11.2012 14:19, schrieb Mark Nelson:

Quoted 8 lines · Stefan Priebe - Profihost AG
Quoted 5 lines

Am 08.11.2012 01:59, schrieb Mark Nelson:

Quoted 2 lines

There's also the context switching overhead. It'd be interesting to know how much the writer processes were shifting around on cores.

What do you mean by that? I'm talking about the KVM guest not about the ceph nodes.

in this case, is fio bouncing around between cores?

Thanks you're correct. If i bind fio to two cores on a 8 core VM it runs with 16.000 iops.

So it is a problem of KVM which let's the processes jump between cores a lot.

Quoted 10 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw
In reply to Alexandre DERUMIER

Am 08.11.2012 16:53, schrieb Alexandre DERUMIER:

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

So it is a problem of KVM which let's the processes jump between cores a lot.

maybe numad from redhat can help ?
http://fedoraproject.org/wiki/Features/numad

It's try to keep process on same numa node and I think it's also doing some dynamic pinning.

numad doesn't help but libvirt seems to support pinning of kvm instances. Maybe pve should support pinning too?

Greets
Stefan