The Data Grid, as a specialization and extension of the Grid, has been adopted as the solution to solve data-intensive problems, such as high energy physics, life science and etc. Large data files are replicated across the Data Grid to improve the system performance. One form of the Data Grid studied is the Hierarchical Data Grid used in LHC experiments. There has been a lot of research work on replication algorithms for the Hierarchical Data Grid. It is important and useful to analyze the optimal performance, as it can be used as a benchmark to compare the performances of different replication algorithms and helps us to understand how good the replication algorithms are in approaching the optimal performance. In this paper, we construct a model to predict the optimal performance of the Hierarchical Data Grid. The performance metrics used for the model are average response time and average bandwidth cost. We propose the optimal replication algorithm and present a detailed analysis of its performance. The Multi-Tier Data Grid is used as a specific example of the Hierarchical Data Grid to verify our model. The performance of the proposed optimal replication algorithm is studied together with three well-known replication algorithms. The simulation results show that the optimal replication algorithm has the best performance and its performance is pretty close to the result obtained using our probabilistic model.