I’ve had the same issue in the past (running on Raspberry Pi 3b). After about 1 1/2 days of continuously running it would just slow down. My solution was just to reboot it automatically (sometime during the night and then sometime before i got home from work). Works like a charm since.
I added the below to my /etc/crontab file.
(It also contains commands for turning on/ off my HDMI monitor for when I’m not home or am sleeping)
FOR REBOOTING a few times every day (Raspberry Pi gets slow every other day… so reboot)
Weekdays
Reboot at 5:30, turn off monitor at 8:45
Reboot at 16:00, turn off monitor at 10:00
30 5 * * 1,2,3,4,5 root /sbin/shutdown -r now
45 8 * * 1,2,3,4,5 root /usr/bin/vcgencmd display_power 0
00 16 * * 1,2,3,4,5 root /sbin/shutdown -r now
00 22 * * 1,2,3,4,5 root /usr/bin/vcgencmd display_power 0
Weekends
Reboot at 5:30
Reboot at 16:00, turn off monitor at 10:00
30 5 * * 6,7 root /sbin/shutdown -r now
00 16 * * 6,7 root /sbin/shutdown -r now
00 22 * * 6,7 root /usr/bin/vcgencmd display_power 0