Announcement

Collapse
No announcement yet.

Scanner Priority set to -20 but running at regular nice level

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scanner Priority set to -20 but running at regular nice level

    > This can't work, since the unprivileged user LMS runs as can only choose
    > a lower priority


    Which means we should probably remove it from LMS?...
    puddletag - now packaged in most Linux distributions.

    #2
    Scanner Priority set to -20 but running at regular nice level

    Scanner Priority is set to -20 and rescans initiated by LMS are with --priority=-20, however looking at the scanner.pl process using HTOP it's running at 20? Should scanner.pl's priority no be -20 when set accordingly in LMS?
    puddletag - now packaged in most Linux distributions.

    Comment


      #3
      I have never tried it ... but set it to 10 and -10 to see if it shows that the number is being used etc
      Paul Webster
      Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
      and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

      Comment


        #4
        Originally posted by Paul Webster View Post
        I have never tried it ... but set it to 10 and -10 to see if it shows that the number is being used etc
        It's been years since I was a frequent user of LMS so a little rusty coming back, but I seem to recall it would actually run at the priority set, which it doesn't appear to be doing now.. I'm manually changing the priority outside of LMS and the rescan definitely seems to run faster when that's done.
        puddletag - now packaged in most Linux distributions.

        Comment


          #5
          Scanner Priority set to -20 butrunning at regular nice level

          LMS is using the "setpriority" system call on unixy system. I couldn't
          find any special handling of the value whatsoever. I assume you're on Linux?
          Michael

          "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
          (LMS: Settings/Information)

          Comment


            #6
            This can't work, since the unprivileged user LMS runs as can only choose a lower priority
            simple solution: set priority in service unit / init script
            better solution: add CAP_SYS_NICE capability in service unit / init script (or set LimitNICE instead)
            Various SW: Web Interface | Text Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Ambient Noise Mixer | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
            Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

            Comment


              #7
              Originally posted by mherger View Post
              LMS is using the "setpriority" system call on unixy system. I couldn't
              find any special handling of the value whatsoever. I assume you're on Linux?
              LMS on Linux, yes.

              Originally posted by Roland0 View Post
              This can't work, since the unprivileged user LMS runs as can only choose a lower priority
              simple solution: set priority in service unit / init script
              better solution: add CAP_SYS_NICE capability in service unit / init script (or set LimitNICE instead)
              It used to work years ago, perhaps something in the code has changed or my permissions in this instance are different from what a default distro based install would be. I'm in essence just unpacking the odd nightly to update my install.

              Originally posted by mherger View Post
              > This can't work, since the unprivileged user LMS runs as can only choose
              > a lower priority


              Which means we should probably remove it from LMS?...
              Please don't, it'd be better to implement a fix. For large libraries being able to run scanner.pl at -20 is essential to avoid lengthy update scans.
              puddletag - now packaged in most Linux distributions.

              Comment


                #8
                Originally posted by mherger View Post
                > This can't work, since the unprivileged user LMS runs as can only choose
                > a lower priority


                Which means we should probably remove it from LMS?...
                Not necessarily, as mentioned modifying the service unit / init script should fix this
                systemd (not tested, as I don't use it):
                - set LimitNICE (preferred)
                - or set CAP_SYS_NICE capability (potential security implications)

                non-systemd distros eg. Devuan:
                - config in /etc/security/limits.d/
                - start-stop-daemon --capabilities option

                Originally posted by audiomuze
                Please don't, it'd be better to implement a fix. For large libraries being able to run scanner.pl at -20 is essential to avoid lengthy update scans.
                You can simply modify the service unit to include

                Code:
                Nice=
                CPUSchedulingPolicy=
                CPUSchedulingPriority=
                IOSchedulingClass=
                IOSchedulingPriority=
                Various SW: Web Interface | Text Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Ambient Noise Mixer | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
                Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

                Comment


                  #9
                  Originally posted by Roland0 View Post
                  You can simply modify the service unit to include

                  Code:
                  Nice=
                  CPUSchedulingPolicy=
                  CPUSchedulingPriority=
                  IOSchedulingClass=
                  IOSchedulingPriority=
                  Would that not cause LMS to run at highest priority, rather than only scanner.pl when invoked?
                  puddletag - now packaged in most Linux distributions.

                  Comment


                    #10
                    Originally posted by audiomuze View Post

                    Would that not cause LMS to run at highest priority, rather than only scanner.pl when invoked?
                    Yes. Exact behavior may depend on LMS spawning the external scanner or using the internal one.
                    Or use LimitNICE / capabilities
                    Various SW: Web Interface | Text Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Ambient Noise Mixer | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
                    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

                    Comment


                      #11
                      Originally posted by audiomuze View Post
                      Please don't, it'd be better to implement a fix. For large libraries being able to run scanner.pl at -20 is essential to avoid lengthy update scans.
                      What kind of hardware are you running your LMS on. In my experience I found the scanner to be mostly I/O bound, not CPU.
                      Michael

                      "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                      (LMS: Settings/Information)

                      Comment


                        #12
                        Originally posted by mherger View Post

                        What kind of hardware are you running your LMS on. In my experience I found the scanner to be mostly I/O bound, not CPU.
                        i5-7600T, Arch Linux, 2x local SATA3 drives, 16GB RAM. I've always found scan to run faster if set to -20. In years gone by it used to run as highest priority without requiring intervention.
                        puddletag - now packaged in most Linux distributions.

                        Comment

                        Working...
                        X