The Metasys Application Programming Interface (API) enables reading, writing, and commanding of one or more Metasys objects and properties to provide a secure way to bi-directionally integrate with third-party applications. Data is securely extracted from the Metasys system and integrated with third-party data visualization tools to meet robust data analysis and reporting needs.
To ensure the best performance, follow the steps in this section to manually set the rate limit under Internet Information Services (IIS) component of the Metasys Server. Of course, setting a rate limit that is optimized for each system is tricky and may require more than one adjustment. To decide on the best number, you need to consider the types of API calls, frequency of these calls, computer hardware performance, and current system load. For example, because of the amount of data retrieved, calls for historical data are much more taxing on the server than reading attribute values. The best course of action is to follow these instructions and adjust the number of API requests to a value that the system tolerates.
As a prerequisite, follow these steps to enable Rate Limiting on the Metasys Server:
- In Control Panel, click Programs > Programs and Features.
- In the left pane, click Turn Windows features on or off.
- Click Add roles and features, then click Next twice.
- Expand Web Server (IIS) > Web Server > Security. Locate a component called IP and Domain Restrictions.
- Select IP and Domain Restrictions and complete the Roles and Features Wizard.
Follow these steps to set the Rate Limit in IIS:
- In Control Panel, click System and Security > Administrative Tools.
- Under Administrative Tools, double-click Internet Information Services (IIS) Manager.
- In the left pane, expand the folders to locate Metasys Rate Limit under Sites.
- Select Metasys Rate Limit, and double-click the IP Address and Domain Restrictions module in the middle pane.
- Click on Edit Dynamic Restriction Settings.
- Verify the following settings:
Figure 1. Dynamic IP Restriction Settings
- Deny IP Address based on the number of concurrent requests: not checked
- Deny IP Address based on the number of requests over a period of time: checked
- Maximum numbers of requests = 20
- Time Period (in milliseconds) = 1000
- Enable Logging Only Mode: not checked
- Click OK to save the settings.
- Restart the computer to ensure the changes are applied.
The values recommended here apply to a high-end system. Lower the maximum number of concurrent requests for a small server to 1 or 2 requests per 1000 ms. If the values you specify are not optimized, the following behaviors can occur:
- If the Rate Limit is set to high, the system can slow down or stop responding before the Rate Limit is reached. Select the Deny IP Address based on the number of concurrent requests option and specify 1 or 2 for the maximum number of concurrent requests.
- If the Rate Limit it set to low, an HTTP 429 error or other similar HTTP error can occur. In that case, increase the number of requests incrementally until system performance is satisfactory.