As one of the most popular low-latency anonymous communication systems, Tor has been a great success but still faces some challenges, e.g., subject to low-resource attacks and no explicit mechanisms to explore tradeoffs between anonymity and performance. In this paper, we propose a Relay Recommendation System (RRS) for Tor to provide reliable relay information for building paths with better performance, mitigate low-resource attacks, and enable users to explore the tradeoffs between performance and anonymity based on their needs. We first present the design of RRS, and show its performance improvement and resistance to low-resource, high-resource, and reputation attacks. We further analyze the potential anonymity decrease, and propose new path selection schemes to enable selective anonymity based on user needs. We have evaluated RRS via both analysis and experiments on a Tor simulation platform. Our results show that RRS achieves significant performance improvement with a small decrease of anonymity.