One major factor that heavily affects the performance of a content distribution network (CDN) is placement of the surrogates. Previous works take a network-centric approach and consider only the network traffic. In this paper, we propose solutions to optimal surrogate placement, taking into consideration both network latency and capacity constraints on the surrogates. For CDNs with a tree topology, an efficient and effective greedy algorithm is proposed which minimizes network traffic while at the same time maximizing system throughput. Simulation results show that the greedy algorithm is far better than the existing optimal placement scheme that makes decisions based solely on network traffic. This suggests that capacity constraints on surrogates or server bottlenecks should be considered when determining surrogate placement, especially when the capacities of CDN servers are limited.