← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1980150] [NEW] cloud-init collect-logs can use too much memory

 

Public bug reported:

if the journal is large, or the machine doesn't have a lot of memory,
cloud-init collect-logs can cause an OOM.

The problem is that we are reading the entire journal into memory and then writing it out:
https://github.com/canonical/cloud-init/blob/a23c886ea2cd301b6021eb03636beb5b92c429dc/cloudinit/cmd/devel/logs.py#L151

We should not buffer the entire journal in memory.  I think redirecting
it to an output file would not cause a memory spike.

Thanks,
Pradip Dhara


1. cloud-provider: azure
2. i don't think the cloud-init configuration is relevant here.  But, I can provide it if needed.
3. can't do because cloud-init collect-logs is crashing
4. i can get dmesg logs if you like. But, I don't think it is relevant to this bug.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1980150

Title:
  cloud-init collect-logs can use too much memory

Status in cloud-init:
  New

Bug description:
  if the journal is large, or the machine doesn't have a lot of memory,
  cloud-init collect-logs can cause an OOM.

  The problem is that we are reading the entire journal into memory and then writing it out:
  https://github.com/canonical/cloud-init/blob/a23c886ea2cd301b6021eb03636beb5b92c429dc/cloudinit/cmd/devel/logs.py#L151

  We should not buffer the entire journal in memory.  I think
  redirecting it to an output file would not cause a memory spike.

  Thanks,
  Pradip Dhara

  
  1. cloud-provider: azure
  2. i don't think the cloud-init configuration is relevant here.  But, I can provide it if needed.
  3. can't do because cloud-init collect-logs is crashing
  4. i can get dmesg logs if you like. But, I don't think it is relevant to this bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1980150/+subscriptions



Follow ups