Rate limiting: JSON-RPC info, log message

This commit is contained in:
mDuo13
2020-02-25 09:51:40 -08:00
parent f05e24e356
commit 0a763faad7
2 changed files with 19 additions and 3 deletions

View File

@@ -29,10 +29,12 @@ If the connection is closed because of rate limiting, the close code is `1008` a
## JSON-RPC Rate Limited Error
For a JSON-RPC API request, the server rejects a request with a ***TODO*** error when the client is over the rate limit. For example:
For a JSON-RPC API request, the server responds with the HTTP status code **503 Service Unavailable** when the client is over the rate limit. This response has a text (not JSON) body stating that the server is overloaded:
```json
TODO
```text
503 Service Unavailable
Server is overloaded
```
## Rate Per Request

View File

@@ -58,6 +58,20 @@ A large number of these messages around the same time may indicate a problem, su
- Your server may have been overloading the peer with requests, causing it to drop your server.
## Consumer entry dropped with balance at or above drop threshold
The following log message indicates that a client to the server's public API has been dropped as a result of [rate limiting](rate-limiting.html):
```text
2020-Feb-24 23:05:35.566312806 Resource:WRN Consumer entry 169.55.164.21 dropped with balance 15970 at or above drop threshold 15000
```
The entry contains the IP address of the client that exceeded its rate limit, and the client's "balance", which is a score estimating the rate at which the client has been using the API. The threshold for dropping a client [hardcoded to a score of 15000](https://github.com/ripple/rippled/blob/06c371544acc3b488b9d9c057cee4e51f6bef7a2/src/ripple/resource/impl/Tuning.h#L34-L35).
If you see frequent messages from the same IP address, you may want to block those IP addresses from your network to reduce the load on your server's public API. (For example, you may be able configure your firewall to block those IP addresses.)
To avoid being dropped by rate limiting on your own server, [connect as an admin](get-started-with-the-rippled-api.html#admin-access).
## InboundLedger 11 timeouts for ledger
```text