The Wireless sensor network (WSN) has huge part in Internet of Things (IoT), as it is used in different applications, for example, detecting climate and sending information by means of the Internet. In any case, the issue of heavy congestion, may affect the performance of WSN-IoT. Despite the fact that machine learning calculations have been introduced by analysts for distinguishing the congested data, accuracy of detection needs to be further enhanced. To control the congestion, Chimp Optimization Algorithm (ChOA) based Support Vector Machine (SVM) is proposed in this paper. To enhance on the execution of SVM, the tuning parameters of SVM are improved utilizing ChOA algorithm. Simulation results indicate that the SVM-ChOA outranks other models, for example, SVM with Genetic Algorithm (SVM-GA), SVM and TCP, based on throughput, energy utilization, delivery ratio, and overhead. Also, the detection accuracy of SVM-CHOA has increased to 92%.