- Newest
- Most votes
- Most comments
Hi
- Use top or htop to identify processes consuming the most resources.
- Check system logs for error messages.
- Monitor network and disk I/O.
This command will list all running processes, including their user, PID (process ID), CPU usage, memory usage, and command.
Filtering:
To focus on CPU-intensive processes:
ps aux | sort -k3 -r | head
By following these steps, you should be able to effectively troubleshoot and resolve high CPU and memory usage on your instance.
Hello.
Is it possible to run the "ps" command below to identify the process with high CPU usage?
Also, what kind of applications are you running on EC2?
ps aux
The issue is when i used this command cpu total usages showing 50% but in services wise no one utiliztion that much
Check for Memory Leaks and Diagnose Memory Leaks in Applications: If you have custom or third-party applications running on the instance, they might be leaking memory. Use tools like valgrind, memcheck, or heaptrack to track memory allocations and identify leaks in your application .
Also Check for Zombie Processes: Zombie processes don't usually consume a lot of memory, but they can accumulate if parent processes don’t properly handle child processes. Use
ps aux | grep 'Z' to check for zombies.
No zombies process is running , only issue is when is used top,htop aur ps aux , no service is showing high cpu consumtion but overall and also in aws console 50% used
Relevant content
- Accepted Answerasked 2 years ago
- asked 2 years ago
- asked 7 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 6 months ago
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 3260 0.0 0.4 725356 17716 ? Ssl 12:29 0:00 /usr/bin/amazon-ssm-agent root 3262 0.0 0.4 682420 17020 ? Ssl 12:29 0:00 /usr/sbin/rsyslogd -n root 1818 0.0 0.3 47260 12080 ? Ss 12:29 0:00 /usr/lib/systemd/systemd-journald root 3078 0.0 0.3 272816 12084 ? Ss 12:29 0:00 /usr/sbin/httpd -DFOREGROUND root 3421 0.0 0.2 150628 8476 ? Ss 12:29 0:00 sshd: ec2-user [priv] root 2986 0.0 0.1 98688 4456 ? Ss 12:29 0:00 /sbin/dhclient -q -lf /var/lib/dhclient/dhclient--eth0.lease -pf /var/run/dhclient-eth0.pid -H ip-172-31-42-185 eth0 root 3033 0.0 0.1 98688 4108 ? Ss 12:29 0:00 /sbin/dhclient -6 -nw -lf /var/lib/dhclient/dhclient6--eth0.lease -pf /var/run/dhclient6-eth0.pid eth0 -H ip-172-31-42-185 rngd 2748 0.0 0.1 96348 4808 ? Ss 12:29 0:00 /sbin/rngd -f --fill-watermark=0 --exclude=jitter postfix 3208 0.0 0.1 90472 6836 ? S 12:29 0:00 qmgr -l -t unix -u
gettin this only but i did not understand why cpu 50%