Hey gang.<div><br></div><div>A couple issues I noticed that aren't really specified anywhere.</div><div><br></div><div>I the HTTP get example in netty you call file.length() which blocks.</div><div><br></div><div>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.</div>
<div><br></div><div>Is there an 'official' solution to this problem?</div><div><br></div><div>Probably have all initial requests to into a "length" queue first which is bounded before serving them off disk.</div>
<div><br></div><div>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.</div><div><br></div><div>... </div><div><br></div><div>on another issue. I don't see a solution for dealing with DNS.</div>
<div><br></div><div>I assume a similar pattern could/should be used.</div><div><br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div><div><br></div>