From d40eedbf01c207345d8be72eb4e37ec7329bff37 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 17 Dec 2020 10:00:34 +0100 Subject: [PATCH] Merge #19050: doc: Add warning for rest interface limitation 5c3eaf9983043db1b61a98c95d692a6958670b86 doc: Add warnings for http interfaces limitations (Fabian Jahr) Pull request description: `libevent`, which is used for our rest interface, can use up all of the available file descriptors in a system if too many connections are opened at once. If a new block is connected at the same time and can not be written to disk because there are no file descriptors available, the node crashes. Based on my investigation so far the issue is best solved upstream which means we have to wait for the next release (2.2). In the meantime it would be good if we would warn users of this limitation. See #11368 for more background. ACKs for top commit: MarcoFalke: ACK 5c3eaf9983043db1b61a98c95d692a6958670b86 Tree-SHA512: 73914538588477ead19068f5832fdcc8e0eb736e51f73b3aca501c93165e5ad634c2511a3fcffff251adcd3efda23a742b48211ad9d3b2a29cdeac17201d06a1 --- doc/JSON-RPC-interface.md | 11 +++++++++++ doc/REST-interface.md | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/doc/JSON-RPC-interface.md b/doc/JSON-RPC-interface.md index 42d784a400..491bde26f9 100644 --- a/doc/JSON-RPC-interface.md +++ b/doc/JSON-RPC-interface.md @@ -34,3 +34,14 @@ wallet would reflect the removal of these mempool transactions in the state. However, the wallet may not be up-to-date with the current state of the mempool or the state of the mempool by an RPC that returned before this RPC. + +## Limitations + +There is a known issue in the JSON-RPC interface that can cause a node to crash if +too many http connections are being opened at the same time because the system runs +out of available file descriptors. To prevent this from happening you might +want to increase the number of maximum allowed file descriptors in your system +and try to prevent opening too many connections to your JSON-RPC interface at the +same time if this is under your control. It is hard to give general advice +since this depends on your system but if you make several hundred requests at +once you are definitely at risk of encountering this issue. diff --git a/doc/REST-interface.md b/doc/REST-interface.md index 1611bea7df..985fb4690c 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -11,6 +11,18 @@ REST Interface consistency guarantees The [same guarantees as for the RPC Interface](/doc/JSON-RPC-interface.md#rpc-consistency-guarantees) apply. +Limitations +----------- + +There is a known issue in the REST interface that can cause a node to crash if +too many http connections are being opened at the same time because the system runs +out of available file descriptors. To prevent this from happening you might +want to increase the number of maximum allowed file descriptors in your system +and try to prevent opening too many connections to your rest interface at the +same time if this is under your control. It is hard to give general advice +since this depends on your system but if you make several hundred requests at +once you are definitely at risk of encountering this issue. + Supported API -------------