Admission and service rate control problems in queueing systems have been studied in the literature. For an exponential service time distribution, the optimality of the threshold-type policy has been proved. However, in production systems, the production time follows a general distribution, not an exponential one. In this paper, control of the service speed according to the number of customers is considered. The analytical results of an M/G/1 queue with arrival and service rates that depend on the number of customers in the system, which is called an Mn/Gn/1 queue, are used to compute the performance measure of service rate control. In particular, for the case in which the arrival rates are the same among queue-length intervals, a computation method for deriving stationary distributions is developed. Constant, uniform, exponential, and Bernoulli distributions on the service time are considered via numerical experiments. The results show that the optimal threshold depends on the type of distribution, even if the mean value of the service time is the same. In addition, when the reward rate is small, a case in which a non-threshold-type service rate control policy outperforms all threshold-type policies is identified.