DNS , file length, and other async issues.

Kevin Burton burtonator at gmail.com
Mon Oct 17 20:12:22 EDT 2011


Hey gang.

A couple issues I noticed that aren't really specified anywhere.

I the HTTP get example in netty you call file.length() which blocks.

It may not seem like much but on a loaded server if your inodes aren't
cached you're going to be stat()ing and this will kill performance.

Is there an 'official' solution to this problem?

Probably have all initial requests to into a "length" queue first which is
bounded before serving them off disk.

If you can keep this out of your event queue this means that files that are
in the page cache can still be served without blocking.

...

on another issue. I don't see a solution for dealing with DNS.

I assume a similar pattern could/should be used.

All initial requests would go into a queue, then A DNS request (caching it
of course) is issued to resolve the name, then the request made and then all
remaining IO handled by Netty.

I'm using a similar pattern for HTTP PUT on JDK 1.6... requests go into a
queue and then that queue is drained and the files written to disk.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20111017/e84183b7/attachment.html 


More information about the netty-users mailing list