Greyhole
Greyhole copied to clipboard
Greyhole slow when transferring things via Radarr/Sonarr etc.
Heya,
I've just upgraded from Ubuntu 20.04 to 22.04, and things have gone absolutely awfully slow.
Unsure if this was due to the upgrade in Samba etc.
To start with, what would be the best way of fully wiping Greyhole (including removing the DB), and starting fresh?
I suspect my setup has been running for quite a while with quite a few changes, so a fresh install (backing up greyhole.conf and smb.conf obviously) would probably be a good starting place (especially as the DB may be quite large/unoptimised).
That way I can also do the VFS things as well.
It seems that copying anything from a non-greyhole/samba share into a greyhole/samba share causes the slowdowns.
Currently we're looking at around 1-5kb/s average throughput rate.
I have reinstalled Greyhole, removed mysql, and replaced it with MariaDB (far lower resource usage too), and I've also reinstalled Samba, same issues unfortunately.
No much Greyhole-related is used, when copying files onto a share : Samba handles this by itself, and will log some data for the Greyhole daemon to work with, once the file is finished being written to.
Some Samba version will log a "lot" of "write" logs, and this is why those logs are stored in /var/spool/greyhole/mem
, which is a tmpfs (a filesystem stored in RAM), so writing in there would be very fast, and thus not cause any slowdown.
Maybe look into this ; check that this folder in indeed a tmpfs, and maybe try to stop the Greyhole daemon, and write some files in there, to make sure it works fast enough. (It's a 4MB FS, so you won't be able to write a lot of data, maybe try to rapidly create a lot of small files; it should be very fast.) Make sure to remove those test files before your restart the Greyhole damon ; not sure it would be happy to find files with content it does not expect in there.
Also : did you try to just comment out, temporarily, the vfs objects = greyhole
line, for the target share?
Try to copy a file manually, make sure it is slow, then comment out that line for the target share, restart samba, and try the same file copy. If it is now slow anymore, then you will know the VFS module is indeed the culprit. (De-comment the line and restart Samba.)
File is going from /var/hda/files/drives/drive12/downloads
(non-Greyhole) to /var/hda/files/drives/drive12/Greyhole/requests
(Greyhole).
Without vfs objects (and restarted GH + Samba)
[Requests]
path = /var/hda/files/drives/drive12/Greyhole/requests
create mask = 0775
dfree command = /usr/bin/greyhole-dfree
directory mask = 0775
force create mode = 0664
force directory mode = 0775
valid users = alex
#vfs objects = greyhole
write list = alex
Looks like the spool folder is barely being used in this particular case:
And GH logs seem to be acceptable:
Oct 04 01:04:57 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:04:57 DEBUG sleep: Nothing to do... Sleeping.
Oct 04 01:05:01 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:07 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:07 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:07 INFO write: Now working on task ID 192641: write Requests/Movies/FileInQuestion.mkv
Oct 04 01:05:07 INFO write: File created: Requests/Movies/FileInQuestion.mkv - 412MB
Oct 04 01:05:07 DEBUG write: Loading metafiles for Requests/Movies/FileInQuestion.mkv ...
Oct 04 01:05:07 DEBUG write: Got 0 metadata files.
Oct 04 01:05:08 DEBUG write: File Requests/Movies/FileInQuestion.mkv is locked by another process (smbd, PID 2843598). Will wait until it's unlocked to work on any file in this share.
Oct 04 01:05:08 DEBUG write: Deleting 20 future 'write' tasks that are duplicate of this one.
Oct 04 01:05:08 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:08 DEBUG sleep: Nothing to do... Sleeping.
Oct 04 01:05:12 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:17 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:18 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:18 INFO write: Now working on task ID 192641: write Requests/Movies/FileInQuestion.mkv
Oct 04 01:05:18 INFO write: File created: Requests/Movies/FileInQuestion.mkv - 426MB
Oct 04 01:05:18 DEBUG write: Loading metafiles for Requests/Movies/FileInQuestion.mkv ...
Oct 04 01:05:18 DEBUG write: Got 0 metadata files.
Oct 04 01:05:19 DEBUG write: File Requests/Movies/FileInQuestion.mkv is locked by another process (smbd, PID 2843598). Will wait until it's unlocked to work on any file in this share.
Oct 04 01:05:19 DEBUG write: Deleting 18 future 'write' tasks that are duplicate of this one.
Oct 04 01:05:19 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:19 DEBUG sleep: Nothing to do... Sleeping.
Oct 04 01:05:22 DEBUG read_smb_spool: Processing Samba spool...
Oct 04 01:05:28 DEBUG read_smb_spool: Processing Samba spool...
Samba config is pretty generic: https://paste.modem7.com/ZrSl8AyXLB
Syslog: https://paste.modem7.com/44rCXnXodM
https://user-images.githubusercontent.com/4349962/193706666-9f22eb01-b4bb-482c-a18e-0576da0a23bb.mp4