How to Fix 96% CPU Usage Caused by Swoole Port Conflicts on Ubuntu
1. Background While maintaining an Ubuntu server, I noticed that the CPU usage suddenly increased to an unusually high level. The server was equipped with an 8-core CPU . Under normal circumstances, CPU usage remained relatively low. However, during one inspection, the CPU usage had reached 96% . At the same time, the server monitoring dashboard showed network traffic of approximately 127 Kb/s. There was no obvious spike in network activity. Since multiple websites were running on this server, including projects built with ThinkPHP and Swoole, I needed to identify which process was responsible for the abnormal CPU consumption. The investigation eventually revealed the root cause: Two different websites were running Swoole services that attempted to listen on the same IP address and port. After correcting the port configuration, CPU usage dropped from 96% to just 2%. This article documents the troubleshooting process and the solution. 2. Check Server Resource Usage The first step ...