Get python running under heavy load

Hi,

I have python script, compiled with py2exe, that always run on machines to write some infos on a server.
My problem, is that when 3dsmax is rendering, it takes 100% of all cpu cores, and my python script doesn’t write its info file anymore until cpu load get lower.

I ever have my process set to HIGH_PRIORITY_CLASS and dunno what to do ! It specially happens at beginning of rendering with backburner and vray (while building sra for example) when max takes all available processor time.

Any idea ?

Run max on low priority, that’s the only thing I could get to work in the past to work while rendering.

How do you do that, set the 3dsmax.exe to below normal, or some function inside max ? Vray is ever in low priority (checkbox in params).

Just an idea, but instead of writing their infos into files on server, if I make my ‘clients’ writing into a database, would it work better ?

I don’t think so, but what comes to my mind in the first place is that you place some pre-render script that makes sure the 3dsmax.exe process is set to low priority.

I would try something like 3dsmaxProcess = Process.GetProcessesByName(“3dsmax”); and then 3dsmaxProcess.PriorityClass = ProcessPriorityClass.High;

Haven’t tried it, just throwing ideas :slight_smile:

Another thought… why don’t you use the .py version of your script as a pre-render script in Max to send over the info to your server? If you’re using Max 2014 + SAP or higher it can probably be done that way.

[QUOTE=Kameleon;24508]Another thought… why don’t you use the .py version of your script as a pre-render script in Max to send over the info to your server? If you’re using Max 2014 + SAP or higher it can probably be done that way.[/QUOTE]

It isn’t specifically max infos. Each machine send infos on his state every few seconds. When max isn’t rendering, and even so in 90% of time, everything is right. But sometimes when render start (compiling the scene), the client doesn’t write his report (he write it again after max start rendering in vfb).

Got it, then I say your best chances are to toggle all max+vray stuff to lowpriority.

I have set this in a startup script :

sysInfo.MAXPriority = #low

will see if it solve the problem. At least it works and set max process low priority for both interactive and netrender

If you want i only for backburner :
if (isnetserver()) do sysinfo.maxpriority = #low