<div dir="ltr">128 threads is out of the question for us primarily due memory concerns when running multiple disks off one server and because of the nature of our ops (high latency, low cpu). Our plugin forwards reads/writes as requests to cloud storage and uses asio to service our socket ops. Our plugin ops are primarily network throughput bound or op latency bound but not cpu bound. 128 threads per disk would be mostly sitting idle and when we run 8 disks on a server we don't want 1000 threads around to have 1000 cloud reads going in parallel when 16 threads would have been more than enough for 8 disks.<div><br></div><div>I have cloned nbdkit from upstream (yesterday) and I am attempting to redo the critical changes into the latest nbdkit code and will post a patch when something is workable. This may take me a few weeks as I am only really able to do this work on nights and weekends right now but we do want to contribute this upstream if possible so others may use a similar async approach to plugin requests rather than the many threads approach.</div><div><br></div><div>The main changes I'm trying to make are</div><div>1) break the recv_request_send_reply function into two distinct steps (recv_request and send_reply)</div><div>2) create an alternative plugin struct (lowlevel? name up for suggestions, fuse uses fuse_lowlevel.h) that requires the plugin functions to call the reply helper funcs (the nbdkit internals don't send replies for this plugin unless an error is returned starting the op)</div><div>3) wrap the existing plugins.c function calls when not a lowlevel plugin to call the new send_reply func as we are not calling that in the recv_request func unless an error is hit before the plugin level</div><div>4) document new lowlevel plugin requirements</div><div><br></div><div> - Shaun<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 21, 2018 at 5:16 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jan 19, 2018 at 12:41:01PM -0500, Shaun McDowell wrote:<br>
[...]<br>
<br>
Thanks for the other email, I thought it was very interesting and I'm<br>
glad that people are looking at the performance of nbdkit seriously.<br>
<span class=""><br>
> Our cbdkit was branched from 1.1.12 with some patches from 1.1.13 added as<br>
> well. The project has morphed significantly enough that a direct diff or<br>
> merging between the two would not be feasible. Even the structure of the<br>
> project directory and build has been changed to be in line with our other<br>
> internal projects.<br>
><br>
> I have uploaded the entire cbdkit source to our github at<br>
> <a href="https://github.com/dev-cloudbd/cbdkit" rel="noreferrer" target="_blank">https://github.com/dev-<wbr>cloudbd/cbdkit</a><br>
</span>[...]<br>
<br>
As you say the structure is quite a lot different, making it difficult<br>
for me to use any of this work at the moment.  I do have a couple of<br>
questions though ...<br>
<br>
- Is a multithreaded approach (as Eric has now implemented) completely<br>
out of the question?  I'm guessing the problem will be with memory<br>
usage for all of those thread stacks.  You mentioned memory usage of<br>
100MB and maybe that's important for your cloud use case?<br>
<br>
- Are you going to try to pull any changes from upstream nbdkit or is<br>
the fork now too large to try?<br>
<br>
I think if you wanted to get any of this upstream [it wasn't really<br>
clear if you do, and of course licensing-wise it's entirely optional<br>
for you to release any changes at all], but if you did then maybe see<br>
if there are simple patches that could go first.<br>
<span class=""><br>
Rich.<br>
<br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~<wbr>rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
</span>Fedora Windows cross-compiler. Compile Windows programs, test, and<br>
build Windows installers. Over 100 libraries supported.<br>
<a href="http://fedoraproject.org/wiki/MinGW" rel="noreferrer" target="_blank">http://fedoraproject.org/wiki/<wbr>MinGW</a><br>
</blockquote></div><br></div>