This paper studies an optimal ON-OFF control problem for a class of discrete event systems with real-time constraints. Our goal is to minimize the overall costs, including the operating cost and the wake-up cost, while still guaranteeing the deadline of each individual task. In particular, we consider the homogeneous case in which it takes the same amount of time to serve each task and each task needs to be served by d seconds upon arrival. The problem involves two subproblems: (i) finding the best time to wake up the system and (ii) finding the best time to let the system go to sleep. We study the two subproblems in both off-line and on-line settings. In the off-line case that all task information is known a priori, we combine sample path analysis and dynamic programming to come up with the optimal solution. In the on-line scenario where future task information is completely unknown, we show that the optimal time to wake up the system can be obtained without relying on fu-