Supporting real-time communications over IEEE 802.11 wireless local area networks (WLANs) is very important yet challenging due to the limited channel capacity, unstable channel conditions, and the low transmission delay requirement of real-time traffic. In this paper, we propose a new analytical model to improve the delay and throughput performance of the real-time applications over WLANs. We model each node as an M/G/1/K queue and the random access process as a two-dimensional Markov chain. Taking into account the rate adaptation feature of real-time applications, we design an iterative searching algorithm to look for the optimal number of retransmission m in the MAC layer with concurrent exploration of the Markov chain and the M/G/1/K queuing models and the variation of the arrival rate. Performance results demonstrate that our analytical model can effectively improve the throughput and average delay under different conditions studied.