Sendfile is quite clever, especially if you use the pre- and post- header stuff. I think it would be particularly clever in non-blocking mode with the content sent from a single event-driven thread, allowing the connection threads to keep busy on other tasks. However, that would change the semantics of connection processing, i.e., that the connection thread stays around until the content is fully sent so logging, etc. truly happens after the connection close. In practice, AOLserver doesn't provide enough feedback on how content was actually sent (the result code of the send is often ignored) so I don't know that this would make a big difference but the potential for some weird side affect was a reason we didn't dig deeply here. Also, an analysis years ago found most requests ADP and the residual files small and sent from cache quickly anyway.

Overall, a key design assumption for AOLserver has always been that, while respectable, it's not focused on sending static files (not withstanding this thread about sending *dynamically created* files). For example, at AOL the static stuff was always on separate systems -- a specialized "artblaster" (architecturally an AOLserver opposite) and/ or some commercial, geographically distributed, and generally smart CDN -- leaving AOLserver to mostly ADP tasks.

-Jim



On Aug 20, 2008, at 7:59 PM, russell muetzelfeldt wrote:

On 21/08/2008, at 1:45 AM, Jim Davidson wrote:

I looked at the code a bit closer. The ns_returnfile and ns_respond commands both call Ns_ConnReturnFile, the public API to the underlying FastPath. It does more than just blast the content -- it handles:

...
-- caches, mmap's, or simply opens the fd and sends, chunk by chunk

not directly related to the issue at hand, but if this is being worked on shouldn't the file returning be handled by sendfile() on platforms that support it? that'd bypass fastpath, but on linux at least you'd not be wasting RAM by buffering in both the page cache and fastpath, and spitting the data back out the connection socket gets handled entirely in the kernel...

just a thought...


cheers

Russell


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED] > with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to