HTTP-RPC | Lightweight REST for Java | HTTP library
kandi X-RAY | HTTP-RPC Summary
kandi X-RAY | HTTP-RPC Summary
HTTP-RPC is an open-source framework for creating and consuming RESTful and REST-like web services in Java. It is extremely lightweight and requires only a Java runtime environment and a servlet container. The entire framework is about 100KB in size, making it an ideal choice for applications where a minimal footprint is desired. This guide introduces the HTTP-RPC framework and provides an overview of its key features.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of HTTP-RPC
HTTP-RPC Key Features
HTTP-RPC Examples and Code Snippets
Community Discussions
Trending Discussions on HTTP-RPC
QUESTION
Not sure if such if there was such a question, so pardon me if I couldn't find such.
I have a cluster based on 3 nodes, my application consists of a frontend and a backend with each running 2 replicas:
- front1 - running on
node1
- front2 - running on
node2
- be1 -
node1
- be2 -
node2
- Both
FE
pods are served behindfrontend-service
- Both
BE
pods are service behindbe-service
When I shutdown node-2
, the application stopped and in my UI I could see application errors.
I've checked the logs and found out that my application attempted to reach the service type of the backend pods and it failed to respond since be2
wasn't running, the scheduler is yet to terminate the existing one.
Only when the node was terminated and removed from the cluster, the pods were rescheduled to the 3rd node and the application was back online.
I know a service mesh can help by removing the pods that aren't responding from the traffic, however, I don't want to implement it yet, and trying to understand what is the best solution to route the traffic to the healthy pods in a fast and easy way, 5 minutes of downtime is a lot of time.
Here's my be
deployment spec:
ANSWER
Answered 2021-Mar-29 at 11:51This is a community wiki answer. Feel free to expand it.
As already mentioned by @TomerLeibovich the main issue here was due to the Probes Configuration:
Probes have a number of fields that you can use to more precisely control the behavior of liveness and readiness checks:
initialDelaySeconds
: Number of seconds after the container has started before liveness or readiness probes are initiated. Defaults to 0 seconds. Minimum value is 0.
periodSeconds
: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.
timeoutSeconds
: Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1.
successThreshold
: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup Probes. Minimum value is 1.
failureThreshold
: When a probe fails, Kubernetes will try failureThreshold times before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe the Pod will be marked Unready. Defaults to 3. Minimum value is 1.
Plus the proper Pod eviction configuration:
The
kubelet
needs to preserve node stability when available compute resources are low. This is especially important when dealing with incompressible compute resources, such as memory or disk space. If such resources are exhausted, nodes become unstable.
Changing the threshold to 1 instead of 3 and reducing the pod-eviction solved the issue as the Pod is now being evicted sooner.
EDIT:
The other possible solution in this scenario is to label other nodes with the app backend to make sure that each backend/pod was deployed on different nodes. In your current situation one pod deployed on the node was removed from the endpoint and the application became unresponsive.
Also, the workaround for triggering pod eviction from the unhealthy node is to add tolerations to
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install HTTP-RPC
You can use HTTP-RPC like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the HTTP-RPC component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page