Hey thanks so much for your response!<br><br><div>I&#39;ll look into that upstream facility. Looks like thats is exactly what I need.</div><div><br></div><div>Thanks again!</div><div>Christopher</div><div><br><div class="gmail_quote">
On Mon, Jul 12, 2010 at 10:25 PM, agentzh <span dir="ltr">&lt;<a href="mailto:agentzh@gmail.com">agentzh@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Jul 13, 2010 at 5:22 AM, Christopher Triolo<br>
&lt;<a href="mailto:christopher.triolo@gmail.com">christopher.triolo@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;m in the process of creating a nginx module that serves files from a file<br>
&gt; system within mongoDB.<br>
&gt; Code is here: <a href="http://github.com/mdirolf/nginx-gridfs" target="_blank">http://github.com/mdirolf/nginx-gridfs</a><br>
&gt; Basically we embed our C-driver into the module and talk to mongoDB that<br>
&gt; way.<br>
<br>
</div>By looking at the source code, it seems to me that it blocks on I/O. Sigh.<br>
<div class="im"><br>
&gt; When the handler is called, it retrieves a file chunk by chunk from mongoDB<br>
&gt; and serves it.<br>
<br>
</div>Is it possible to make it non-blocking? Like those using the<br>
ngx_http_upstream facility?<br>
<div class="im"><br>
&gt; I would be very grateful if someone would be able to clear up a few things<br>
&gt; for me, as I still haven&#39;t fully wrapped my head around nginx&#39;s internals...<br>
&gt; Do I save anything by calling ngx_http_output_filter() for each chunk of<br>
&gt; data.<br>
<br>
</div>Actually, it usually makes things slower if the chunk is too small<br>
(more invocations of the output filter chain and more writev<br>
syscalls). We observed a significant performance difference in our<br>
mysql driver module ngx_drizzle ;)<br>
<div class="im"><br>
&gt; If the call to mongoDB blocks the worker process, would it be just the same<br>
&gt; to call ngx_http_output_filter() once for the whole file?<br>
<br>
</div>Not really :)<br>
<br>
Cheers,<br>
<font color="#888888">-agentzh<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>