The aim of this paper is to analyze the performance of the two-phase MX/M/1 queueing mechanism. The other conditions of the queueing system under study are state-dependent arrival rates, N-policy, unreliable server and delayed repair. A single server provide service in two stages. The first stage is batch service and the second one is individual to each customer in the batch. The client's arrival rate depends upon the state of the server. We developed the steady state equations. Probability generating functions were used to solve the equations. The expected size of the queue while the server is at different states are derived. Cost function has been developed to determine the optimal threshold of N. Sensitivity analysis is presented to study the effect of the system parameters at the threshold of N for the geometric batch size distribution. The findings of this research help in designing two-phase queueing systems that occur in telecommunication networks, production etc. at a low cost.