landsape package reporter takes up too much cpu and memory resources

Bug #675577 reported by anirudhs
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Landscape Client
Invalid
Undecided
Unassigned
landscape-client (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hi,

I logged into my server today to find that landscape package reporter has been taking up a very very large portion of system resources - so much that I could barely even enter any commands into SSH. I have removed the landscape-client package. I will be able to provide any diagnostic information. All I have right now is a screenshot of htop running on the server.

Revision history for this message
anirudhs (anirudhs) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hi, what version of landscape-client was that? And which version of Ubuntu?

The package reporter runs once an hour, and everytime there are package activities sent from the Landscape server by an administrator.

If it has been running for a long time, then there might be something wrong. It usually takes about the same amount of time than a run of "sudo apt-get update" and then it dies. You can see if there is something interesting in its log file at /var/log/landscape/.

That being said, it will consume more memory than apt because it uses psyco to try to speed things up. If you want to try, you can disable psyco which will make it consume less memory:

sudo /usr/share/smart/smart config --set psyco=0

Changed in landscape-client:
status: New → Incomplete
Revision history for this message
chrowe (chris-ole) wrote :

I am having this same issue

Ubuntu 10.04.1

EC2 Micro instance:
* Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
* 615MB RAM

landscape-client --version = 1.5.5.1-0ubuntu0.10.04.0

The landscape-package-reporter process seems to run ever minute or so for 10-20 seconds and take up 99.9% of CPU and 28% Ram

landscape-broke seems to run right before landscape-package-reporter and take up a good amount of resources as well.

Revision history for this message
chrowe (chris-ole) wrote :

Not sure what to look for...

Doesn't look like much happening in package-reporter.log http://pastebin.com/Ym8rwMeR

broker.log has some errors http://pastebin.com/SJzjvFRr

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'm particularly interested in why the package reporter is showing the download of package information in batches of 500. That should only happen if you are running a distro that is not released yet, like natty perhaps. Is that the case?

Anyway, that's the reason it is running frequently, it's because it has to report all the packages to the server, in these batches. That can take some time, but eventually ends. We do have a cache file in place on the server to reduce this initial upload time by several orders of magnitude, but not for all distributions (natty isn't included yet, for example).

Revision history for this message
chrowe (chris-ole) wrote :

I am running 10.04.1 so not sure why I am having these issues if there is a cashe

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

No, lucid should be fine. Please check if the directory /var/lib/landscape/client/package/hash-id has any contents. For lucid, it should be something like:

/var/lib/landscape/client/package/hash-id/7c6efe47-12fb-11de-91bb-0016353c8658_lucid_i386

The actual uuid and architecture may be different.

If you don't, then keep tailing /var/log/landscape/package-reporter.log (tail -f .....) and restart the service (sudo /etc/init.d/landscape-client restart). At some point (in a few seconds) it should try to download this file from landscape.canonical.com.

BTW, you have a registration on landscape.canonical.com and this machine is pointing to it, right? Doesn't matter if you are a paying customer or a trial user, but the above will only happen if this machine is registered.

tags: added: quantal
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

I see this in Quantal, version 12.05-0ubuntu2.

Changed in landscape-client:
status: Incomplete → Confirmed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This is a very old bug that was filed against a version of landscape-client that used the smart package manager. We have since switched to using apt, which is much lighter, but still, takes a while to run a full apt-get update (which is what the reporter does). Do you see this reporter process using a lot of memory and cpu and for a long time?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in landscape-client (Ubuntu):
status: New → Confirmed
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

The process eating CPU is "/usr/bin/python /usr/bin/landscape-package-reporter --quiet". I see no "apt" or "dpkg" processes when this happens.

tags: added: precise
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

"pstree" gives this:

     ├─landscape-clien─┬─landscape-broke───5*[{landscape-broke}]
     │ ├─landscape-manag
     │ └─landscape-monit

Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

I will need to uninstall landscape-client on my Amazon tiny nodes with 512 MB RAM. The python scripts for landscape is simply using too much CPU and RAM resources to afford. Please rewrite it or adapt it to use Python 3.x.

Revision history for this message
Dean Henrichsmeyer (dean) wrote :

I'm closing this one since the original bug is based on smart which is no longer used.

@mariusko, thanks for your comment. We'll investigate if there's something that can be done in the short term to cut down the resource utilization. We certainly want you to be comfortable running landscape-client on your tiny instances.

Changed in landscape-client:
status: Confirmed → Invalid
Changed in landscape-client (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.