LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-22-2015, 06:17 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,475

Rep: Reputation: 85
Why sudden surge in CPU usage in Xubuntu?


I've got two identical computers with Xubuntu on them. They've both worked awesomely until recently when one of them gets hung up when I switch to different websites. The CPU gets stuck on 100% and I have to wait a minute or two for it to drop.

The only difference between the two computers is that I added half a GB RAM to the one that is still quick. But that wouldn't really explain why this one is slowing because it's been quick for over a year.

I checked and the file usage still has 60% available.

Any ideas what might be slowing it down and what I might do to get it back to being quick?

Thanks!
 
Old 03-22-2015, 10:21 PM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,307
Blog Entries: 2

Rep: Reputation: Disabled
Hey Gregg
Open a terminal as root and paste in the following command line

watch "ps aux | sort -rk 3,3 | head -n 12"

That should give you a rolling count of the top 10 cpu consuming processes updated every couple of seconds. You can break out of it with a Control+c at any point.
Now, open your web browser and go to the site that's causing the issues,
What shoots to the top of the heap when the CPU is getting buried?
 
1 members found this post helpful.
Old 03-23-2015, 06:56 PM   #3
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,475

Original Poster
Rep: Reputation: 85
Quote:
Originally Posted by dijetlo View Post
Hey Gregg
Open a terminal as root and paste in the following command line

watch "ps aux | sort -rk 3,3 | head -n 12"

That should give you a rolling count of the top 10 cpu consuming processes updated every couple of seconds. You can break out of it with a Control+c at any point.
Now, open your web browser and go to the site that's causing the issues,
What shoots to the top of the heap when the CPU is getting buried?
Thanks dijetlo. The problem's on my home computer so I'll follow your instructions and report the results tonight. Appreciate you replying.
 
Old 03-24-2015, 02:13 AM   #4
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,475

Original Poster
Rep: Reputation: 85
Quote:
Originally Posted by dijetlo View Post
Hey Gregg
Open a terminal as root and paste in the following command line

watch "ps aux | sort -rk 3,3 | head -n 12"

That should give you a rolling count of the top 10 cpu consuming processes updated every couple of seconds. You can break out of it with a Control+c at any point.
Now, open your web browser and go to the site that's causing the issues,
What shoots to the top of the heap when the CPU is getting buried?
Hey dijetlo. I ran your command. It's interesting but I couldn't see what was what in terms of what site in the browser was causing the biggest CPU draw. I attached a screenshot. Almost all the entries there are some type of Chrome (like in the screenshot the one with 23.3% CPU use). That one is always the big number but how do I know what site in the browser that is?

And the computer is slow opening sites. I used to be able to zip around for like a year and now it's just starting to bog down. And even if I can figure out which site is the prime culprit what can I do about it?

Thanks.
Attached Thumbnails
Click image for larger version

Name:	Selection_004.png
Views:	18
Size:	71.2 KB
ID:	17879  
 
Old 03-24-2015, 08:32 AM   #5
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,307
Blog Entries: 2

Rep: Reputation: Disabled
Well, if you want to look at your active, unique tcp connections sorted by foreign address ( and what self respecting geek doesn't like to watch that?) the easiest way I know is
Quote:
watch "netstat -tapn | sort -u -k 5,12"
However the question has been answered, it's chrome. Why it's causing problems could be
1: A bad upgrade, something not installing like it's supposed (check your logs)
2: Perhaps the extra gigabit of ram is the deciding factor (ram is like peanut butter. It's good on everything).

try this, start htop {open a CLI, switch to root and type in 'htop'} and google-chrome at the same time, htop lists mem and swap dynamically in the top section of the display, if as you get bogged down, the "swap" meter starts to spike, you've found the problem. (Needs moar rams)

Last edited by dijetlo; 03-24-2015 at 08:57 AM. Reason: Better Linux through thimking
 
1 members found this post helpful.
Old 03-24-2015, 05:34 PM   #6
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,475

Original Poster
Rep: Reputation: 85
Quote:
Originally Posted by dijetlo View Post
Well, if you want to look at your active, unique tcp connections sorted by foreign address ( and what self respecting geek doesn't like to watch that?) the easiest way I know is

However the question has been answered, it's chrome. Why it's causing problems could be
1: A bad upgrade, something not installing like it's supposed (check your logs)
2: Perhaps the extra gigabit of ram is the deciding factor (ram is like peanut butter. It's good on everything).

try this, start htop {open a CLI, switch to root and type in 'htop'} and google-chrome at the same time, htop lists mem and swap dynamically in the top section of the display, if as you get bogged down, the "swap" meter starts to spike, you've found the problem. (Needs moar rams)
Thanks dijetlo. I've had the cpu thing (getting stuck on 100) years ago on a Windows computer too. It actually has helped (with my current computer) to leave the Task Manager open and wait for the CPU to drop before doing something else with the computer. It's when I'm going click-click-click that it gets stuck and stays stuck. I also found that if I just X out of the latest site that tends to make the CPU drop. The extra half GB is an option. I also have another computer someone gave me that I believe perhaps has 4 GB RAM.

The command for unique foreign addresses is tempting but not being a self-respecting geek I think I'll pass.

Thanks for your help with this.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid 3 near 100% cpu usage and high RAM usage piman Linux - Software 1 11-16-2013 03:20 AM
CPU Usage Spike When Moving Windows with Xubuntu (XFCE) MunkyCheez Linux - Newbie 3 01-07-2011 11:11 PM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 02:14 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 05:45 AM


All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration