We study the warm-standby M/M/R machine repair problem where standby machines have switching failure probability q, and failed machines balk (do not enter) with a constant probability (1 − b) and renege (leave the queue after entering) according to a negative exponential distribution. Failure and repair times of the machines are assumed to follow a negative exponential distribution. A profit model is developed in order to determine the optimal values of the number of spares and the number of repairmen simultaneously, while maintaining a minimum specified level of system availability. We use the two methods direct search method and steepest descent method to find the global maximum value until the availability, balking and reneging constraints are satisfied. Numerical results are provided in which various system performance measures are calculated under optimal operating conditions. Sensitivity analysis is also investigated.