To cope with increasing number of clients and servers, content delivery networks (CDNs) desire a more efficient way to select servers from multiple data centers in different geographic locations. This paper presents a three-stage global optimization method for the server selection (OMSS) in CDNs, which jointly considers the service experience, load balancing, traffic control and overhead. OMSS first proposes a novel scalable network distance proximity algorithm for partitioning the servers and clients into different clusters, then finds a set of candidate servers and extracts the closest k servers. At last, OMSS proposes a global optimization function with taking into account load balancing and traffic control, and introduces a penalty coefficient to leverage the quality of service experience in terms of network delay and the traffic control in terms of inter-domain transit traffic. In order to comprehensively analyze the performance of OMSS, we use typical benchmarks to compare OMSS with traditional approaches on the one hand, and also perform statistical tests to display the improvement of OMSS on the other hand. As presented in the comparison table, OMSS not only achieves improved performance in both service experience and traffic control, but also enjoys less measurement and computation overhead.