Page 1 of 1

adjusting zma process priority "nice" value

Posted: Tue Jun 21, 2005 9:18 pm
by gsrturbo
I own a small computer store, one of the things we do is setup small businesses with Fedora Core 3 (Thinking about switching to debian) servers which usually act as a basic file/print/email/web server for their business.

We are going to be offering ZoneMinder solutions pre configured as an option with these same servers. They will basically be an all in one business server providing all the basics a small businees might require.

The specs on these servers usually isn't anything special, AMD 3000+/1GB DDR/250GB HD.

Something I have noticed during my testing of the zoneminder setup in the office is that doing a print job either via a smb print share over the network OR from the server machine itself is VERY slow IF a camera is recording at the same time as the print job. If no cameras are recording it is fast as can be. This is easily remedied by adjusting the "nice" value of the zma processes to 19. This allows the other processes such as the cups printing service to do what it needs to then give it all back when done. Video quality/performance is not effected with this new value.

My Question... how to do this automatically during startup? I did this manually using top and adjusting the nice value after startup. I need this to be done automatically when zm starts up. This would seem to be done in the "zmpkg.pl" file but I can't seem to get anything to work.

Any help would be greatly appreciated.

Thank You!

Posted: Tue Jun 21, 2005 10:17 pm
by zoneminder
I think it would require a mod to zma.cpp itself, by inserting a call to the nice function in main. Otherwise it's zmdc.pl that starts the processes and it might be a bt more of a hack to do something special to zma only.

Phil

Posted: Tue Jun 21, 2005 10:18 pm
by gsrturbo
***UPDATE***

I made a temporary workaround, but I'm sure there is a much more eligant way to do this. Perhaps something where it is an adjustable value in the DB for "nice value"

I added this to the end of the init script in /etc/init.d/zm

I added this just above the exit command:

Code: Select all

ps awx | grep "/usr/lib/zm/bin/zma -m" | grep -v grep | awk '{print $1}' | xargs -i renice 19 -p {}

It Now Looks Like This:

Code: Select all

esac

ps awx | grep "/usr/lib/zm/bin/zma -m" | grep -v grep | awk '{print $1}' | xargs -i renice 19 -p {}

exit $RETVAL

Posted: Tue Jun 21, 2005 10:19 pm
by zoneminder
That might do it as well!

Phil

Posted: Tue Jun 21, 2005 10:23 pm
by gsrturbo
Thank you for your reply Phil, you just beat me to my update!

Yes after looking into it a bit more it does seem a little tougher than I thought to modify the nice value of JUST the zma process.

This does what I need it to so I guess all is well.

Just so you know we plan on donating a percentage of all zomeminder setup sales. It is well deserved for your hard work into this great piece of software! I encourage others setting up ZM for profit to do the same, it is the least we can do.

Thanks Again!!!