svenjacobs / sabdrop

SABnzbd client for Google Chrome (unmaintained)
GNU General Public License v3.0
7 stars 1 forks source link

Make query interval configurable #14

Closed svenjacobs closed 12 years ago

svenjacobs commented 12 years ago

The query interval (to the server, currently every five seconds) should be configurable.

bdragos commented 12 years ago

Hi Sven,

I am the reviewer that complained about this on Chrome webstore. I can provide more info on request but here is what happened. Several day ago I noticed that my home connection to internet was very slow and after eliminating possible causes I discovered that turning my Apache server off solves the problem. At that point I though someone was scraping my website so I didn't investigate further. Yesterday I started my Apache again and the problem came back immediately. I installed some monitoring tools and I discovered that the requests are coming from my work computers (I had a couple of machines with Chrome browser opened). This is how I got to the sabdrop plugin. This is the request:

HOST/api?mode=queue&output=json&apikey=KEY

In the first day the upload bandwidth was 3GB. If you need more info please let me know.

Thanks, Dragos

svenjacobs commented 12 years ago

Hi bdragos,

thank you for the additional information. I'm not really sure how this could have happened and 3GB seems a lot in just one day.

Can you please post the SABdrop entries (queries to your SABnzbd) of your Apache log file (API key removed, of course)?

I'm especially interested in the interval the queries where sent. It should be every five seconds. If it's (much) higher something really went wrong here.

Thank you.

svenjacobs commented 12 years ago

So I've looked at this issue a bit closer and I think the responses of the history API call can become quite big, especially if you have many old, completed downloads in your SABnzbd history.

I'm now limiting the results of the API call to 10 items and have increased the query interval to 10 seconds. This will be in the next release.

But still if you keep your browser open for 24 hours and assuming a history response weights 50kb, this sums up to roughly 400MB a day.

( size of response * requests per minute * minutes of hour * hours of day ) / 1024

( 50 * (60 / 10) * 60 * 24 ) / 1024 = 421 MB

bdragos commented 12 years ago

I was about to respond to this. Looking over the access log I can see a lot of history calls and they are quite big. If you leave more than one browser open it can get to really big numbers. I have prepared the access log for upload but I don't know where to do it I can send it directly to your published email if you still need it.

Dragos

svenjacobs commented 12 years ago

Please send the log to mail@svenjacobs.com. Thanks!

svenjacobs commented 12 years ago

This issue has been fixed (or let's say improved) in version 0.6.2