cgru icon indicating copy to clipboard operation
cgru copied to clipboard

Task ressources is collected from machine ressources

Open ghostvfx-jimmy opened this issue 2 years ago • 8 comments

Task ressources are collected from machine ressources and not actual task ressources. When running multiple tasks at the same time it gives an incorrect picture.

I would suggest that eg. 'res_mem_peak_mb' is renamed 'host_res_mem_peak_mb' to start with before a proper solution to collect task ressources is in place.

ghostvfx-jimmy avatar Jul 30 '21 06:07 ghostvfx-jimmy

Hi! May be it is not enough correct, but was designed suggesting that resources are important on a "heavy" tasks, and such "heavy" tasks are usually running single on the host, just one task at the same host at the same time. And if somebody needs resources per task, parser::processResources() function can be overloaded.

Yes, we can rename res_mem_peak_mb in host_res_mem_peak_mb. Also res_cpu_agv can be renamed in host_res_cpu_agv. May be someone will use both and res_mem_peak_mb and host_res_mem_peak_mb.

timurhai avatar Aug 02 '21 06:08 timurhai

It makes total sense and it has it uses. But IMO it would be best to have both host and task ressources.

We're running several tasks per host quite alot. Mostly for nuke and houdini. When running multiple tasks it's essential to now how much the use per task to not overload the ressources on the host.

lithorus avatar Aug 02 '21 13:08 lithorus

I see that it's only in the python part. Will create a merge request with the changes..

lithorus avatar Aug 02 '21 13:08 lithorus

Or would it be better to collect the process stats in C? I've previously created a process stats collector, but was depending on a seperate python library (psutil).

lithorus avatar Aug 02 '21 13:08 lithorus

I think that better to do it in C. But it can be much harder than in Python. So I do not know, not a simple question.

timurhai avatar Aug 02 '21 15:08 timurhai

So rename it now, so it doesn't break too much and make ready for task resources?

lithorus avatar Aug 02 '21 15:08 lithorus

btw. psutil should work in all OS'es.

lithorus avatar Aug 02 '21 15:08 lithorus

Yes, multi-os is very good. Yes, we can rename it right now. It is a new feature, and i did not think that someone already wrote much in-house scripts depending on that names. Just AfWatch tasks window can recognize that names just to display some more human readable labels - i can fix it quickly.

May be better put import psutil in some try block, to make afrender works w/o this module as before.

timurhai avatar Aug 02 '21 15:08 timurhai