Fig.05: How to see LXD containers memory, cpu, network usage info using lxc

Fig.05: How to see LXD containers memory, cpu, network usage info using lxc

Fig.05: How to see LXD containers memory, cpu, network usage info using lxc

You can see the LXD containers memory, cpu, network and other usage info using lxc command.

Display info about the LXD server itself

Type the following command:
$ lxc info
Sample outputs:

apiextensions: []
apistatus: stable
apiversion: "1.0"
auth: trusted
environment:
  addresses: []
  architectures:
  - x86_64
  - i686
  certificate: |
    -----BEGIN CERTIFICATE-----
    MIIFkzCCA3ugAwIBAgIRAIU5VHt2Q9NQKpMsKMNhXZUwDQYJKoZIhvcNAQELBQAw
    NzEcMBoGA1UEChMTbGludXhjb250YWluZXJzLm9yZzEXMBUGA1UEAwwOcm9vdEBk
    ZWxsbTY3MDAwHhcNMTYxMTA3MTE0ODEwWhcNMjYxMTA1MTE0ODEwWjA3MRwwGgYD
    VQQKExNsaW51eGNvbnRhaW5lcnMub3JnMRcwFQYDVQQDDA5yb290QGRlbGxtNjcw
    MDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKetqzI2OyTl7y3gtCJf
    RcXNDKaN/nLf8h60uOJu9dl6zmFq6XaxTMvYSwgZB44dx7vql6JVgpflkANjrM2Z
    XxtDhoN540m/Rpxs/7UFamNA2htKNr70x1ZdEKGzfWJb4AfetmYY3k6tDH7GUKGO
    8BfiI8rt44kfNMLt90Qq6w4YVBcom5rQWDnGHXKZyO+NqlP9fbxSdfrFDJMSq3az
    bG02NzAwghxmZTgwOjpmMjFmOmFmZmY6ZmUxZjoyYzYwLzY0gg8xOTIuMTY4LjIu
    MTUvMjSCHGZlODA6OmYyMWY6YWZmZjpmZTFmOjJjNjAvNjQwDQYJKoZIhvcNAQEL
    BQADggIBAA3uRzNMLK5vhuMvo6kZwrbYIKDftv9qZkp/OElvt9gtjIfkeLNcJGkY
    dIn8Gv4AMYbI12mGL6ITMlFkNqokGXNTI0v/OGGd2vAzFrP2VFF9ut7G7Q9tSKzK
    OP1xc5YSkrFtkFS7D8ah+PHP1T+Sw/0RLwWHo/kTMiAPk/z+qM+CJm5vkZ0hKuEn
    61fryutmiWbU2OmmweZLmwEa0KFJoxqBdR49qICpSp3u8Kmz3/jntL+AbpLtZxqE
    Fw6GB+O252/oadg7EAqJWi7HpMt30NXJATi6tNEZrn4dneQyH+CRxRRZFZ88u9jN
    z4muL25KeSV+xbwzHWIFM67F2Velkr8DcN3MGrYL4d4X8CfSULgnyLhxi0SajhOQ
    grVkP2LxzHz73n1Sv70YUz70gsF1StmAMeFsBQFwRqDKFhnmKbfjtkfOJLj+2L/E
    jnCdiT8/ucRHBwVtUCo1iUM+mgw1lQx5tMxuN1o9EDqNU8O0oUkJt9kdb5BSGQ9K
    7V5/STGtcJE7E0LT90fuE5Fne9WvegNhTH9IkMqoRYSV5NrcbYH2YR0Kl+C1GHtP
    fBAtrGhuB0VOERWt8CsOQFjyDJYoOz1lhdkHB1dRYRXG3fkuVlU+TA0dn+Js57ww
    DHKYJ58278UBT32hq+g4l/iP+8drhTkFmREX0wbPkKLp2mSD8MPF
    -----END CERTIFICATE-----
  certificatefingerprint: 1992616102113cc9f7e36928723381f9a8004469223d4519bbc32180d488cf35
  driver: lxc
  driverversion: 2.0.5
  kernel: Linux
  kernelarchitecture: x86_64
  kernelversion: 4.4.0-45-generic
  server: lxd
  serverpid: 2981
  serverversion: 2.0.5
  storage: zfs
  storageversion: "5"
config:
  storage.zfs_pool_name: nixcraft/lxdvms
public: false

How do I see memory, cpu, and network usage info about given LXD container?

The syntax is:
$ lxc info containerNameHere
$ lxc info cenots-db

Sample outputs:

Name: cenots-db
Remote: unix:/var/lib/lxd/unix.socket
Architecture: x86_64
Created: 2016/11/07 12:49 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 11842
Ips:
  eth0:	inet	10.210.206.58	veth90F8RB
  eth0:	inet6	fe80::216:3eff:fe74:198f	veth90F8RB
  lo:	inet	127.0.0.1
  lo:	inet6	::1
Resources:
  Processes: 10
  Disk usage:
    root: 14.59MB
  Memory usage:
    Memory (current): 35.36MB
    Memory (peak): 38.16MB
  Network usage:
    eth0:
      Bytes received: 6.28kB
      Bytes sent: 2.79kB
      Packets received: 65
      Packets sent: 25
    lo:
      Bytes received: 0 bytes
      Bytes sent: 0 bytes
      Packets received: 0
      Packets sent: 0

Examples and usage: How to install LXD container hypervisor on Ubuntu 16.04 LTS