MongoDB Nginx Module

Christopher Triolo ctriolo at princeton.edu
Tue Jul 13 17:56:55 MSD 2010


Hey thanks so much for your response!

I'll look into that upstream facility. Looks like thats is exactly what I
need.

Thanks again!
Christopher

On Mon, Jul 12, 2010 at 10:25 PM, agentzh <agentzh at gmail.com> wrote:

> On Tue, Jul 13, 2010 at 5:22 AM, Christopher Triolo
> <christopher.triolo at gmail.com> wrote:
> > I'm in the process of creating a nginx module that serves files from a
> file
> > system within mongoDB.
> > Code is here: http://github.com/mdirolf/nginx-gridfs
> > Basically we embed our C-driver into the module and talk to mongoDB that
> > way.
>
> By looking at the source code, it seems to me that it blocks on I/O. Sigh.
>
> > When the handler is called, it retrieves a file chunk by chunk from
> mongoDB
> > and serves it.
>
> Is it possible to make it non-blocking? Like those using the
> ngx_http_upstream facility?
>
> > I would be very grateful if someone would be able to clear up a few
> things
> > for me, as I still haven't fully wrapped my head around nginx's
> internals...
> > Do I save anything by calling ngx_http_output_filter() for each chunk of
> > data.
>
> Actually, it usually makes things slower if the chunk is too small
> (more invocations of the output filter chain and more writev
> syscalls). We observed a significant performance difference in our
> mysql driver module ngx_drizzle ;)
>
> > If the call to mongoDB blocks the worker process, would it be just the
> same
> > to call ngx_http_output_filter() once for the whole file?
>
> Not really :)
>
> Cheers,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100713/c99cfbc5/attachment.html>


More information about the nginx mailing list