With the advance of Internet of Things and the support of a diverse array of smart-world applications, the number of Machine-to-Machine (M2M) devices has continued to grow at an accelerated rate. This significant and unchecked increase poses enormous challenges to both M2M infrastructure and the coexistence of M2M applications. In this paper, we model the traffic arrival patterns of time-driven, event-driven and loop-driven M2M applications, and propose a novel dynamic rate adaptation (DRA) scheme to obtain an optimized service rate distribution among a mixture of diverse M2M applications. DRA introduces real-time monitoring of M2M traffic arrival rate, building on which a service rate distribution between M2M applications can be incrementally adjusted moment to moment, through the use of the mean value theorem of integrals (MVTI) and generalized processor sharing (GPS). Via a combination of both theoretical analysis and extensive performance evaluation, we have validated the effectiveness of our proposed DRA scheme. Our experimental results demonstrate that DRA can significantly improve M2M communications performance with respect to throughput, delay, and energy consumption. In addition, we extend our proposed DRA scheme from the perspective of Device-to-Device (D2D) communications and further discuss the resilience of DRA.