Add new server to HAProxy using dataplane api with Rate limiting in Golang - go

I am adding new backend server to Haproxy through my golang code. I can see there is a parameter called max connections while adding new server which can be used to limit no of connections. There is also a parameter called maxqueue which will queue the connections if max connection limit is reached. But I cant find-out the option to specify the queue timeout. And I could not find from documentation what is default queue timeout time.
Furthermore, How can I add rate limiting based on no of requests (sliding window) while adding new server to backend?
I can see there is an option of mentioning stick table however I could not find example of its implementation.
I am referring to below documentation.
https://www.haproxy.com/documentation/dataplaneapi/community/#post-/services/haproxy/configuration/servers

A server have no "queue timeout". You can set the "queue timeout" via the backend configs
https://www.haproxy.com/documentation/dataplaneapi/community/#post-/services/haproxy/configuration/backends
https://www.haproxy.com/documentation/dataplaneapi/community/#put-/services/haproxy/configuration/backends/-name-
The defaults can be received via the defaults call.
https://www.haproxy.com/documentation/dataplaneapi/community/#get-/services/haproxy/configuration/defaults

Related

How to limit number of HTTP Connections for a rest web service

We want to limit the number of connections for our rest web service.
We are using spring boot with jetty as server.
We have configured below settings :
#rate limit connections
server.jetty.acceptors=1
server.jetty.selectors=1
#connection time out in milliseconds
server.connection-timeout=-1
Now, as you can see that there is no idle timeout applicable for connections.
Which means a connection once open will remain active until it is explicitly closed.
So, with this settings, my understanding is that if I open more then 1 connection, then I should not get any response because the connection limit is only 1.
But this does not seem to be working. Response is sent to each request.
I am sending request with 3 different clients. I have verified the ip address and ports. They all are different for 3 clients. But all 3 remains active once connection is established.
Any experts to guide on the same?
Setting the acceptors and selectors to 1 will not limit the max number of connections.
I suggest you look at using either the jetty QoS filter, or the Connection Limit jetty module.

Spring Webflux Webclient set Connection keepAlive time

Just starting to use Spring Webflux Webclient,Just wanted to know what is the default KeepAlive time for the Http Connection ? Is there a way to increase the keepAlive Time? In our Rest Service we get a request probably every five minutes,The request takes long time to process .It takes time between 500 seconds-- 10 second. However in load test if I send frequent requests the processing time is less than 250ms.
Spring WebFlux WebClient is an HTTP client API that wraps actual HTTP libraries - so configuration like connection management, timeouts, etc. are configured at the library level directly and behavior might change depending on the chosen library.
The default library with WebClient is Reactor Netty.
Many HTTP clients (and this is the case with Reactor Netty) are maintaining HTTP connections in a connection pool to reuse them. Clients usually acquire a new connection to a remote host, use it to send/receive information and then put it back in the connection pool. This is very useful since sometimes acquiring a new connection can be costly. This seems to be really costly in your case.
HTTP clients leave those unused connections in the pool, but what about keepAlive time?
Most clients leave those connections in the pool as long as possible and test them before acquiring them to see if they're still valid or listen to server events asynchronously to remove them from the pool (I believe Reactor Netty does that). So ultimately, the server is in control and decides when to close connections if they're inactive.
Now your problem description might suggest that connecting to that remote host is very costly, but it could be also the remote host taking a long time to respond to your requests (for example, it might be operating on an empty cache and needs to calculate a lot of things).

How many connections are created and reused by Golang

Anybody knows how can I test the numbers of connections that transport is currently creating on the pool of the connections, it is clear that in the code I have put MaxIdleConnsPerHost: 5 like number maximum of connections on the pool and DisableKeepAlives: false like the option which let to reuse the connection
but I do not sure about how Go is managed this topic and the documentation is not clear Source-code-transport.go , Documentation-net/http
Server is a example of a server that receive a XML and send the same XML like response with an attribute more.
Client is the code that has the configuration of the pool and send 100 request to server.

Restricting EMS cliemt connections

Hi Our EMS server is used by other clients for putting message. But some time they dont close connections and number of connections is reaching maximum limit of the server. Is there any way where we can restrict the number of connections for the client based on emsusername provided to the client or based on the host name from where client is creating connection. Is there any configuration we can do for client specific connections restriction.
No, there is no such provision in EMS server or client libraries where you can restrict the number of consumer/producer clients based on their user names or other properties. You can have a look at the JAAS and JACI provision supported by EMS which can be used to write your own JAVA authentication custom modules which run in JVM within EMS server. You can find more information about JAAS and JACI on Oracles documentation site.
Have you looked into the server_timeout_client_connection setting ?
From the doc :
server_timeout_client_connection = limit
In a server-to-client connection, if the server does not receive a heartbeat for a
period exceeding this limit (in seconds), it closes the connection.
We recommend setting this value to approximately 3 times the heartbeat interval, as it is specified in client_heartbeat_server.
Zero is a special value, which disables heartbeat detection in the server (although
clients still send heartbeats).

WebSphere http outbound socket configuration

We are running a performance test on a WebSphere 8.5.5.1 application server that calls many external SOAP services. Running netstat we notice that the server is only creating a max of 50 outbound connections.
We are trying to increase this value but cannot find the correct property. We have increased the Default pool but this doesn't seem to apply.
The WebContainer pool size is also set to higher than 50 and we can see this pool grow. Is there some hidden pool that is defaulting to 50?
You'll need to configure com.ibm.websphere.webservices.http.maxConnection property based on this:
http://www-01.ibm.com/support/knowledgecenter/api/content/SSEQTP_8.5.5/com.ibm.websphere.base.iseries.doc/ae/rwbs_httptransportprop.html

Resources