SABnzbd process number

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
dd44
Newbie
Newbie
Posts: 4
Joined: February 1st, 2010, 8:20 am

SABnzbd process number

Post by dd44 »

Hello,
i'm using SABnzbd 5.0RC3 on a (linux) VPS server with a limited number of process allowed at same time. I can see that "SABnzbd.py" is using 20 proccess when it idle ( pstree ), and i have a maximum process number of 96 allowed :x

So, is there a way to reduce the number of process of sabnzbd like i did for apache ( MaxSpareServers 4 ) ?

Thanks in advance,
David.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: SABnzbd process number

Post by shypike »

SABnzbd uses threads, not processes.
It needs them all.

Just guessing:
If the kernel doesn't have threading support and the Python interpreter
somehow needs processes to compensate for this, you have a problem.
This is beyond my knowledge.
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: SABnzbd process number

Post by switch »

CherryPy can probably be made to use less threads, however it would require changes in SABnzbd.py and I can't find the name of the cherrypy setting that needs changing.
dd44
Newbie
Newbie
Posts: 4
Joined: February 1st, 2010, 8:20 am

Re: SABnzbd process number

Post by dd44 »

Hum ok crap, 20 "thread/procs" on 96 for sabnzb is killing me :x I may take a look at the sources soon but i never coded anything in python language so it may be hard :)
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: SABnzbd process number

Post by shypike »

I have never seen more than one SABnzbd process listed on a Linux system.
If your system has a 96 thread limit, I wish you good luck.
dd44
Newbie
Newbie
Posts: 4
Joined: February 1st, 2010, 8:20 am

Re: SABnzbd process number

Post by dd44 »

Well, your right, it's one process with 20 thread ( well there is near 0 application that use 20 threads anyway ). Just do a "pstree" and you'll see what i mean.
Else, it's a common stuff to limit process/threads on VPS, and around 100 max seems to be common. It's sad because sabnzbd is probably the best thing on linux to do what it's supposed to do, but it don't seems optimised.

For the procnum/thread limit, i'm at around 56 with plesk ( qmail, apache2, mysql, psa server ... ) so it's really enough, but this bring me to 76 on 96 with sabnzbd running :x
Last edited by dd44 on February 2nd, 2010, 3:17 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: SABnzbd process number

Post by shypike »

dd44 wrote: but it don't seems optimised.
Not for a VPS :)
dd44
Newbie
Newbie
Posts: 4
Joined: February 1st, 2010, 8:20 am

Re: SABnzbd process number

Post by dd44 »

Well, i did change the cherrypy thread pool max from 10 to 2, and also a change in two other files. I now have 12 thread running instead of 20, all seems to work correctly but need more testing. Here's the diff in case :

Code: Select all

*** _cpserver.py	2010-02-02 22:10:05.046692131 +0100
--- old/_cpserver.py	2010-02-02 22:09:28.201691987 +0100
***************
*** 48,55 ****
      shutdown_timeout = 5
      protocol_version = 'HTTP/1.1'
      reverse_dns = False
!     thread_pool = 2
!     thread_pool_max = 2
      max_request_header_size = 500 * 1024
      max_request_body_size = 100 * 1024 * 1024
      instance = None
--- 48,55 ----
      shutdown_timeout = 5
      protocol_version = 'HTTP/1.1'
      reverse_dns = False
!     thread_pool = 10
!     thread_pool_max = -1
      max_request_header_size = 500 * 1024
      max_request_body_size = 100 * 1024 * 1024
      instance = None

Code: Select all

*** lib/covercp.py	2010-02-02 22:09:35.098692868 +0100
--- old/covercp.py	2010-02-02 22:08:26.562689195 +0100
***************
*** 351,357 ****
      import cherrypy
      cherrypy.config.update({'server.socket_port': port,
!                             'server.thread_pool': 2,
                              'environment': "production",
                              })
      cherrypy.quickstart(CoverStats())
--- 351,357 ----
      import cherrypy
      cherrypy.config.update({'server.socket_port': port,
!                             'server.thread_pool': 10,
                              'environment': "production",
                              })
      cherrypy.quickstart(CoverStats())

Code: Select all

*** lib/profiler.py	2010-02-02 22:09:38.437692110 +0100
--- old/profiler.py	2010-02-02 22:09:05.618692052 +0100
***************
*** 187,193 ****
  def serve(path=None, port=8080):
      import cherrypy
      cherrypy.config.update({'server.socket_port': int(port),
!                             'server.thread_pool': 2,
                              'environment': "production",
                              })
      cherrypy.quickstart(Profiler(path))
--- 187,193 ----
  def serve(path=None, port=8080):
      import cherrypy
      cherrypy.config.update({'server.socket_port': int(port),
!                             'server.thread_pool': 10,
                              'environment': "production",
                              })
      cherrypy.quickstart(Profiler(path))
Last edited by dd44 on February 2nd, 2010, 4:24 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: SABnzbd process number

Post by shypike »

Good that it works for you.
We're not going to implement this for release 0.5.0.
But possibly later.
Post Reply