We consider an infinite capacity M/M/c queueing system with c unreliable servers, in which the customers may balk (do not enter) and renege (leave the queue after entering). The system is analyzed as a quasi-birth-and-death (QBD) process and the necessary and sufficient condition of system equilibrium is obtained. System performance measures are explicitly derived in terms of computable forms. The useful formulae for computing the rate matrix and stationary probabilities are derived by means of a matrix analytical approach. A cost model is derived to determine the optimal values of the number of servers, service rate and repair rate simultaneously at the minimal total expected cost per unit time. The parameter optimization is illustrated numerically by the Quasi-Newton method.