This paper presents a steady-state analysis of an M/M/2 queue with heterogeneous servers (Server 1 and Server 2). Server 1 is reliable and may leave for a vacation when the system becomes empty. Sever 2 is unreliable and may break down while serving customers. When a breakdown occurs, Server 2 reduces the service rate rather than halting service. We formulate this queueing model as a quasi birth-and-death (QBD) process, using the matrix geometric method to compute the stationary distribution of system size. We also develop several measures to evaluate the performance of the system. A cost model based on system performance measures is formulated as a heuristic cost optimisation problem subject to stability conditions. A canonical particle swarm optimisation algorithm is used to obtain numerical solutions for the approximate optimal service rates of Server 1 and Server 2. Moreover, we present numerical results showing the effects of various parameters on the approximate optimal service rates as well as a practical example illustrating the application of the proposed model.