tags:

views:

80

answers:

2

I am both a contributor and user of the nntp nzb leecher called hellanzb for Unix like systems. It is written in python and works quite well. Though when the transmission rate is high and the program is utilizing app's like par and unrar, most systems come to a standstill. If you are downloading a dvd rip at 10MB/s while unraring the last one with unrar, the users entire system will just halt.

The problem is less common in FreeBSD as it favour's interactive jobs, but Linux is where we have most of the problems. Even when we use "nice 19 hellanzb", setting it to be the least important the system still come to a standstill.

Our program works, and is agressive but that seems to be what the user wants. The user does not want his system to become unusable when downloading a file and extracting it. We dont want to limit our software internally, we would rather have the scheduler just focus more on interactive applications rather than batch.

Is there a better way to do this?

+1  A: 

It's not clear from your question, but it seems as though you're launching various processes as part of what your app does. If so, you'll have to explicitly control the niceness of those processes yourself, when you launch them, which is an OS-specific thing to do.

If you're forking/execing, you could use os.nice().

Jonathan Feinberg
we fork ourselves to run those programs, so they retain the nice value of our main app.
Recursion
+1  A: 

It sounds like you exceeded the entire IO capacity of the system before running out of CPU. I recall something about an ionice somewhere but I can't remember where.

Joshua