My hosting provider gave me 50% cpu limitation. I’m trying to use DotNetZip to backup my DNN portal files — the collection of more than 16000 files of 600Mb disk-space. I’m using a separate thread with the lowest priority for compression. If the processor is loaded enough then my thread works fine but when the processor is more or less free I rich quickly my CPU limitation (50%) and finally the pool terminates and needs to be recycled.
So I need an idea how I can slow down the thread in order not to exceed the cpu limitation.
Thanks.
If you just want to keep the thread below 50% utilization, sprinkle Thread.Sleep(x) throughout the code. You’ll need to figure out how many of these you need, and what the millisecond delay should be — and that’s only if you wrote the code that needs the Sleep() calls…
That said, your situation sounds rather odd. There should be a better way to make your backup.