optimize connection state count speed