From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] qemu options: add memory_allocator
Date: Mon, 13 Mar 2023 11:16:00 +0100 [thread overview]
Message-ID: <20230313101600.1041713-1-aderumier@odiso.com> (raw)
Add optional memory_allocator.
Default is glibc malloc, tcmalloc is available to improve performance
of ceph librbd.
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
PVE/QemuServer.pm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 40be44d..8de6c82 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -723,6 +723,14 @@ EODESCR
description => "List of host cores used to execute guest processes, for example: 0,5,8-11",
optional => 1,
},
+ memory_allocator => {
+ optional => 1,
+ type => 'string',
+ enum => [ qw(glibc tcmalloc) ],
+ default => 'glibc',
+ description => "Configure qemu process memory allocator. tcmalloc improve performance of ceph librbd",
+ optional => 1,
+ },
};
my $cicustom_fmt = {
@@ -5909,6 +5917,10 @@ sub vm_start_nolock {
my $run_qemu = sub {
PVE::Tools::run_fork sub {
+
+ $ENV{LD_PRELOAD} = "/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4"
+ if $conf->{memory_allocator} && $conf->{memory_allocator} eq 'tcmalloc';
+
PVE::Systemd::enter_systemd_scope($vmid, "Proxmox VE VM $vmid", %systemd_properties);
my $tpmpid;
--
2.30.2
next reply other threads:[~2023-03-13 10:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 10:16 Alexandre Derumier [this message]
2023-03-13 17:09 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230313101600.1041713-1-aderumier@odiso.com \
--to=aderumier@odiso.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox