Liam - i asked Ben about exposing the fd on the socket handle so linux
folks could use sendfile but it seems the core team don't really want
to do that. there was a mention of providing a sendfile and/or pipe
between two handles internally in the c++ code at some stage, but my
feeling was that this is some way off. my patch has nothing to do with
big changes to the c++ - it is just a patch to expose the fd so i can
pass it to the fs.sendfile system call.

Matt - there's no need to be so rude, especially to one of the best
guys in the community. from what i understand nginx will cache small
files in memory if configured to do so and it will also use sendfile
if configured to do so. when using sendfile, there could be a blocking
operation if the file has not been cached by the kernel, but once it's
in memory then subsequent requests should be as fast as possible and
most of the work will be done in the kernel. the difference between
using sendfile from v8/node.js and directly from c/c++ is very small
from the testing i have done. getting close to nginx performance is
definitely achievable, but probably not using the standard node.js
libs (at least not right now anyway). the only way i have got good
performance is to use the c++ bindings directly along with sendfile.
i'll post up a benchmark asap which should shed some light on all
this.

On Feb 14, 10:45 am, Liam <[email protected]> wrote:
> There's an issue filed for a sendfile-based http/socket 
> transfers,https://github.com/joyent/node/issues/1802
>
> It entails a fairly significant revision to the net.Socket queue
> mechanism. I don't know of anyone working on that.
>
> On Feb 13, 3:47 pm, billywhizz <[email protected]> wrote:
>
>
>
>
>
>
>
> > from tests i have done using the low level node.js bindings and
> > sendfile on linux (which requires a small patch to the node.js c++
> > source), node.js can get pretty close to nginx (within 10-20%) for
> > serving static files. the larger the files, the smaller the difference
> > as most of the work is then being done in the kernel. i'm pretty
> > confident with some further work and improvements in the node.js
> > internals that the difference between it and nginx will be negligible,
> > and you will have the advantage with node.js that you can serve very
> > rich applications from the same process as the static files. one thing
> > node.js will never beat nginx on will be memory usage however...
>
> > i'll publish a benchmark up here when i get a chance - hopefully in
> > next few days.
>
> > On Feb 13, 11:18 pm, Matt <[email protected]> wrote:
>
> > > On Mon, Feb 13, 2012 at 4:28 PM, Tim Caswell <[email protected]> wrote:
> > > > But node wins over apache and nginx by having the right
> > > > event model.
>
> > > Maybe over Apache, but you need to read more about nginx.
>
> > > >  Node serving a static file from
> > > > memory is faster than nginx serving the same file from disk.
>
> > > Benchmarks please. I very much doubt that.
>
> > > Matt.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to