|
Saturday, December 12, 2009
Reverse lookup will bite you
Atrocious performance in a cluster or other cross-host forwarding/proxying scenario? Maybe your app (or the container) is doing a reverse lookup, timing out on a failed DNS call, and generally tying up the whole app. We had this situation with Tomcat and Nginx on two separate machines, communicating on a private network. Going directly to Tomcat via the public NIC gave great performance. But going through Nginx yielded horrible performance (20s or so for a page transition in our app.) Going through an ssh tunnel to the private NIC was equally terrible. I tried tunneling through 3 separate machines on the same private network, and they all exhibited the same slowdown. The solution is deliciously simple. Just add an entry for the proxy host to the Tomcat host's /etc/hosts file. (Actually, in our case it's a Win 2008 Server, so it's /windows/system32/drivers/etc/hosts). That way, Tomcat (or the app it's running) can do its reverse lookup by hitting the hosts file, and not by waiting for DNS to try and fail. Labels: tomcat Comments: |
Twitter UpdatesArchives |