<div dir="ltr">Thank you for your reply.<div>According to what you said, I set open files to 1024 and solved the problem.</div><div>Thanks!</div><div><br></div><div>-------<br><div>Sorry for not mentioning the version information.</div></div><div>The version of libvirt is 4.5.0.</div><div><br></div><div>Regards,<br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Daniel P. Berrangé <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> 于2019年11月4日周一 下午6:04写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Nov 04, 2019 at 04:55:07PM +0800, John Y. wrote:<br>
> 1.  It takes minutes to start the virtual machine when I add "filterref" to<br>
> libvirt.xml and run command "virsh start  vm1".<br>
> It also takes minutes to destroy the virtual machine.<br>
<br>
You don't mention which version of libvirt you have...<br>
<br>
My guess is that your docker container has set an enourmous ulimit<br>
for max files. On a normal host it is 1024, but on docker I've seen<br>
it default to 1 million.<br>
<br>
This impacts libvirt when it spawns processes, which is common with<br>
nwfilter in particular, because we must close all open file handles.<br>
In v5.6.0 we  added code to let libvirt use /proc/$PID/fd to close<br>
file handles, which is massively faster when ulimits are high.<br>
<br>
<br>
Regards,<br>
Daniel<br>
-- <br>
|: <a href="https://berrange.com" rel="noreferrer" target="_blank">https://berrange.com</a>      -o-    <a href="https://www.flickr.com/photos/dberrange" rel="noreferrer" target="_blank">https://www.flickr.com/photos/dberrange</a> :|<br>
|: <a href="https://libvirt.org" rel="noreferrer" target="_blank">https://libvirt.org</a>         -o-            <a href="https://fstop138.berrange.com" rel="noreferrer" target="_blank">https://fstop138.berrange.com</a> :|<br>
|: <a href="https://entangle-photo.org" rel="noreferrer" target="_blank">https://entangle-photo.org</a>    -o-    <a href="https://www.instagram.com/dberrange" rel="noreferrer" target="_blank">https://www.instagram.com/dberrange</a> :|<br>
<br>
</blockquote></div>