Accurate prediction on the utilization of cloud resources is increasingly important for public cloud users, as it relates to the reasonable reservation of resources for minimizing the usage costs. However, the existing relevant approaches fail to predict the usage amount of cloud resources on the basis of the requested workloads of users’ applications, and the characteristics of changing workload data are rarely considered for the real-time prediction. To address these challenges, we propose an online cloud resource prediction model (OCRPM) to timely predict the proper resource usage amount. Firstly, all of the requested workloads are classified into three types of waveform trend patterns using the trend degree (TD). Next, a scalable window waveform sampling method (SWWS) on the classified patterns is devised to extend the suitable workload waveform interval window for supporting the subsequent high accurate prediction on the cloud resources. Finally, an optimal error gradient boosting regression (OEGBR) algorithm is given to train the data model and to predict the reasonable cloud resource usage amount in light of the requested workloads. The simulation results indicate that the proposed method can adjust the suitable workload waveform sampling window, and achieve higher prediction accuracy than the state-of-the-art relevant approaches and existing statistical learning models.