Bug 156927

Summary: Beagle excessivly uses CPU
Product: [openSUSE] SUSE Linux 10.1 Reporter: Cornelius Schumacher <cschum>
Component: OtherAssignee: Joe Shaw <joeshaw>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: suse-beta
Version: Beta 7   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: top output showing beagle daemon's CPU usage
top output showing beagle daemon's CPU usage after three days running
top output showing beagle daemon's CPU usage after two days running

Description Cornelius Schumacher 2006-03-10 07:51:39 UTC
I installed the beta 7 yesterday evening and tried the beagle search. This morning 14 hours later, two beagle daemons are still running and using most of my CPU time.

As I couldn't find a way to see what the beagle daemons are actually doing I can't judge if they simply went berserk or if they are still doing something useful.
Comment 1 Cornelius Schumacher 2006-03-10 07:52:26 UTC
Created attachment 72163 [details]
top output showing beagle daemon's CPU usage
Comment 2 Cornelius Schumacher 2006-03-13 10:06:16 UTC
Created attachment 72500 [details]
top output showing beagle daemon's CPU usage after three days running

After the week-end the beagle daemons are still running full-steam.
Comment 3 Joe Shaw 2006-03-13 18:44:44 UTC
Can you please attach a tarball of ~/.beagle/Log ?
Comment 4 Joe Shaw 2006-03-13 18:45:55 UTC
Do you use evolution?  Possibly a dup of bug 156927.
Comment 5 Christian Boltz 2006-03-14 00:12:06 UTC
(In reply to comment #4)
> Do you use evolution?  Possibly a dup of bug 156927.

To understand recursion, you have to understand recursion first ;-)

Yes, this bug is a duplicate of 156927 - because it is exactly _this_ bugreport ;-))

Maybe you wanted to add another bug number here?
Comment 6 Cornelius Schumacher 2006-03-14 11:12:49 UTC
I'm not using Evolution. I'm using KMail.

I'm a bit reluctant to attach .beagle/Log/ as it seems to contain a lot of private information. Is there anything specific I can extract from the logs or something I should check for?
Comment 7 Joe Shaw 2006-03-14 16:10:56 UTC
Bug 156916 is what I meant, but if it's not Evolution, then it might not apply.

Would you mind sending me your logs in an email rather than attaching them to the bug?  The main things I am looking for are exceptions in the logs, whether the indexer is caught on one particular message, whether the backend is recrawling (but not reindexing) your mailboxes.

One thing to try is to run beagled with certain backends enabled and disabled.  If you run "beagled --allow-backend kmail" do you see the CPU being pegged?  What about if you run "beagled --deny-backend kmail"?  That'll help me track it down to a specific backend.

Looking at the top output, why do you have two beagled processes?  Are they broken into threads, or is one beagled and the other beagled-helper?
Comment 8 Joe Shaw 2006-03-15 20:09:24 UTC
Another thing that would be helpful is when you notice it using this much CPU, send it SIGQUIT and attach the various stack traces to the bug.

I'm not that familiar with the KMail backend; that was written by a contributor rather than me, so I need a decent starting point.
Comment 9 Joe Shaw 2006-03-16 19:03:52 UTC
There is a decent chance this is a dup of 156916.  Cornelius, can you try the --deny-backend thing I suggested in comment 7?  If disabling it fixes the issue, can you then try moving the ~/.beagle/Indexes/KMailIndex/offset-* files out of the way and restarting with that backend enabled?
Comment 10 Cornelius Schumacher 2006-03-17 11:30:43 UTC
Ok, I'm now running beagled with "--deny-backend kmail". Let's see, if the problem persists.
Comment 11 Joe Shaw 2006-03-17 18:46:43 UTC
I submitted an updated gmime (2.2.1) for SLED 10 Beta 9.  Try that and see if it's fixed, assuming it's the KMail backend that's giving you troubles.
Comment 12 Cornelius Schumacher 2006-03-20 09:18:09 UTC
With "--deny-backend kmail" CPU usage seems to be better. It's a bit hard to tell, because after the weekend the daemon had crashed. The last lines of debug output were:

** ERROR **: file ../../mono/io-layer/handles-private.h: line 339 (_wapi_handle_share_release): assertion failed: (info->handle_refs > 0)
aborting...
Aborted
Debug: The daemon appears to have gone away.
Debug: Shutting down helper.
Debug: (1) Waiting for 1 worker...
Debug: waiting for server '/tmp/beagle-cschum-f7b463d7-6e9b-4093-a394-f6452a8c330c/socket-helper'
Debug: Server '/tmp/beagle-cschum-f7b463d7-6e9b-4093-a394-f6452a8c330c/socket-helper' shut down
Debug: Exiting


I will will try the new gmime version and see if it fixes the problem.
Comment 13 Cornelius Schumacher 2006-03-21 09:17:26 UTC
I have now upgrade gmime to 2.2.1-3. This also required to upgrade beagle to 0.2.3-1. Is this enough or are there any other packages which have to be updated?

The only message which is in the logs is "Warn: Extended attributes are not supported on this filesystem.  Performance will suffer as a result.", but nothing more, so I'm not sure that the daemon is actually doing something.
Comment 14 Joe Shaw 2006-03-21 15:29:23 UTC
That's fine.  The debugging level was turned down in the 0.2.3 packages.  If you run beagled with --debug you will see the verbose messages again.  It's probably running, though.
Comment 15 Joe Shaw 2006-03-22 21:18:39 UTC
What's the state of things?  Is the CPU usage improved?  Can we close this bug?
Comment 16 Cornelius Schumacher 2006-03-23 09:29:51 UTC
The CPU usage is improved. The daemon doesn't run constantly with full CPU usage anymore. But it still consumes a lot of CPU and it also seems to use lots of memory. I don't know if this is due to a bug or if it meant to be that way.

In addition to that it doesn't seem to give any useful search results for my mails. It only gives results for two mail folders regardless of the search terms. Is there a way to see, what parts of my mail folders beagle has indexed?
Comment 17 Cornelius Schumacher 2006-03-23 09:32:04 UTC
Created attachment 74680 [details]
top output showing beagle daemon's CPU usage after two days running

CPU usage after running for two days with the new gmime and beagle packages.
Comment 18 Cornelius Schumacher 2006-03-28 09:35:44 UTC
What should we do with this bug? The main bug seems to be fixed. Is the CPU usage as it's now as it is supposed to be, or is this still caused by bugs?

Should I open separate bugs for the lack of useful search results in mails and the missing option to find out the status of the index?

Can I do anything about the crash mentioned in comment #12? Is this a separate problem or has it been fixed by the new beagle version?
Comment 19 Joe Shaw 2006-03-28 16:18:19 UTC
I believe the CPU usage is working as it should.  It will use the CPU for indexing, and it may take a few seconds at a time, but it should never peg it for an extended period.

As for the lack of useful results, do you know if this is caused by the fact that all of your data is not yet indexed?  There is a tool called beagle-index-info which will tell you the status of each index.  There isn't any indication in the UI, though.  That is filed upstream at bugzilla.gnome.org #160333:

http://bugzilla.gnome.org/show_bug.cgi?id=160333

If you think that your index is reasonably complete, but you're not getting useful results, I'd suggest opening a separate bug about that.  Certainly if your Beagle daemon has been running for a few days without incident I would expect that you'd be fully indexed.  We can debug whether or not the document is indexed at all, if it was indexed properly, etc.

As for the crash in comment #12, that's an internal Mono assertion and not directly a Beagle bug, so I'd suggest opening a separate bug about that against Mono.

I think this one is ok to close?
Comment 20 Joe Shaw 2006-03-31 21:27:25 UTC
I'm closing this as FIXED.  Please reopen if you see the issue again.