sscheib 11 Posted February 3, 2019 Share Posted February 3, 2019 Dear developers, I just noticed a massive load while updating the Emby server and trying to work simultaneously via SSH on the server. Curious as I am I took a look at top and saw a running command, which caught my attention: chown -R emby:emby Apparently this command is issued during the installation of the Emby server package (at least on Debian). You might want to consider using find with the exec flag. See below for the possible performance boost. root@hostname:/tmp# time chown -R emby:emby /var/lib/emby real 3m47.318s user 0m0.632s sys 0m1.816s root@hostname:/tmp# touch /var/lib/emby/bla root@hostname:/tmp# time find /var/lib/emby/ ! \( -uid 999 -o -gid 999 \) -exec chown emby:emby {} \; real 1m19.791s user 0m1.012s sys 0m1.868s root@hostname:/tmp# Roughly estimated 1/3 of time needed to perform the action with the same outcome by preferring find over chown. Of course I did not run find before (so no cache involved). Cheers, Steffen Link to comment Share on other sites More sharing options...
Luke 37000 Posted February 3, 2019 Share Posted February 3, 2019 Thanks for the info, we'll investigate this. Link to comment Share on other sites More sharing options...
sscheib 11 Posted February 18, 2019 Author Share Posted February 18, 2019 Just wanted to bump this one more time, as this issue is still persistent. I have a large database (~80TB) and therefore a lot within the path /var/lib/emby (metadata), so the command will run a good while and increase the load of the server for no reason. Link to comment Share on other sites More sharing options...
Luke 37000 Posted February 18, 2019 Share Posted February 18, 2019 Hi, thanks, it's on our internal issue tracker for issues related to build and packaging. It just has other things waiting in line ahead of it right now. Thanks. Link to comment Share on other sites More sharing options...
Luke 37000 Posted May 20, 2019 Share Posted May 20, 2019 @@sscheib, We are looking into resolving this for the next release. Thanks. Link to comment Share on other sites More sharing options...
Q-Droid 634 Posted May 20, 2019 Share Posted May 20, 2019 @@sscheib, We are looking into resolving this for the next release. Thanks. Please make sure it's tested properly. Both commands would have to access the dir tree therefore it is possible for caching to be in play and skewing the results. Giving the false impression of better performance. Link to comment Share on other sites More sharing options...
sscheib 11 Posted June 6, 2019 Author Share Posted June 6, 2019 Dear developers, I just noticed a massive load while updating the Emby server and trying to work simultaneously via SSH on the server. Curious as I am I took a look at top and saw a running command, which caught my attention: chown -R emby:emby Apparently this command is issued during the installation of the Emby server package (at least on Debian). You might want to consider using find with the exec flag. See below for the possible performance boost. root@hostname:/tmp# time chown -R emby:emby /var/lib/emby real 3m47.318s user 0m0.632s sys 0m1.816s root@hostname:/tmp# touch /var/lib/emby/bla root@hostname:/tmp# time find /var/lib/emby/ ! \( -uid 999 -o -gid 999 \) -exec chown emby:emby {} \; real 1m19.791s user 0m1.012s sys 0m1.868s root@hostname:/tmp# Roughly estimated 1/3 of time needed to perform the action with the same outcome by preferring find over chown. Of course I did not run find before (so no cache involved). Cheers, Steffen Link to comment Share on other sites More sharing options...
Q-Droid 634 Posted June 6, 2019 Share Posted June 6, 2019 You ran a recursive chown on the same dir tree. Unless you rebooted in between and not a nas volume it is possible there was cache involved. I'm not saying that I'm 100% certain, just possible. I haven't tested it myself. Link to comment Share on other sites More sharing options...
sscheib 11 Posted June 6, 2019 Author Share Posted June 6, 2019 Thanks for your opinion. Link to comment Share on other sites More sharing options...
katbyte 21 Posted October 19, 2021 Share Posted October 19, 2021 (edited) I'm hitting this in 2021 - was a solution ever found/posted? it would be nice to have a flag to just skip this as its a 100TB network volume where chown would fail to update any permissions anyways.... this causes the server to often take 10+ min to start as the docker container sits there spinning on trying to verify permissions that are all, always, correct. Edited October 19, 2021 by katbyte Link to comment Share on other sites More sharing options...
Luke 37000 Posted October 19, 2021 Share Posted October 19, 2021 1 hour ago, katbyte said: I'm hitting this in 2021 - was a solution ever found/posted? it would be nice to have a flag to just skip this as its a 100TB network volume where chown would fail to update any permissions anyways.... this causes the server to often take 10+ min to start as the docker container sits there spinning on trying to verify permissions that are all, always, correct. We'll respond in your topic. Thanks. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now