Using a Raspberry Pi is kinda a bumpy ride. It works well for most of the time, but sometimes, it slows down for no reason.
try giving bitcoind (and your lightning daemon) a positive nice number, e.g.
nice -n 9 /usr/bin/bitcoind
this tells the linux kernel to de-prioritize CPU cycles that would otherwise be scheduled for a given process. All userland processes have an implicit nice value of zero, which means there's a FIFO style dynamic in the way they are served by the CPU. The range of valid nice values is from 19 (maximally nice) to -20 (not at all nice). htop tells you what nice value is assigned, possibly top will too
this should help to smooth out resource usage on a raspi
another angle is to boot directly from an SSD (and put your swapfile on the SSD also). This might only work on rasPi 3's, cannot remember specifically. The /boot partition can stay on your microSD, as it's not performance contingent, and likely read-only too. You just need to tell the config files in /boot to start the init process from /dev/sda (or whatever device your SSD system disk is)