-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abysmal performance with default per_txg_dirty_frees_percent during parallel file removal #13932
Comments
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #13932 Closes #13938
This cherry-picks upstream eb9bec0 The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. See openzfs/zfs#13932
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
Unortunately, Windows defines 'long' as 32-bit even on x64 compiles. We create two new macros ZFS_MODULE_LONG and ZFS_MODULE_ULONG. These two will be 'long' on Unix, and let the toolchain handle the size of it. On Windows the two macros are defined as 'int64_t'/'uint64_t'. Clean up source to get Linux builds working (openzfs#119) * Move perfmon functions to windows from zfs_ioctl.h to zfs_ioctl_os.c * remove static for zfs_dirty_data_sync_percent * uint64_t to ZFS_MODULE_ULONG * add ifdef _WIN32 to zvol.c * define posix_memalign_free for other os * add vdev_file_t for other os * remove duplicate check_file * Create build_for_wsl.yaml * move functions to zvol_os.c and add them to the header zvol_impl.h in answer to this discussion openzfsonwindows#119 (comment) * Fix code formatting in reference to openzfsonwindows#119 (comment) * revert the removal of static in dsl_pool.c * remove zfs_dirty_data_sync_percent in dsl_pool.h * make zvol_find_by_name not static * changed workflow name * cstyle zpool_vdev_os.c Fix cstyle complaints (openzfs#125) * clean cstyle * squash * squash * Update zfs_vnops_windows.c * Update zfs_windows_zvol_wmi.c * squash * Additional cstyle fixes * Update sysctl_os.c Upstream: Additional MODULE ULONG Bring per_txg_dirty_frees_percent back to 30 The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938 Co-Authored-By: Jorgen Lundman <[email protected]>
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
This cherry-picks upstream eb9bec0 The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. See openzfs/zfs#13932
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes openzfs#13932 Closes openzfs#13938
The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #13932 Closes #13938
This cherry-picks upstream eb9bec0 The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. See openzfs/zfs#13932
Context: FreeBSD main context on a Windows Dev Kit 2023 using USB3 media, 4 cortex-a78c cores plus 4 cortex-x1c cores, kernel and world tailored/tuned for cortex-a78c (noted in case it matters). Activity: Building ports with poudriere-devel with An interesting related note is that I was getting poudriere bulk builds set up for parallel activity that had long times of load averages <1 (for example) and lots of processes mostly waiting. (UFS did not have the problem. tmpfs use to avoid most zfs use avoided the problem.) Part of what I was seeing for zfs use was the likes of (from
or, an example not involving filemon but involving a null mount:
mjguzik asked me to try for zfs: It leaves me wondering if the setting needs at least some published guidance about picking what (ball park?) values to use for various types of contexts. Automatic picking of a reasonable default figure would be nice if sufficiently reliable across a wide enough range of contexts. There might be a question of what setting would leave fewer contexts needing to adjust away from the default. Or, may be: What setting has the least nasty bad-case consequences. (I have no clue of answers to such.) |
Issue reproduced on FreeBSD and Linux.
I'm running FreeBSD with zfs as of:
I found -j 104 buildkernel performance to be incredibly bad, about twice the time needed by tmpfs and about 1.5 the time needed by ufs. I tracked it down to enormous off cpu time spent waiting on transactions to finish, almost all of which comes from waiting for nodes to be removed.
Check the flamegraph: https://people.freebsd.org/~mjg/zfs-buildkernel-offcpu.svg
I got pointed by @allanjude at vfs.zfs.per_txg_dirty_frees_percent and it indeed is the culprit.
The parameter currently sits at 5, changed from 30 here:
It may be its significance has changed(?).
Anyhow, this is what I get when running -j 104 buildkernel (total real time varies by few seconds for the longer cases between runs, I don't think it matters for this test):
As you can see 25 gives roughly the same performance as 0 (no throttling).
I don't know what values makes the most sense by default, the current one is most definitely bad.
The drive is Micron M600 MTFDDAK1T0MBF MU03, pool has default params + noatime.
Linux is a bare metal box on ec2, doing -j 96 clean after an allyesconfig modules build. I could not be bothered to check all the above cases, but:
May I suggest other people bench their favorite workload(tm) with different parameters?
As is I think the parameter should revert back to 30.
The text was updated successfully, but these errors were encountered: