This paper studies hierarchical configuration of distributed systems for achieving optimized system performance. A distributed system consists of a collection of local processes which are distributed over the network of processors and cooperate to perform some functions. An hierarchical approach is to group and organize the distributed processes into a logical hierarchy of multiple levels, so as to coordinate the local computation/control activities to improve the overall system performance. It has been proposed as an effective way to solve various problems in distributed computing, such as distributed monitoring, resource scheduling, and network routing. The optimization problem considered in this paper is concerned with finding an optimal hierarchical partition of the processors so that the total cost is minimal. The problem in its general form has been known to be NP-hard. Therefore, we just focus on distributed computing jobs which require collecting information from all processors. One example of such job is distributed monitoring. By limiting the levels of the hierarchy to 2, we study optimal hierarchical configurations for two popular interconnection networks: mesh and hypercube. Based on analytical results, partitioning algorithms are proposed which achieve optimal communication cost attributed to information collection. We also discuss heuristic schemes for multiple-level hierarchical partitions. Although this paper is presented in terms of distributed monitoring, the approaches can also be applied to other hierarchical control problems in distributed computing.