MID Server Resource Reservation
This feature allows resources to be reserved before a task is assigned to a thread. If the resources the task needs aren’t available, then that task waits in the MID Server work queue while other tasks are assigned to the thread.
![]() |
For Discovery, the MID Server tasks are the probes or patterns it executes. While probes are waiting to be executed on the MID Server, they provide resource requirements (CPU, memory, and so on) and if they cannot be met, the probe waits in the work queue until the resources are available.
Using the MID Server Resource Reservation allows for better use of threads since the threads are not assigned a task it cannot complete.
- Resource reservations apply to a single MID Server only
- Resources can depend on system or MID Server properties
- Resources can depend on probe parameters, allowing you to limit the number of active probes and patterns against a given IP
- Reports resource usage
- Extensible (the customer defines their own resources)
- Scriptable
- Keeps PowerShell probes from impacting execution of other probes
- Can be used to limit the impact Discovery has on a target system
- Can be used to limit the number of ”large” probes being executed by a MID Server at the same time
- Can be used to throttle Discovery (to minimize impact on the instance)
Use MID Server Resource Reservation
A resource is just a name and a count. Define the name of the resource, which probes use it, and how many of the resources those probes should use.
始める前に
- Make sure the MID Server property mid.probe.wait.resources is set to true to enable MID Server Resource Reservation. Changing this property requires restarting the MID Server.
- Choose a resource name. Anything in { } in the name is replaced by the probe parameter with that name. This name is typically used for per-host resources, for example, ssh{source} means a separate resource named “ssh” is available on every host being discovered. (“source” is the name of the probe parameter that contains the IP address being probed.)
- Decide how to specify the number of the resource used by probes or
patterns.
- Every probe uses a constant number of the resource: Create a “simple value” resource.
- The number of resources used depends on a system property: Create an “expanding” resource.
- The number depends on multiple factors: Create a “scripted” resource.
- Expanding: Anything in { } is replaced by the system or MID Server property with that name. Logical operators are allowed, for example, "{mid.windows.management_protocol}".toLowerCase() == "winrm" ? 1:0
- Scripted: the script is evaluated. The return value is expanded.
手順
How MID Server Resource Reservation works
In addition to the work queue, the MID Server contains a waiting queue. When picking a task for execution, the waiting queue is always checked first. If no task in the waiting queue can execute, then the work queue is tried. Probes and patterns in the waiting queue reserve all necessary resources until they’re able to execute.
The first probe or pattern in the queue is offered available resources. It takes any of the lowest order resource that is available. After getting the required number of lowest order resources, the probe or pattern goes to the next lowest order resources, and so on. The order allows the user to configure which resources are more or less important. Lowest order resources are gathered first because holding these resources has less impact on execution of other probes and patterns.
Tables
- Defines the resources used by a probe or pattern.
- Extended by mid_limited_resource_value, mid_limited_resource_expanded, and
mid_limited_resource_script each containing a single additional field.
- mid_limited_resource_value adds a single field named “value” to the base table.
- mid_limited_resource_expanding adds a field named “expanding.”
- mid_limited_resource_script adds a field named “script”.
- Sets the resources available on a MID Server.
- Values from this table are copied to ecc_agent_property.
- A business rule on this table creates the corresponding MID Server properties.
- It has a reference to a resource and the number available. If the number available is inside { } then it’s the name of a system property, MID Server config, or MID Server property (all three places are checked). So {mid.powershell_api.session_pool.max_size} is the value of that MID Server config that sets the size of the PowerShell session pool.
| Label | Column | Type | Size | Information |
|---|---|---|---|---|
| Resource Name | name | String | 100 | Unexpanded name of the resource |
| Active | active | Boolean | Allows temporary disable | |
| Invert Topic | invert_topic | Boolean | ||
| Invert Probe List | invert_probe_list | Boolean | ||
| Invert Pattern List | invert_pattern_list | Boolean |
| Label | Column | Type | Size | Information |
|---|---|---|---|---|
| Value | value | Integer | ||
| Expanding | expanding | String | 1000 | A slightly extended version of the availability number because it accepts logical and ternary operations, for example, "{mid.windows.management_protocol}" == "WinRM" ? 1 : 0. If the management protocol is WinRM this evaluates to 1, otherwise it’s 0. |
| Script | script | String | 4000 | The script is evaluated. If the result is a string, then it’s expanded |
| Label | Column | Type | Size | Information |
|---|---|---|---|---|
| Active | active | Boolean | Allows temporary disable | |
| Available | available | String | 255 | Number of this resource available on MID Server |
| MID Server | ecc_egent | Reference | Reference to MID Server or empty for all | |
| Order | order | Integer | Order in which resources are allocated | |
| Resource | resource | Reference | Reference to the resource |
