An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#31632 - 10/25/14 06:22 AM Very high CPU Usage
slolerner Offline


Registered: 08/25/09
Loc: New York City
Time Machine, when running, is using up to 93% of cpu, but when not running, Firefox Plug-in Process (Shockwave Flash)is running 523 threads, 1.46GB Intel (64 bit) and mds is only running 3 threads and suing .0 1.15 GB Intel (64 bit). Last night I woke up and the fans were on and the total CPU usage was almost used up. ??? And, why are the processes listed as 64 bit when I THOUGHT I was running 32 bit?

Why is backupd using up to 96% of CPU and fseventsd jumps up to 30%, at the same time? What is going on here? Have I entered an alternative universe where 96% and 30% do not add up to 100%?
_________________________
Mid 2010 MacBook Pro 13"
2.4GHz, 750GB SATA HD, 8 GB RAM, OS 10.7.5
1 HDX1500 2TB Ext.HD, 2 HDX1500 1TB Ext.HD
HP Laserjet 6MP printing postscript via 10/100 Intel print server
Netgear WN2500RP Range Extender (Ira rocks!)
Linksys WRT1900AC Wireless Router
Brother MFC-9340CDW Color Laser
iPad Air

Top
#31634 - 10/25/14 08:52 AM Re: Very high CPU Usage [Re: slolerner]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
As for the latter part of your question, your computer has multiple processor cores. The 100% figure means 100% of one core is being used. If you have 4 cores, for example, it's (theoretically) possible for CPU usage to reach 400%.

Well-written programs can run on a core that isn't otherwise in use, and will use all its available processing if they need it--and then if something else comes along that wants to use that core (Photoshop, say), they will back down.
_________________________
Photo gallery, all about me, and more: www.xeromag.com/franklin.html

Top
#31637 - 10/25/14 09:42 AM Re: Very high CPU Usage [Re: slolerner]
joemikeb Online

Moderator

Registered: 08/04/09
Loc: Fort Worth, Texas
tacit has answered your last question and I will take a shot at the second. Applications have to be written to run in 32 bit mode, 64 bit mode, or either. Do a Get Info (Command+I) on an application and if there is a 32 or 64 bit checkbox it can run in either mode. otherwise in current applications it is safe to assume they are written for 64 bit operation. You Macbook Pro has Core 2 Duo processor and a native 64 bit architecture so there is no advantage to running in 32 bit mode. The performance, particularly OS performance, will be greater in 64 bit mode. You are literally processing twice as much data with each CPU cycle.

By the way, it would be helpful if you would add your OS version to the system description in your signature.
_________________________
joemikeb • moderator

Top
#31640 - 10/25/14 03:06 PM Re: Very high CPU Usage [Re: joemikeb]
slolerner Offline


Registered: 08/25/09
Loc: New York City
The OS version is in the signature, 10.6.8, Snowy. That was my confusion with the 64 bit stuff, I thought I was running 32 bit, as per the string where we were discussing the evil hard drive. Then, since I can go up to 400% of CPU, how come under Activity Monitor there are two boxes and each is almost full up? A little over 50% the user and 20-25% the system right now? And why does Shockwave have 523 threads or am I paying too much attention and ought to be watching TV or eating donuts?

It just worries me when I wake up at night and the fans are loud.
_________________________
Mid 2010 MacBook Pro 13"
2.4GHz, 750GB SATA HD, 8 GB RAM, OS 10.7.5
1 HDX1500 2TB Ext.HD, 2 HDX1500 1TB Ext.HD
HP Laserjet 6MP printing postscript via 10/100 Intel print server
Netgear WN2500RP Range Extender (Ira rocks!)
Linksys WRT1900AC Wireless Router
Brother MFC-9340CDW Color Laser
iPad Air

Top
#31647 - 10/26/14 01:38 AM Re: Very high CPU Usage [Re: slolerner]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: slolerner
Why is backupd using up to 96% of CPU and fseventsd jumps up to 30%, at the same time? What is going on here? Have I entered an alternative universe where 96% and 30% do not add up to 100%?

If fseventsd is using lots of processor time, it must be that some process is doing lots of file open/update/close operations. (Each time any process closes a file after modifying it, fseventsd is notified, and makes this information available to other processes that want to know about changing files.)

One process that's interested in what files have changed is Time Machine. Every time fseventsd notices that a file has changed, Time Machine gets the message, and has to determine whether the file needs to get backed up. (fseventsd only tells TM which folder the changed file was in. It's up to TM to figure out which file in that folder changed. That takes time. Not normally a lot of time on each event, but if the folder has a lot of files in it and/or events are frequent it can add up. And it sounds like they're very frequent.)

From your description, the culprit is the Shockwave Flash plugin. Some website has started running something in Flash that has gone amok. Close the Firefox window (or tab) that the miscreant is running in. You'll know you've closed the right window when total CPU usage (as reported by Activity Monitor) drops dramatically. Then avoid that website.

Top
#31661 - 10/27/14 08:14 AM Re: Very high CPU Usage [Re: ganbustein]
slolerner Offline


Registered: 08/25/09
Loc: New York City
Disabled Shockwave Flash Plugin but took a restart to get it to go away.

The TM is a little more interesting. I had an alias to a very large folder on my desktop. Currently, I have only been revising a Word document on my desktop, so I thought about what you said, Ganbustein, but could not imagine an alias would cause an index of the actual folder. However, when I deleted the alias, TM started indexing hundreds of thousands of files. The folder contained a lot of 40-80MB photos, and lots of folders but there was no way there were hundreds of thousands of files in there. The TM usage dropped significantly after that backup, which took a very long time in the cleaning up stage.

Today, I moved all the folders I could off the desktop, the kind of thing well-behaved users do. It is presently preparing more hundreds of thousands of files for backup. I will keep you posted.
_________________________
Mid 2010 MacBook Pro 13"
2.4GHz, 750GB SATA HD, 8 GB RAM, OS 10.7.5
1 HDX1500 2TB Ext.HD, 2 HDX1500 1TB Ext.HD
HP Laserjet 6MP printing postscript via 10/100 Intel print server
Netgear WN2500RP Range Extender (Ira rocks!)
Linksys WRT1900AC Wireless Router
Brother MFC-9340CDW Color Laser
iPad Air

Top
#31679 - 10/31/14 06:58 AM Re: Very high CPU Usage [Re: slolerner]
slolerner Offline


Registered: 08/25/09
Loc: New York City
Well, when doing a TM backup, it still indexes hundreds of thousands of files, is that normal?

And prepares hundreds of thousands of files?


Edited by slolerner (10/31/14 07:01 AM)
Edit Reason: more
_________________________
Mid 2010 MacBook Pro 13"
2.4GHz, 750GB SATA HD, 8 GB RAM, OS 10.7.5
1 HDX1500 2TB Ext.HD, 2 HDX1500 1TB Ext.HD
HP Laserjet 6MP printing postscript via 10/100 Intel print server
Netgear WN2500RP Range Extender (Ira rocks!)
Linksys WRT1900AC Wireless Router
Brother MFC-9340CDW Color Laser
iPad Air

Top
#31680 - 10/31/14 01:22 PM Re: Very high CPU Usage [Re: slolerner]
ganbustein Offline


Registered: 08/04/09
When TM takes a snapshot, it has to find all the files that have changed since the last backup. To see if a file has changed, it just compares metadata (existence, date the data was last modified, date the metadata was last modified, etc.) for the file on the source disk and the file at the same path within the latest good snapshot.

But you have millions of files. Even if it only takes a millisecond to check a file, millions of milliseconds adds up to a long time. TM tries very hard not to have to examine every file.

To do that, it relies heavily on a part of the system called the File System Event Manager (FSEvent for short). A "file system event" is anything that an application that wants to know about changes might find interesting. Examples of such applications are Time Machine (so it can back up changed files) and Spotlight (so it can index them). Examples of noteworthy changes are: a program has closed a file after writing to it, a file has been created/deleted, a file or folder has been renamed or moved to another location.

The FSEvent manager can broadcast these events to systems that need to respond in real time, such as Spotlight. In OS X 10.5 Leopard, FSEvent manager started logging these events, so applications like TM that aren't running all the time can ask "What changed since ...?". To keep the log down to a manageable size, the FSEvent log doesn't record what file changed; rather, it records what folder the file was in. To further reduce the the log size, multiple changes to the same folder are coalesced. For example, moving 7 files from one folder to another is 14 events (each file was removed from the first folder, each file was added to the other folder), but logged as only two events (the two folders changed).

Even such vague information is good enough to help TM. When it takes a snapshot, it gets from FSEvent a list of the folders where there are changes, and compares the files/folder inside just those folders. That's enough to reduce the number of files it has to consider from millions down to thousands. Millions of milliseconds is a long time; thousands of milliseconds is manageable.

Except if there is a problem with the FSEvent log. There are things that can happen that make the FSEvent manager mistrust its log. For example, if the disk is not properly unmounted, or if you power off your computer without properly shutting down, or you have a kernel panic. When that happens, the old FSEvent log is deleted, and a new one is started.

The first time TM comes along after the FSEvent log has been restarted like this, and asks "What happened since my last snapshot?", the FSEvent manager replies "Beats me. My log doesn't go back that far in time. You're on your own." In that case, TM has no recourse but to spend the millions of milliseconds it takes to examine each and every one of the millions of files on your disk. This is called a "deep scan", and reported as such in the Console log.

While TM is determining which files need to be backed up, it displays its status as "preparing files". If it's in this state for a long time, it's probably doing a deep scan. (Or it could be deleting old snapshots to make room, which also counts as "preparing files". Looking in Console will tell you whether it's deleting old snapshots. It helps to enter "backupd" in Console's search field to limit output to just TM's messages.)

Once TM is able to make a good snapshot, future snapshots will be very fast until the next time FSEvent has to start a new log. If you want to keep TM speedy, avoid things that kill the FSEvent log.


As a matter of terminology: TM does not "index" files. Indexing files is something Spotlight does. TM will notice if Spotlight is indexing your backup volume, and will wait until Spotlight finishes. Otherwise, they get in each other's way, which would slow them both down dramatically. Things that make FSEvent mistrust its log files also tend to make Spotlight mistrust its database, causing it to re-index the entire volume. Re-indexing an entire volume can take a long time.

Top
#31689 - 10/31/14 07:06 PM Re: Very high CPU Usage [Re: ganbustein]
slolerner Offline


Registered: 08/25/09
Loc: New York City
When it backs up now, it still prepares hundreds of thousands of files, but then only writes maybe a few KB each time. Does that sound right? BTW, no fans full blast in the middle of the night now, and getting rid of the Firefox Fireworks/Flash whatever has had no effect as far as web viewing, not sure what it was or what it was up to, but it is gone from the CPU usage.

The console shows thinning, deleting old backups, but mostly denying Microsoft access to my Word files (I have it set that way). Boy, do they keep hitting me, constantly. Buggers.


Edited by slolerner (10/31/14 07:10 PM)
_________________________
Mid 2010 MacBook Pro 13"
2.4GHz, 750GB SATA HD, 8 GB RAM, OS 10.7.5
1 HDX1500 2TB Ext.HD, 2 HDX1500 1TB Ext.HD
HP Laserjet 6MP printing postscript via 10/100 Intel print server
Netgear WN2500RP Range Extender (Ira rocks!)
Linksys WRT1900AC Wireless Router
Brother MFC-9340CDW Color Laser
iPad Air

Top
#31691 - 11/01/14 05:48 AM Re: Very high CPU Usage [Re: slolerner]
slolerner Offline


Registered: 08/25/09
Loc: New York City
Ok, now I had to reinstall Flash to view a Flash website and I did so from the Adobe website and it still tells me I have to download Flash from the Adobe website. Apparently the Shockwave Flash thing that I disabled on Firefox because of the CPU usage was some kind of thing I had installed to download YouTube videos before YouTube let you download them without it. What gives here?
_________________________
Mid 2010 MacBook Pro 13"
2.4GHz, 750GB SATA HD, 8 GB RAM, OS 10.7.5
1 HDX1500 2TB Ext.HD, 2 HDX1500 1TB Ext.HD
HP Laserjet 6MP printing postscript via 10/100 Intel print server
Netgear WN2500RP Range Extender (Ira rocks!)
Linksys WRT1900AC Wireless Router
Brother MFC-9340CDW Color Laser
iPad Air

Top

Moderator:  alternaut, dkmarsh, joemikeb