kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Lazarev <alexandru.lazarev@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Performance Degradation with rsync in container or cgroupv2 with MEM limit
Date: Wed, 26 Mar 2025 14:11:41 +0200	[thread overview]
Message-ID: <CAL93h0HkF_f8tgTTqKppNpOX=QnsWQA8F9XFAsDD3OF4mh1UzQ@mail.gmail.com> (raw)

Hi everyone,
I'm experiencing a significant performance degradation when using
"rsync" to copy files over the network from within a container or
cgroup with memory limits on Oracle Linux 9.2. The issue occurs with
the Red Hat Compatible Kernel (RHCK) 5.14.0-284.11.1.el9_2.x86_64 but
not with the Unbreakable Enterprise Kernel (UEK)
5.15.0-101.103.2.1.el9uek.x86_64.

Details:
Setup: Oracle Linux 9.2 with containers/cgroups having memory limits.
Issue: Network file copying speed drops drastically when memory limits
are hit, specifically when the page cache (inactive files) fills up.
Tests:
- Using "rsync" from within a container or a cgroup to copy data from
remote source.
- Using "pg_basebackup" PostgreSQL data replication between two PG
Containers (Leader vs Replica).
Results:
- Initial high speeds (~100MBps) drop significantly (to ~1MBps) once
memory limits are reached.

Commands to Reproduce:
1. Create cgroup with memory limit and run rsync:
sudo systemd-run --scope --property=MemoryMax=1G rsync -av --progress
rsync://<source_ip>/files /destination_path

2. Test with drop_caches on hosting OS during slow rsync:
free && sync && echo 3 > /proc/sys/vm/drop_caches && free
After cache is dropped, rsync is again fast until MEM limit is reached again

Observations:
- When the container's memory limit is reached, the page cache
(inactive files) fills up, leading to network bandwidth degradation.
- This affects, for example, PostgreSQL replication, causing lag and
potential data loss.

Has anyone else encountered this issue? Any insights or suggestions on
how to address correctly (or maybe workarounds) this would be greatly
appreciated!

Thanks in advance!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2025-03-26 12:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 12:11 Alexandru Lazarev [this message]
2025-03-26 14:00 ` Performance Degradation with rsync in container or cgroupv2 with MEM limit Greg KH
2025-03-26 14:10   ` Alexandru Lazarev
2025-04-09 11:30     ` Alexandru Lazarev

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='CAL93h0HkF_f8tgTTqKppNpOX=QnsWQA8F9XFAsDD3OF4mh1UzQ@mail.gmail.com' \
    --to=alexandru.lazarev@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /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;
as well as URLs for NNTP newsgroup(s).