The following tips taken from the site will help reduce the TCP latency of Ubuntu as a web server :
http://www.cyberciti.biz/faq/linux-tcp-tuning/