Customer Relationship Management is essential for company's success, focusing on enhancing customer retention through early detection of churn. Due to the Exponential growth of data volume in e-commerce, it is essential to develop techniques to identify customer churn. Machine learning and CRM will effectively perform this task. Additionally predicting rush time linking optimized Employees distribution and minimizing technical issues to achieve customer retention. We applied K-means based on the RFM model and addressed imbalanced data using SMOTE-TOMEK. The Results revealed that XG-Boost outperformed other algorithms, including decision tree and random forest, achieving an accuracy of 87.37%, precision of 99.99%, recall of 74.68%, F1-score of 85.5%, and an AUC of 88%. Additionally, the analysis using zscore showed that rush times between 4:57 AM and 6:04 PM accounted for approximately 68% of all purchases.