Skip to contentSkip to conversation

libxl: Increase device model startup timeout to 1min.

PATCH Superseded Anthony PERARD 6 participants 28 messages Jun 26, 2015 – Jul 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: Increase device model startup timeout to 1min.

On a busy host, QEMU may take more than 10s to start.

---
 tools/libxl/libxl_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_internal.h +1 -1
index e96d6b5..3a604f7 100644
@@ -85,7 +85,7 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
Signature · 1 line
Anthony PERARD
#1 lore raw
Quoted 1 line · Anthony PERARD

On a busy host, QEMU may take more than 10s to start.

Please show your working here so that in 2 years when we want to know why this value was chosen we don't have to go scrobbling around in the ML archives looking for the data you gathered.

Quoted 19 lines
---
 tools/libxl/libxl_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_internal.h +1 -1
index e96d6b5..3a604f7 100644
@@ -85,7 +85,7 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
#2 lore raw
Quoted 6 lines · Ian Campbell
Quoted 1 line · Anthony PERARD

On a busy host, QEMU may take more than 10s to start.

Please show your working here so that in 2 years when we want to know why this value was chosen we don't have to go scrobbling around in the ML archives looking for the data you gathered.

OK. What about:

While running the whole stack of OpenStack (install via devstack on Ubuntu) on a single machine, sometime the device model fail to start on time. When this happen, a strace of QEMU shows that it still loading its libraries.

You can find such strace on:
http://lists.xenproject.org/archives/html/xen-devel/2015-06/msg03549.html

What shows the strace is that between a mmap() syscall and the next syscall, 0.5s might have pass.

Normaly, on this same machine it takes 0.32 second on average for QEMU to start, while running Tempest (which is the OpenStack test suite). Those QEMU are runned as backend for a PV guest.

Quoted 21 lines
Quoted 19 lines
---
 tools/libxl/libxl_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_internal.h +1 -1
index e96d6b5..3a604f7 100644
@@ -85,7 +85,7 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
Signature · 1 line
Anthony PERARD
#3 lore raw
Quoted 9 lines · Anthony PERARD
Quoted 6 lines · Ian Campbell
Quoted 1 line · Anthony PERARD

On a busy host, QEMU may take more than 10s to start.

Please show your working here so that in 2 years when we want to know why this value was chosen we don't have to go scrobbling around in the ML archives looking for the data you gathered.

OK. What about:

I'm afraid none of that really explains why QEMU taking >10s is reasonable/expected under the circumstances or why 60s is a good choice now.

Nor does it really answer Ian's question in <[email protected]> I think.

Ian.

Quoted 37 lines

While running the whole stack of OpenStack (install via devstack on Ubuntu) on a single machine, sometime the device model fail to start on time. When this happen, a strace of QEMU shows that it still loading its libraries.

You can find such strace on:
http://lists.xenproject.org/archives/html/xen-devel/2015-06/msg03549.html

What shows the strace is that between a mmap() syscall and the next syscall, 0.5s might have pass.

Normaly, on this same machine it takes 0.32 second on average for QEMU to start, while running Tempest (which is the OpenStack test suite). Those QEMU are runned as backend for a PV guest.

Quoted 21 lines
Quoted 19 lines
---
 tools/libxl/libxl_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_internal.h +1 -1
index e96d6b5..3a604f7 100644
@@ -85,7 +85,7 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
#4 lore raw
Quoted 9 lines · Ian Campbell
Quoted 8 lines · Anthony PERARD
Quoted 6 lines · Ian Campbell
Quoted 1 line · Anthony PERARD

On a busy host, QEMU may take more than 10s to start.

Please show your working here so that in 2 years when we want to know why this value was chosen we don't have to go scrobbling around in the ML archives looking for the data you gathered.

Quoted 8 lines
Quoted 1 line

OK. What about:

I'm afraid none of that really explains why QEMU taking >10s is reasonable/expected under the circumstances or why 60s is a good choice now.

Nor does it really answer Ian's question in <[email protected]> I think.

I only know what happen, not why it happen.

How could I investigate why qemu is taking so long after an mmap() syscall? I guest at that time, it is copying the library into memory.

Signature · 1 line
Anthony PERARD
#5 lore raw
Quoted 9 lines · Anthony PERARD
Quoted 8 lines · Ian Campbell
Quoted 1 line · Anthony PERARD

OK. What about:

I'm afraid none of that really explains why QEMU taking >10s is reasonable/expected under the circumstances or why 60s is a good choice now.

Quoted 8 lines
Quoted 2 lines

Nor does it really answer Ian's question in <[email protected]> I think.

I only know what happen, not why it happen.

How could I investigate why qemu is taking so long after an mmap() syscall? I guest at that time, it is copying the library into memory.

Is there a lot of CPU / memory contention in Dom0 (assuming that QEMU runs in dom0 in this case)?

If yes, is it plausible for that to be the cause?

If yes, can we show, or monitor, or trace it somehow? That would be a first step toward trying to figure out what specific characteristic of the contended scenario causes the issue...

Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
In reply to Anthony PERARD

Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 8 lines · Ian Campbell
Quoted 2 lines

Nor does it really answer Ian's question in <[email protected]> I think.

I only know what happen, not why it happen.

How could I investigate why qemu is taking so long after an mmap() syscall? I guest at that time, it is copying the library into memory.

Is the machine very busy at this time ?

If this is a stress test of some kind then I guess there are three possible views:

* The number and nature of parallel operations done in the stress test is unreasonable for the provided hardware:
=> the timeout is fine

* The number and nature of parallel operations is reasonable for the provided hardware, and should not result in the toolstack domain being overloaded to the point where ld.so on qemu takes so long => the timeout is correct and there is an underlying bug (perhaps in Linux)

* The number and nature of parallel operations is reasonable for the hardware, but might easily result in long delays in ld.so assembling qemu - that is, people expect to deploy Xen and then cause their toolstack domain to be massively `overloaded' and very slow
=> the timeout is too short

In the third case we probably need a general-purpose facility for adjusting timeouts in general. People who do not expect to overload their toolstack domain should not be made to await massive timeout values designed for people who do.

Ian.

#7 lore raw
Quoted 10 lines · Ian Jackson

Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 8 lines · Ian Campbell
Quoted 2 lines

Nor does it really answer Ian's question in <[email protected]> I think.

I only know what happen, not why it happen.

How could I investigate why qemu is taking so long after an mmap() syscall? I guest at that time, it is copying the library into memory.

Quoted 8 lines

Is the machine very busy at this time ?

If this is a stress test of some kind then I guess there are three possible views:

* The number and nature of parallel operations done in the stress test is unreasonable for the provided hardware:
=> the timeout is fine

I don't know if it is our place to make this call. Should we really be deciding what is considered "reasonable"? I think not. Defining what is reasonable and policies that match it is not a route I think we should take in libxl.

Quoted 13 lines

* The number and nature of parallel operations is reasonable for the provided hardware, and should not result in the toolstack domain being overloaded to the point where ld.so on qemu takes so long => the timeout is correct and there is an underlying bug (perhaps in Linux)

* The number and nature of parallel operations is reasonable for the hardware, but might easily result in long delays in ld.so assembling qemu - that is, people expect to deploy Xen and then cause their toolstack domain to be massively `overloaded' and very slow
=> the timeout is too short

Quoted 4 lines

In the third case we probably need a general-purpose facility for adjusting timeouts in general. People who do not expect to overload their toolstack domain should not be made to await massive timeout values designed for people who do.

But they are not actually made to await any timeouts: the timeout is only to check whether QEMU started. Users are only made to await timeouts in case of errors. Is that what you meant?
In the normal case, we could have a timeout of 1h and users wouldn't tell the difference.

#8 lore raw

Stefano Stabellini writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 8 lines · Ian Jackson
Quoted 6 lines

Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

In the third case we probably need a general-purpose facility for adjusting timeouts in general. People who do not expect to overload their toolstack domain should not be made to await massive timeout values designed for people who do.

Quoted 5 lines

But they are not actually made to await any timeouts: the timeout is only to check whether QEMU started. Users are only made to await timeouts in case of errors. Is that what you meant?
In the normal case, we could have a timeout of 1h and users wouldn't tell the difference.

Sadly errors are far not uncommon. Making someone wait 1h for an inevitable error message would be quite unreasonable.

Quoted 8 lines
Quoted 3 lines

* The number and nature of parallel operations done in the stress test is unreasonable for the provided hardware:
=> the timeout is fine

I don't know if it is our place to make this call. Should we really be deciding what is considered "reasonable"? I think not. Defining what is reasonable and policies that match it is not a route I think we should take in libxl.

Nevertheless if we are defining timeouts we are implicitly setting some parameters which imply that certain configurations are unreasonable. Hopefully all such configurations are absurd.

If what you mean is that our bounds of `reasonable' should be very wide, then I agree. If anyone could reasonably expect it to work, then that is fine. Certainly we should refrain fromk subjective judgements.

Ian.

#9 lore raw
Quoted 9 lines · Ian Jackson
Quoted 8 lines
Quoted 3 lines

* The number and nature of parallel operations done in the stress test is unreasonable for the provided hardware:
=> the timeout is fine

I don't know if it is our place to make this call. Should we really be deciding what is considered "reasonable"? I think not. Defining what is reasonable and policies that match it is not a route I think we should take in libxl.

Quoted 8 lines

Nevertheless if we are defining timeouts we are implicitly setting some parameters which imply that certain configurations are unreasonable. Hopefully all such configurations are absurd.

If what you mean is that our bounds of `reasonable' should be very wide, then I agree. If anyone could reasonably expect it to work, then that is fine. Certainly we should refrain fromk subjective judgements.

OK. How do you measure reasonable for this case?

What I actually mean to ask is how do you suggest we proceed on this problem?

Of course it would be nice if we knew exactly why this is happening, but the issue only happens once every 2-3 tempest runs, each of them takes about 1 hour. Tempest executes about 1300 tests for each run, some of them in parallel. We haven't taken the time to read all the tests run by tempest so we don't know exactly what they do.

We don't really know the environment that causes the failure. Reading all the tests is not an option. We could try adding more tracing to the system, but given the type of error, if we do we are not likely to reproduce the error at all, or maybe reproduce something different.

Given the state of things, I suggest we make sure that increasing the timeout actually fixes/works-around the problem. I would also like to see some empirical measurements that tell us by how much we should increase the timeout. Is 1 minute actually enough?

I would not go as far as asking to figure out what the real cause of the problem is, because there is no way to estimate how long is going to take or even how to do that. And in the meantime we still have spurious failures in the OpenStack CI-loop.

Alternatively we could carry the work around in the Xen package we build for the OpenStack CI-loop, leaving xen-unstable "unfixed", but I think that would be less desirable.

#10 lore raw
Quoted 36 lines · Stefano Stabellini
Quoted 9 lines · Ian Jackson
Quoted 8 lines
Quoted 3 lines

* The number and nature of parallel operations done in the stress test is unreasonable for the provided hardware:
=> the timeout is fine

I don't know if it is our place to make this call. Should we really be deciding what is considered "reasonable"? I think not. Defining what is reasonable and policies that match it is not a route I think we should take in libxl.

Quoted 8 lines

Nevertheless if we are defining timeouts we are implicitly setting some parameters which imply that certain configurations are unreasonable. Hopefully all such configurations are absurd.

If what you mean is that our bounds of `reasonable' should be very wide, then I agree. If anyone could reasonably expect it to work, then that is fine. Certainly we should refrain fromk subjective judgements.

OK. How do you measure reasonable for this case?

What I actually mean to ask is how do you suggest we proceed on this problem?

Of course it would be nice if we knew exactly why this is happening, but the issue only happens once every 2-3 tempest runs, each of them takes about 1 hour. Tempest executes about 1300 tests for each run, some of them in parallel. We haven't taken the time to read all the tests run by tempest so we don't know exactly what they do.

We don't really know the environment that causes the failure. Reading all the tests is not an option. We could try adding more tracing to the system, but given the type of error, if we do we are not likely to reproduce the error at all, or maybe reproduce something different.

Quoted 4 lines

Given the state of things, I suggest we make sure that increasing the timeout actually fixes/works-around the problem. I would also like to see some empirical measurements that tell us by how much we should increase the timeout. Is 1 minute actually enough?

I have tested an increase timeout this night. And here are the result.

The machine is a AMD Opteron(tm) Processor 4284, with 8G of RAM and 8 pCPU. It's running Ubuntu 14.04, with Xen 4.4. On top of that, OpenStack have been deployed via devstack on a single.

The test is to run Tempest with --concurrency=4. There are 4 tests runned in parallel, but they don't necessarly start a VM. When they do, it's a PV with 64MB and 1 vCPU and sometime with double amount of RAM.

The stats:
Tempest run: 22
Tempest run time for each run: ~3000s
Tempest number of test: 1143
after 22 run of tempest:
QEMU start: 3352
number of run that took more than 2s: 20
number of run that took more than 9s: 6
maximum start time: 10.973713s

I have gathered the QEMU start time by having strace running for each of them. I have then look at the time it took from the first syscall execve('qemu') until the syscall where QEMU respond on its QMP socket (libxl have acknoledge that QEMU is running at that time).

Signature · 1 line
Anthony PERARD
#11 lore raw

Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 20 lines

I have tested an increase timeout this night. And here are the result.

The machine is a AMD Opteron(tm) Processor 4284, with 8G of RAM and 8 pCPU. It's running Ubuntu 14.04, with Xen 4.4. On top of that, OpenStack have been deployed via devstack on a single.

The test is to run Tempest with --concurrency=4. There are 4 tests runned in parallel, but they don't necessarly start a VM. When they do, it's a PV with 64MB and 1 vCPU and sometime with double amount of RAM.

The stats:
Tempest run: 22
Tempest run time for each run: ~3000s
Tempest number of test: 1143
after 22 run of tempest:
QEMU start: 3352
number of run that took more than 2s: 20
number of run that took more than 9s: 6
maximum start time: 10.973713s

Quoted 4 lines

I have gathered the QEMU start time by having strace running for each of them. I have then look at the time it took from the first syscall execve('qemu') until the syscall where QEMU respond on its QMP socket (libxl have acknoledge that QEMU is running at that time).

Thanks for this information.

So from what you say it appears that we are running at most 4 copies of libxl and qemu in parallel, along with at most 4 VMs ?

And out of 3352 qemu starts, we have

      <= 2s   3332
Quoted 2 lines

2s <= 9s 14
9s 6

?

Do you have any information about the maximum system load in general ? dom0 load, vcpu overcommit, etc. ? Do you know what the guests are doing ?

I'm starting to think that this might be a real bug but that the bug might be "Linux's I/O subsystem sometimes produces appalling latency under load" (which is hardly news).

Ian.

#12 lore raw
Quoted 26 lines · Ian Jackson

Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 20 lines

I have tested an increase timeout this night. And here are the result.

The machine is a AMD Opteron(tm) Processor 4284, with 8G of RAM and 8 pCPU. It's running Ubuntu 14.04, with Xen 4.4. On top of that, OpenStack have been deployed via devstack on a single.

The test is to run Tempest with --concurrency=4. There are 4 tests runned in parallel, but they don't necessarly start a VM. When they do, it's a PV with 64MB and 1 vCPU and sometime with double amount of RAM.

The stats:
Tempest run: 22
Tempest run time for each run: ~3000s
Tempest number of test: 1143
after 22 run of tempest:
QEMU start: 3352
number of run that took more than 2s: 20
number of run that took more than 9s: 6
maximum start time: 10.973713s

Quoted 4 lines

I have gathered the QEMU start time by having strace running for each of them. I have then look at the time it took from the first syscall execve('qemu') until the syscall where QEMU respond on its QMP socket (libxl have acknoledge that QEMU is running at that time).

Quoted 4 lines

Thanks for this information.

So from what you say it appears that we are running at most 4 copies of libxl and qemu in parallel, along with at most 4 VMs ?

Some test do run 3 VM, so at most it would be 12 VM. I think that still only one copy of libxl since everythings goes through libvirt, right?

Quoted 9 lines

And out of 3352 qemu starts, we have

      <= 2s   3332
Quoted 2 lines

2s <= 9s 14
9s 6

?

Do you have any information about the maximum system load in general ? dom0 load, vcpu overcommit, etc. ? Do you know what the guests are doing ?

I've got some stat collected via dstat.
During the tests, the load average can go from 5 to 8 in dom0. The CPUs in dom0 can spend quite a lot of time waiting, it's not rare to see beetween 35 and 60% of time waiting (total of all 8 cpu). As for the disk, dstat reveal that there is often between 50M and 120M per second of total disk write.

The guests usully does not do much, beside booting. It run a small system call CirrOS.

Quoted 3 lines

I'm starting to think that this might be a real bug but that the bug might be "Linux's I/O subsystem sometimes produces appalling latency under load" (which is hardly news).

I guess the straces support this, here are few quote from different strace:
04:11:50.602067 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000036>
04:11:50.602166 open("/usr/lib/x86_64-linux-gnu/libidn.so.11", O_RDONLY|O_CLOEXEC) = 3 <0.000039>
04:11:50.602263 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300+\0\0\0\0\0\0"..., 832) = 832 <0.000035> 04:11:50.602359 fstat(3, {st_mode=S_IFREG|0644, st_size=207128, ...}) = 0 <0.000033>
04:11:50.602453 mmap(NULL, 2302208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f845b9f8000 <0.000036> 04:11:50.602546 mprotect(0x7f845ba29000, 2097152, PROT_NONE) = 0 <0.000037>
04:11:50.602639 mmap(0x7f845bc29000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f845bc29000 <0.000038>
04:11:51.257654 close(3) = 0 <0.000042>
04:11:51.257859 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000078>

18:08:37.635570 open("/usr/lib/x86_64-linux-gnu/sasl2/libcrammd5.so", O_RDONLY|O_CLOEXEC) = 28 <0.000050> 18:08:37.635681 read(28, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\20\0\0\0\0\0\0"..., 832) = 832 <1.011536> 18:08:38.647329 fstat(28, {st_mode=S_IFREG|0644, st_size=22592, ...}) = 0 <0.000042>
18:08:38.647499 mmap(NULL, 2117872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 28, 0) = 0x7f6c29128000 <0.000048> 18:08:38.647613 mprotect(0x7f6c2912c000, 2097152, PROT_NONE) = 0 <0.000049>
18:08:38.647721 mmap(0x7f6c2932c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 28, 0x4000) = 0x7f6c2932c000 <0.000043>
18:08:38.647862 close(28) = 0 <0.000035>

The first quote is a pattern I'm seeing very often on slow dm start, where it take a long time between the mmap and the next syscall. On the second quote, read() is to blame, it took 1s.

I guess even the first quote imply there is going to be I/O after the mmap call, isn't it?

Signature · 1 line
Anthony PERARD
#13 lore raw

Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 6 lines · Ian Jackson
Quoted 3 lines

I'm starting to think that this might be a real bug but that the bug might be "Linux's I/O subsystem sometimes produces appalling latency under load" (which is hardly news).

I guess the straces support this, here are few quote from different strace:

...

Quoted 2 lines

04:11:50.602639 mmap(0x7f845bc29000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f845bc29000 <0.000038>
04:11:51.257654 close(3) = 0 <0.000042>

...

Quoted 6 lines

The first quote is a pattern I'm seeing very often on slow dm start, where it take a long time between the mmap and the next syscall. On the second quote, read() is to blame, it took 1s.

I guess even the first quote imply there is going to be I/O after the mmap call, isn't it?

It's very likely, yes. The code after mmap will probably start reading the pages just mapped.

Thanks for this investigation.

I am now convinced that this is indeed the bug "Linux's I/O subsystem sometimes produces appalling latency under load". That bug has existed for at least a decade and seems unlikely to be fixed any time soon. Certainly, fixing it is beyond our scope.

So papering over this with an increase in the timeout is probably proper. I'm tempted to suggest increasing the timeout only on Linux.

Ian.

#14 lore raw
Quoted 2 lines · Ian Jackson

So papering over this with an increase in the timeout is probably proper.

Yes :-/

Quoted 1 line

I'm tempted to suggest increasing the timeout only on Linux.

How tempted? Or shall I apply this patch?

Ian.

#15 lore raw

Ian Campbell writes ("Re: [PATCH] libxl: Increase device model startup timeout to 1min."):

Quoted 9 lines · Ian Jackson
Quoted 2 lines

So papering over this with an increase in the timeout is probably proper.

Yes :-/

Quoted 1 line

I'm tempted to suggest increasing the timeout only on Linux.

How tempted? Or shall I apply this patch?

I guess I don't want to insist on a pile of #ifdefery. But can we have a resubmission with a comment that makes it clear that this is due to a Linux-specific bug ? The comment could steal some of my words from earlier in this thread.

Ian.

#16 lore raw

PATCH v2 1/1 libxl: Increase device model startup timeout to 1min.

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

---
 tools/libxl/libxl_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_internal.h +1 -1
index e96d6b5..3a604f7 100644
@@ -85,7 +85,7 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
Signature · 1 line
Anthony PERARD
#17 lore raw

Anthony PERARD writes ("[PATCH V2] libxl: Increase device model startup timeout to 1min."):

Quoted 5 lines

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Please

tools/libxl/libxl_internal.h line 89

Quoted 4 lines

#define LIBXL_HOTPLUG_TIMEOUT 10

tools/libxl/libxl_internal.h +1 -1
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30

can that information be in a comment in the code, as well as in a commit message ?

Thanks,
Ian.

#18 lore raw

PATCH v3 1/1 libxl: Increase device model startup timeout to 1min.

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

---
 tools/libxl/libxl_internal.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/libxl/libxl_internal.h +3 -1
index d52589e..d6f87c1 100644
@@ -85,7 +85,9 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+/* QEMU may be slow to load and start due to a bug in Linux where the I/O
+ * subsystem sometime produce high latency under load. */
+#define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
Signature · 1 line
Anthony PERARD
Acked-by on v3 1/1
#19 lore raw

Anthony PERARD writes ("[PATCH V3] libxl: Increase device model startup timeout to 1min."):

Quoted 5 lines

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Applied
#20 lore raw
Quoted 8 lines · Ian Jackson

Anthony PERARD writes ("[PATCH V3] libxl: Increase device model startup timeout to 1min."):

Quoted 5 lines

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Applied.

#21 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 07.07.15 at 17:41, <[email protected]> wrote:
Quoted 1 line · Ian Jackson

Anthony PERARD writes ("[PATCH V3] libxl: Increase device model startup

timeout to 1min."):

Quoted 2 lines
Quoted 2 lines

On a busy host, QEMU may take more than 10s to load and start.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Applied.

So is this the "answer" to "Problems with merlot* AMD Opteron 6376 systems"?

Jan

#22 lore raw
Quoted 10 lines · Jan Beulich
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 07.07.15 at 17:41, <[email protected]> wrote:
Quoted 1 line · Ian Jackson

Anthony PERARD writes ("[PATCH V3] libxl: Increase device model startup

timeout to 1min."):

Quoted 6 lines
Quoted 5 lines

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied.

So is this the "answer" to "Problems with merlot* AMD Opteron 6376 systems"?

It'll be hard to say until this change gets through the Xen push gate and that version gets used for other branches (linux testing, libvirt, ovmf, osstest's own gate etc).

At the moment it looks like it has helped with some but not all of the issues.

These:

http://logs.test-lab.xenproject.org/osstest/results/host/merlot0.html
http://logs.test-lab.xenproject.org/osstest/results/host/merlot1.html

still don't look brilliant, even if you only pay attention to the xen-unstable lines.

Ian.

#23 lore raw
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 07.07.15 at 17:41, <[email protected]> wrote:
Quoted 1 line · Ian Jackson

Anthony PERARD writes ("[PATCH V3] libxl: Increase device model startup

timeout to 1min."):

Quoted 7 lines
Quoted 5 lines

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Applied.

So is this the "answer" to "Problems with merlot* AMD Opteron 6376 systems"?

It'll be hard to say until this change gets through the Xen push gate and that version gets used for other branches (linux testing, libvirt, ovmf, osstest's own gate etc).

Indeed. My opinion is that no, it is not.

My understanding of the data Anthony provided is that, under some (difficult to track/analyze/reproduce/etc) load conditions, the Linux IO and VM subsystem suffer from high latency, delaying QEMU startup.

In the merlot* cases, the system is completely idle, apart from the failing creation/migration operation.

So, no, I don't think that would not be the fix we need for that situation.

Quoted 8 lines

At the moment it looks like it has helped with some but not all of the issues.

These:

http://logs.test-lab.xenproject.org/osstest/results/host/merlot0.html
http://logs.test-lab.xenproject.org/osstest/results/host/merlot1.html

Can I ask why (I mean, e.g., comparing what with what) you're saying it seems to have helped?

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#24 lore raw
Quoted 29 lines · Dario Faggioli
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 07.07.15 at 17:41, <[email protected]> wrote:
Quoted 1 line · Ian Jackson

Anthony PERARD writes ("[PATCH V3] libxl: Increase device model startup

timeout to 1min."):

Quoted 7 lines
Quoted 5 lines

On a busy host, QEMU may take more than 10s to load and start.

This is likely due to a bug in Linux where the I/O subsystem sometime produce high latency under load and result in QEMU taking a long time to load every single dynamic libraries.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Applied.

So is this the "answer" to "Problems with merlot* AMD Opteron 6376 systems"?

It'll be hard to say until this change gets through the Xen push gate and that version gets used for other branches (linux testing, libvirt, ovmf, osstest's own gate etc).

Indeed. My opinion is that no, it is not.

My understanding of the data Anthony provided is that, under some (difficult to track/analyze/reproduce/etc) load conditions, the Linux IO and VM subsystem suffer from high latency, delaying QEMU startup.

Quoted 5 lines

In the merlot* cases, the system is completely idle, apart from the failing creation/migration operation.

So, no, I don't think that would not be the fix we need for that situation.

Even if it is not the correct fix it seems like in some situations the increase in timeout has improved things, hence it is an "answer" as Jan asked (his quote marks).

Quoted 10 lines
Quoted 8 lines

At the moment it looks like it has helped with some but not all of the issues.

These:

http://logs.test-lab.xenproject.org/osstest/results/host/merlot0.html
http://logs.test-lab.xenproject.org/osstest/results/host/merlot1.html

Can I ask why (I mean, e.g., comparing what with what) you're saying it seems to have helped?

There seemed (unscientifically) to be fewer of the libvirt related guest-start failures.

Ian.

#25 lore raw
Quoted 16 lines · Ian Campbell
Quoted 15 lines · Dario Faggioli
Quoted 4 lines · Ian Campbell

It'll be hard to say until this change gets through the Xen push gate and that version gets used for other branches (linux testing, libvirt, ovmf, osstest's own gate etc).

Indeed. My opinion is that no, it is not.

My understanding of the data Anthony provided is that, under some (difficult to track/analyze/reproduce/etc) load conditions, the Linux IO and VM subsystem suffer from high latency, delaying QEMU startup.

In the merlot* cases, the system is completely idle, apart from the failing creation/migration operation.

Quoted 7 lines
Quoted 2 lines

So, no, I don't think that would not be the fix we need for that situation.

Even if it is not the correct fix it seems like in some situations the increase in timeout has improved things, hence it is an "answer" as Jan asked (his quote marks).

Sure! And that's why I find this weird/interesting...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

At the moment it looks like it has helped with some but not all of the issues.

These:

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

http://logs.test-lab.xenproject.org/osstest/results/host/merlot0.html
http://logs.test-lab.xenproject.org/osstest/results/host/merlot1.html

Can I ask why (I mean, e.g., comparing what with what) you're saying it seems to have helped?

There seemed (unscientifically) to be fewer of the libvirt related guest-start failures.

And you mean by only looking at xen-unstable lines, don't you?

If yes, looking at merlot0, I've found the below.

Old timeout, failing:
http://logs.test-lab.xenproject.org/osstest/logs/59105/test-amd64-amd64-libvirt-xsm/info.html

New timeout, success:
http://logs.test-lab.xenproject.org/osstest/logs/59311/test-amd64-amd64-libvirt/info.html

And, looking at how long QEMU did take to start up that would be:

13:44:32 - 13:43:42

i.e., just a bit less than 1min!

So, yes, it looks that this change is actually going to help in this case.

What I'm missing is how it is possible that, on an idle system, DM spawning takes that long. As said, in Anthony's OpenStack case, the system was quite busy... not that it can't be a bug (somewhere, perhaps in Linux) in that case too, but here, it looks even more weird to me.

May it be the NUMA misconfiguration? Well, if yes, I'm not sure how...

Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#26 lore raw
Quoted 28 lines · Dario Faggioli
Quoted 11 lines · Ian Campbell
Quoted 5 lines · Dario Faggioli
Quoted 3 lines

http://logs.test-lab.xenproject.org/osstest/results/host/merlot0.html
http://logs.test-lab.xenproject.org/osstest/results/host/merlot1.html

Can I ask why (I mean, e.g., comparing what with what) you're saying it seems to have helped?

There seemed (unscientifically) to be fewer of the libvirt related guest-start failures.

Old timeout, failing:
http://logs.test-lab.xenproject.org/osstest/logs/59105/test-amd64-amd64-libvirt-xsm/info.html

New timeout, success:
http://logs.test-lab.xenproject.org/osstest/logs/59311/test-amd64-amd64-libvirt/info.html

And, looking at how long QEMU did take to start up that would be:

13:44:32 - 13:43:42

i.e., just a bit less than 1min!

So, yes, it looks that this change is actually going to help in this case.

Quoted 7 lines

What I'm missing is how it is possible that, on an idle system, DM spawning takes that long. As said, in Anthony's OpenStack case, the system was quite busy... not that it can't be a bug (somewhere, perhaps in Linux) in that case too, but here, it looks even more weird to me.

May it be the NUMA misconfiguration? Well, if yes, I'm not sure how...

BTW, Ian, perhaps it's not that urgent, but how cumbersome would it be to setup a few ad-hoc flights, like you did here:

http://logs.test-lab.xenproject.org/osstest/logs/58853/

when also doing what Anthony was doing for stracing QEMU, as he described in here:

http://bugs.xenproject.org/xen/mid/%[email protected]%3E

I'm not sure what we could find, nor whether we should expect the strace to be similar to Anthony's. Perhaps not, as the system here is idle, and perhaps something would highlight or hint at where to look in this specific case... Or maybe none of the above, but it may be worth a try.

If there is anything I can do for helping setting this up, just let me know (here or on IRC).

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#27 lore raw
Quoted 6 lines · Dario Faggioli

BTW, Ian, perhaps it's not that urgent, but how cumbersome would it be to setup a few ad-hoc flights, like you did here:

http://logs.test-lab.xenproject.org/osstest/logs/58853/

when also doing what Anthony was doing for stracing QEMU,

"Fairly cumbersome", someone would have to develop and test some code in osstest to allow the switching in of a device model wrapper and for collecting the results afterwards.

Those previous adhoc flights were simple because they just involved rerunning existing jobs in the same configuration and with the same harness code.

I'm afraid that for a "to see what we see" experiment the effort I have outweighs the predicted information gain for this.

If someone were to provide a tested and working osstest patch I could probably throw it through a few runs with minimal effort though.

Quoted 15 lines

as he
described in here:

http://bugs.xenproject.org/xen/mid/%[email protected]%3E

I'm not sure what we could find, nor whether we should expect the strace to be similar to Anthony's. Perhaps not, as the system here is idle, and perhaps something would highlight or hint at where to look in this specific case... Or maybe none of the above, but it may be worth a try.

If there is anything I can do for helping setting this up, just let me know (here or on IRC).

Regards,
Dario