SlightlyLoony
Tera Contributor

find_real_file.pngMID servers are lightweight Java processes that run on servers in your enterprise. We call them "lightweight" because they require relatively little resources on whatever server you're running them on — but "relatively little" is not the same as "zero". So how can you predict and manage the resources that a MID server requires?

An idling MID server (that is, one that is not currently working on a discovery) consumes a few megabytes of virtual memory, a few file handles, and negligible processor time. A MID server that's working on a discovery will consume up to a few megabytes of memory and a few file handles for the time the probe takes to execute. For a few probes, there will also be a brief burst of processor consumption (typically sub-millisecond, but longer for a couple of Windows WMI probes). So the total working resource consumption is roughly proportional to the number of probes that the MID server runs at the same time.

Actually, if you were to dig down further into the nitty-gritty of the MID server's innards, you'd find that there's a difference between the probes — some probes take more resources than others. It turns out that if you take into account the number of threads each probe uses, you're getting very close to a proportional measure of resource consumption. For example, the Resolver probe requires just one thread and uses few resources, while the Unix - Classify probe requires three threads and uses about three times the resources.

To give you a way to manage the MID server's resource consumption, we've provided a configurable parameter (in each MID server's config.xml configuration file) to let you set the maximum number of threads that probes are allowed to consume. The screenshot above right shows a typical config.xml file, with the threads.max parameter highlighted.

The default value for threads.max is 25, and for most organizations this is just fine. It's a middle-of-the-road value that "throttles" the MID server to use a small amount of resources, but still gets the job done quickly enough (the more threads a MID server has, the faster it can process all the probes in a discovery). If you're very concerned about resource consumption on the box that your MID server is installed on, you can set this value as low as 5 — resource consumption will be much lower, and your discoveries will take longer. On the other hand, if you've got plenty of resources on the box and you'd like your discoveries to go faster, you can set this value higher. We've tried it as high as 500 (on a Unix box), and got exactly the expected results: higher resource consumption, and much higher speed.

One particular point to consider on a Windows host for the MID server: file handles are a much more limited resource on Windows than on Unix. It's quite likely that you'll run out of file handles (as you set threads.max higher) long before you run out of either virtual memory or CPU resources. Watch your log for these errors, and if you see them, think about what's running on your host and tweak resource consumption (including the MID server) where you must to keep total file handle consumption within the limits of your operating system...

1 Comment