One of our API servers has an issue with CPU usage. API is written in python and configured in ubuntu AWS EC2 instance. This application uses Python 2.7 and Django 1. This can be accessed through port 80 by proxy passing. Sometimes we are getting 499 requests in our logs that time $htop value shows 100% CPU usage in the server. The only python requires are running in this server. But in AWS cloudwatch monitoring, it is not. only 40% to 50%.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23086 root 20 0 815776 96056 12792 S 100 4.7 2:43.12 python
24041 root 20 0 292756 92820 12696 S 8.0 4.5 0:33.73 python
24072 root 20 0 815656 95696 12792 S 5.3 4.7 0:28.27 python
Please help TIA
You most likely using a dual core server, and your python process is single threaded and using as much CPU as it can (one core).
Hence the discrepancy between htop and cloudwatch:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.