Open djs55 opened 6 years ago
Hi team, any updates on this would be appreciated
At one point we were trying to avoid MacOS-isms in an attempt to keep the option of using Hyperkit on other platforms open in the future. I think we've basically given up on that so a PR to switch to kqueue
should be fine.
I had thought that kqueue
was callback based, making it a big rewrite to integrate with the current code structure, but it seems that I was mistaken and it should be possible to replace select
with kqueue
without a lot of non-localised changes.
Have we considered whether multiplexing in vpnkit might be easier though?
Has there been any more discussion around this ? Would love to see it fixed 😄
AFAIK nobody has worked on this. PRs are welcome.
@ijc thanks for the update. I would happily have given this a go but C is not something I'm anywhere near competent in.
The core of hyperkit uses
kqueue
viamevent.c
butpci_virtio_sock.c
uses plain oldselect
.If
hyperkit
is used together withvpnkit
in Docker for Mac and large numbers (> 1024) of connections are port forwarded thenhyperkit
becomes unable to process any moreAF_VSOCK
connections due to theaccept
ed file descriptor being greater thanFD_SETSIZE
, see for example https://github.com/moby/hyperkit/blob/3ace9850121a2ef270e0309a3ff6c2f991357842/src/lib/pci_virtio_sock.c#L1364This manifests as errors under load, for example
from https://github.com/docker/for-mac/issues/2841
This scalability limit could be removed by switching from
select
tokqueue
(orpoll
) inpci_virtio_sock.c
.