lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
305 stars 38 forks source link

PRTG Server Memory Usage for large installation #142

Closed Halfshellher0 closed 4 years ago

Halfshellher0 commented 4 years ago

Hello,

I was wondering if you've seen any memory performance issues on the PRTG Server while doing large PRTG installations using the Powershell API?

Yesterday I attempted to run a batch installation of many devices and sensors, it appeared to be creating the PRTG objects just fine up to a certain point where it seemed like the PRTG Server application briefly crashed. Upon further investigation it seemed like it was using a ton of memory during the time when I was running my automation. Have you run into any issues like this, or have any tips for mitigating this for long running scripts?

lordmilko commented 4 years ago

Hi @Halfshellher0,

At the previous company I worked for, our PRTG installation with 13,000 sensors was very sensitive to adding objects in both the UI and via the API! Doing an auto-discovery would just lock the whole thing up for 10 minutes or so. The server wouldn't so much crash as just lock up, where the web UI refuses to load and API requests start timing out and potentially even fail to load until the PRTG server is given time to recover (which does not happen quickly)

I haven't seen the memory issues you've spoken of specifically, however we always spec our PRTG Core with way more memory than it claims it needs. e.g. my current company's core might typically use 5gb on PRTG Server.exe, but the core is specced for something like 12-16gb. After having had the server be on for a month or so I have seen it grow to use all of this memory.

I would recommend checking what the path to PRTG Server.exe is under services.msc. You'd want to make sure it's the version under the 64-bit folder; if not, uninstall it, bump the server memory up to at least 6gb and reinstall

If you have a reasonably complex script with lots of API requests, I recommend adding some manual pauses to relieve the pressure on PRTG. In this system I simplified for the PRTG Blog, I had a script that checked every clients device had all of the sensor types that would be required by that device (e.g. Exchange servers have all of the required Exchange sensors we want) and then would configure Notification Triggers on all of the critical sensors we cared about. After each client was processed, I had the script pause for 30 seconds before continuing

Halfshellher0 commented 4 years ago

Thanks for the tips, I will try these out. Cheers