Re: Very high memory usage with KVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Avi.

On Sunday, 26 July 2009 14:31:57 +0300,
Avi Kivity wrote:

> >I have an installation with Ubuntu Hardy Heron server amd64 with KVM-62
> >from Ubuntu repositories installed on an HP Proliant DL380 G5 with two
> >Xeon E5405 quadcore processors and 16 GiB of RAM which has six VMs with
> >the following configuration of memory:
> >
> >Hostname       |      RAM
> >===============+===============
> >Ganimedes      |    2 GiB
> >Os             |    1 GiB
> >Aprender       |    2 GiB
> >Aps0           |    2 GiB
> >Aps2           |    4 GiB
> >Ratatoskr      |    4 GiB
> >===============+===============
> >TOTAL          |   15 GiB
> >
> >
> >Initially the host was created with a swap partition of 1 GiB (more 1
> >GiB than was free for use of host) but this amount with the time
> >remained short and I had to add a LV of 7 GiB to be used with swap,
> >being now a total of 8 GiB of swap of which at this moment I have only a
> >9% free. Is 'normal' this use of memory?
> >
> >root@ss02:~# ps -e --sort -rss -Ho user,start_time,pid,pcpu,pmem,rss,size,vsz,args
> >USER     START   PID %CPU %MEM   RSS    SZ    VSZ COMMAND
> >[...]
> >root     Jul06 27471 52.3 24.4 4023232 4292200 4350296   kvm<ratatoskr>
> >root     Jul24  9955  137 23.8 3923620 4308592 4350308   kvm<aps2>
> >root     Jul06  8751  5.8  8.3 1368228 2171808 2229888   kvm<aps0>
> >root     Jul07  8565  2.7  5.2 862844 2204704 2246416   kvm<aprender>
> >root     Apr22  7842  0.6  3.6 600072 2172056 2230136   kvm<ganimedes>
> >root     Jul01  7944  0.6  2.0 334860 1119916 1177996   kvm<os>
> >
> >root@ss02:~# free
> >              total       used       free     shared    buffers     cached
> >Mem:      16463388   16377844      85544          0     894216      66328
> >-/+ buffers/cache:   15417300    1046088
> >Swap:      8319948    7621916     698032
> >
> >
> >Updating to KVM-84 or superior can improve this situation?
 
> What is the storage configuration? Are you using qcow2?

The host machine has 8 x 300 GiB SAS disk in RAID 5 by hardware (7 disks
with 1 spare) on 1 logicaldrive. The partitioning scheme of host is the
following one:


root@ss02:~# fdisk -l /dev/cciss/c0d0

Disk /dev/cciss/c0d0: 1799.7 GB, 1799797127168 bytes
255 heads, 63 sectors/track, 218812 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000af3c3

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1               1         122      979933+  82  Linux swap / Solaris
/dev/cciss/c0d0p2   *         123        1338     9767520   83  Linux
/dev/cciss/c0d0p3            1339      218812  1746859905   8e  Linux LVM


I'm not using qcow2 files. The /dev/cciss/c0d0p3 partition is a physical
volume that maintains the logical volumes that are used for VM's disks:


root@ss02:~# pvs
  PV                VG   Fmt  Attr PSize PFree
  /dev/cciss/c0d0p3 vm   lvm2 a-   1,63T 1,13T


> What are the image logical and physical sizes?

The disks for the VMs have these sizes:

  aprender-raiz   vm   -wi-ao   8,00G
  aprender-space  vm   -wi-ao  20,00G

  aps0-raiz       vm   -wi-ao   7,00G
  aps0-space      vm   -wi-ao  10,00G

  aps2-cache      vm   -wi-ao  20,00G
  aps2-index      vm   -wi-ao  10,00G
  aps2-raiz       vm   -wi-ao   7,00G
  aps2-space      vm   -wi-ao  10,00G

  ganimedes-raiz  vm   -wi-ao   5,00G
  ganimedes-space vm   -wi-ao  10,00G

  os-disk         vm   -wi-ao   6,00G
  os-mailbox      vm   -wi-ao 150,00G
  os-space        vm   -wi-ao  10,00G

  ratatoskr-raiz  vm   -wi-ao   8,00G
  ratatoskr-space vm   -wi-ao 200,00G

With respect to the internal partitioning scheme for each one of the
VMs, it is the following one:

* Aprender:

aprender:~# fdisk -l /dev/hda

Disk /dev/hda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1         486     3903763+  82  Linux swap / Solaris
/dev/hda2             487        1044     4482135   83  Linux
aprender:~#
aprender:~#
aprender:~# fdisk -l /dev/hdb

Disk /dev/hdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        2610    20964793+  83  Linux


* Aps0:

[root@aps:~]
$fdisk -l /dev/hda

Disco /dev/hda: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00039c2a

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hda1               1         365     2931831   82  Linux swap / Solaris
/dev/hda2             366         913     4401810   83  Linux
[root@aps:~]
$
[root@aps:~]
$fdisk -l /dev/hdb

Disco /dev/hdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00087cc1

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdb1               1        1305    10482381   83  Linux


* Aps2

aps2:~# fdisk -l /dev/hda

Disco /dev/hda: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004b793

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hda1               1         365     2931831   82  Linux swap /
Solaris
/dev/hda2             366         913     4401810   83  Linux
aps2:~#
aps2:~#
aps2:~# fdisk -l /dev/hdb

Disco /dev/hdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0009491d

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdb1               1        1305    10482381   83  Linux
aps2:~#
aps2:~#
aps2:~# fdisk -l /dev/hdc

Disco /dev/hdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdc1               1        1305    10482381   83  Linux
aps2:~#
aps2:~#
aps2:~# fdisk -l /dev/hdd

Disco /dev/hdd: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdd1               1        2610    20964793+  83  Linux


* Ganimedes:

[root@ganimedes:~]
$fdisk -l /dev/hda

Disco /dev/hda: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0002cad1

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hda1               1         122      979933+  82  Linux swap /
Solaris
/dev/hda2             123         652     4257225   83  Linux
[root@ganimedes:~]
$
[root@ganimedes:~]
$fdisk -l /dev/hdb

Disco /dev/hdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007e07e

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdb1               1        1305    10482381   83  Linux


* Os:

os:~# fdisk -l /dev/hda

Disco /dev/hda: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000a78a9

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hda1               1         243     1951866   82  Linux swap /
Solaris
/dev/hda2             244         783     4337550   83  Linux
os:~#
os:~#
os:~# fdisk -l /dev/hdb

Disco /dev/hdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000dffb2

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdb1               1        1305    10482381   83  Linux
os:~#
os:~#
os:~# fdisk -l /dev/hdc

Disco /dev/hdc: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0x90c7dc67

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/hdc1               1       19581   157284351   83  Linux



* Ratatosk:

ratatoskr:~# fdisk -l /dev/hda

Disk /dev/hda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1         486     3903763+  82  Linux swap /
Solaris
/dev/hda2             487        1044     4482135   83  Linux
ratatoskr:~#
ratatoskr:~#
ratatoskr:~# fdisk -l /dev/hdb

Disk /dev/hdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       26108   209712478+  83  Linux


> What is the host kernel (uname -a)?

root@ss02:~# uname -a
Linux ss02 2.6.24-19-server #1 SMP Wed Aug 20 18:43:06 UTC 2008 x86_64 GNU/Linux



Thanks for your reply.
 
Regards,
Daniel
-- 
Fingerprint: BFB3 08D6 B4D1 31B2 72B9  29CE 6696 BF1B 14E6 1D37
Powered by Debian GNU/Linux Squeeze - Linux user #188.598

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux