server optimization & bug fixed, client for latency test