Upgrade on rasberry pi make it unresponsive

I use a rasberry pi (3B) to host a server at home, and the web server have a lot of latency issue when I perform an update (as in, it goes from around 500ms to something around 1 to 10s). Grafana show that most of the CPU time is spent on iowait, so it looks like that the microSD card I use as storage is not good enought to handle concurrently all the read need from the server and the write need of a nix update.

I’ve tried to set the IO class of the Nix daemon to “IDLE”, but I didn’t have much better latency (the number given before are when the nix daemon is in the IDLE class). It however seems to have a visible inpact on how long it take to perform the upgrade.

Do you think there are way to make it more responsive during an upgrade from a software perspective (for example, for limiting the IO capacity of the nix daemon to 0.5MiB/s) ?

The server I’m hosting is dokuwiki, which is a PHP application.

Perhaps it’s like this? modules/nix-daemon: Replace daemon(IO)NiceLevel options by illdefined · Pull Request #138741 · NixOS/nixpkgs · GitHub