When the limit of 100 requests per second is reached, the API endpoint will return the following error:
{ "error_code": 102, "error_message": "Client '######' exceeded request rate of 100 per second", "module_name": "common-services" },
"msg": "Status code was 429 and not [200]: HTTP Error 429: "
Note: ###### represents the username of the client who made the NSX API request.
This is a condition that may occur in a VMware NSX environment.
Since this issue is related to the API rate limit, please try one of the following options:
Option 1:
Reduce the number of API requests to stay under the 100 requests per second limit.
Option 2:
Retry the API request after some time. It should eventually succeed if the requests are kept below 100 per second.
Option 3:
Distribute the API requests by load balancing them, rather than targeting a single manager.
Using this method, you will incorporate a load balancer in the front of NSX Managers, where the 3 NSX Managers will be the pool members, represented by a load balanced IP address (not the NSX Manager's VIP!).
Any solutions consuming NSX via APIs will be pointed to NSX through the load balanced IP address, instead of the NSX Manager's VIP (which is not load balanced).
In order to determine what services are sending the API request you can follow the steps below:
zgrep -Fh '/api/' /var/log/proxy/envoy_access_log.txt* 2> /dev/null | awk '{print $2}' | sort | uniq -c | sort -rn | head
zgrep -Fh '/api/' /var/log/proxy/envoy_access_log.txt* 2> /dev/null | awk '{print $1}' | cut -d '.' -f -1 | sort | uniq -c | sort -rn | headzgrep "2025-02-03T04:37:22" /var/log/proxy/envoy_access_log.txt* | awk '{print $2}' | sort | uniq -c | sort -rnzgrep -Fh '2025-02-03T04:37:22' /var/log/proxy/envoy_access_log.txt* 2> /dev/null | awk '{print $4,$5,$6}' | sort | uniq -c | sort -rn | head