Page 1 of 1

Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 27th, 2019, 3:16 pm
by FCrane
Hi!

I'm using NZBDonkey to intercept NZB links and push them directly to Sabnzbd+ (which is running on another Windows computer in the LAN). I'm suing the API key to access Sabnzbd+ from the other computer. The problem is, that pushing the NZBs takes extremely long (at least 30 seconds, several minutes for larger NZBs)!

When I push several NZBs simultaneously (meaning I start pushing a second one during the first one still pushing), I get Errors like this:

ERROR a few seconds ago [27/Oct/2019:20:58:54] HTTP
Traceback (most recent call last):
File "cherrypy\_cprequest.pyo", line 663, in respond
File "cherrypy\_cpreqbody.pyo", line 989, in process
File "cherrypy\_cpreqbody.pyo", line 558, in process
File "cherrypy\_cpreqbody.pyo", line 223, in process_multipart_form_data
File "cherrypy\_cpreqbody.pyo", line 215, in process_multipart
File "cherrypy\_cpreqbody.pyo", line 556, in process
File "cherrypy\_cpreqbody.pyo", line 715, in default_proc
File "cherrypy\_cpreqbody.pyo", line 730, in read_into_file
File "cherrypy\_cpreqbody.pyo", line 669, in read_lines_to_boundary
EOFError: Illegal end of multipart body.

What ist the problem? Why is this so slow and producing errors? My LAN is gigabit speed, both involved computers are fast enough and I'm using Sab 2.3.9 (although this problem has always existed with any version). When I e.g. try NZBGet insted of Sabnzbd+, pushing the same NZBs is almost instantaneous with the same configuration.

It would be nice if this problem could be fixed.

Regards!

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 28th, 2019, 2:08 am
by sander
Simulate NZB-add-via-API using something like

Code: Select all

curl -v  http://192.168.1.1:8080/sabnzbd/api -F apikey=8da6c9215826c05ebac0c9526697cb46 -F mode=addfile -F output=xml -F "name=@/home/sander/Downloads/mynzb.nzb"

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 28th, 2019, 2:38 am
by FCrane
What will be different when simulating the push?

It seems to be a general performance problem of Sab when pushing larger NZBs. The program completely freezes, downloads and postprocessing stops, , the web interface is not accessible anymore, etc.

Hard to believe I'm the only one seeing this problem...

Regards!

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 28th, 2019, 3:13 am
by sander
Ok, good luck then!

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 28th, 2019, 6:54 am
by FCrane
When I try the CURL example, I get the following:

* Trying 192.168.0.100...
* TCP_NODELAY set
* Connected to 192.168.0.100 (192.168.0.100) port 8080 (#0)
> POST /sabnzbd/api HTTP/1.1
> Host: 192.168.0.100:8080
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Length: 525
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------1bcc82fe742ea5ef
>
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Content-Length: 118
< Vary: Accept-Encoding
< Server: CherryPy/8.1.2
< Pragma: no-cache
< Date: Mon, 28 Oct 2019 11:52:54 GMT
< Access-Control-Allow-Origin: *
< Content-Type: text/xml;charset=utf-8
<
<?xml version="1.0" encoding="UTF-8" ?>
<result><status>False</status>
<error>expect one parameter</error>
</result>


... and nothing is pushed to Sab.

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 31st, 2019, 9:31 am
by safihre
Strange, unless you have 4K blu-rays it shouldn't take that long.. What are the file sizes you are using?

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: October 31st, 2019, 4:12 pm
by FCrane
The NZB files are about 10 MB. Some even larger.

It realls is a performance problem - Sab stops all activities (and responding) during the time it gets a NZB pushed. Everything else seems to be fast, only pushing NZBs via API is extremely slow.

I really wish it was written in C++, then all these performance issues would most likely not exist...

Regards!

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: November 1st, 2019, 8:26 am
by safihre
That would indeed be great.. However it's not, we have to deal with Python.
Although in the new Python 3 version I have improved NZB-import functioning a lot :)

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: November 1st, 2019, 9:48 am
by FCrane
Still, importing NZBs seems to be an extreme bottleneck causing the whole program to freeze for a long time, which in turn causes a lot of problems and errors...

The code definitely needs a lot of optimization - maybe simply use more memory, etc.

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: November 5th, 2019, 1:47 am
by safihre
Just to be sure: in the Status and Interface settings window, what is you logging level set to? Errors/Warnings only?
The importer generates a lot of logging if set to Debug, making it very slow.

As mentioned before the Python 3 version is much faster. It takes a few seconds only to import 10MB files.

Re: Pushing NZBs to Sabnzbd+ via API extremely slow!

Posted: November 5th, 2019, 9:03 am
by FCrane
Hi!

The logging level is set to "+Info".

Where do I get the Python 3 version? I'm using the regular v2.3.9 available from the website.

Regards!