After some hours of idle the "Error 429 Too Many Requests" is reported from SysAP to HTTP requests

For my environment I developed in JAVA a connection plugin for the SysAP "Version 2.6.1" with the local API In my tests I get the Error 429 Too Many Request after some hours of idle to the new HTTP request. Practially on Parallel to the HTTP REST API communication a websocket is opened to get the status updates for the connected devices. I am using a jetty HttpClient and for the communication I set the SetMacConnectionPerDestination to 1. The Websocket connection is still alive even if the HttpClient reporting the above error. Is there any time limitation of the HTTP requests? Is any time limitation of the opened Websocket connection with parallel Http REST API commands?


    The local API has a limit of 20 simultaneous connections per IP address. If the limit is reached, all new connection attempts are rejected with “429 Too Many Requests”. Since the limit is checked when the connection is established, existing connections are not affected. That is why the websocket continues to run. There is no time limit on the connection limit. There is only a time limit for the number of failed login attempts, but this is displayed with the error code 403. The whole thing can be imagined as a bucket with 20 coins in it. Whenever a connection is established, a coin is removed. When the connection is buried, the coin is put back. If there is no coin when a connection is established, the connection will be rejected. Now of course the big question is how come too many connections are open. Three possible causes: 1. Some calls may take a little longer on the SysAp, depending on the number of connected devices. This includes in particular / fhapi / v1 / api / rest / configuration in which the complete data model is run through. If these calls are called too quickly one after the other, it can be that they accumulate over time. 2. As of HTTP 1.1, connections can be reused for further requests. The connection is kept open for this purpose (keep-alive). If this connection is not used but a new one is opened, the connections can build up again. The open unused connections are cleaned up by the web server after a timeout. The perceived "timeout" may come from this. You tried to limit the number of simultaneous connections in your client with SetMacConnectionPerDestination (1). Then there should be no problems with 429. Now the only question is how can this be reproduced and / or better monitored. It would be interesting to know whether the problem persists when your application is restarted. The background to this is that when the application is closed, all possibly existing connections are terminated by the operating system. If the problem is then resolved, the problem is probably with the application.
    Posted by Hidden Wed, 28 Apr 2021 05:26:00 GMT

You're not signed in. Please sign-in to report an issue or post a comment.