IP Library › Granted Patent US 11,782,775
Granted Patent B2
US 11,782,775 · App. 17/671,995 · Granted Oct 10, 2023

Dynamic management of network policies between microservices within a service mesh

Inventors: Sudheesh S. Kairali (Kozhikode, IN); Sarbajit K. Rakshit (Kolkata, IN)
Assignee: International Business Machines Corporation
G06F9/547H04L67/51
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,782,775
App. No.
17/671,995
Granted
Oct 10, 2023
Kind
B2
Abstract

Systems, methods and/or computer program products optimizing network policies between microservices of a service mesh. The service mesh tracks incoming API calls of applications and based on the historical transactions, the context of API calls, and the microservices in the microservice chain being invoked, network controls and policy configurations are set to optimize the transactions performed by the service mesh. Dimensions of the communications between microservices of the service mesh are dynamically optimized via the service mesh control plane using a policy optimizer. Optimized dimensions of service mesh transactions includes automated policy adjustments to retries between microservices, circuit breaking between microservices, automated timeout adjustments between microservices and intelligent rate limiting between microservices and/or rate limiting applied to user profiles.

Claims (80)

1. A computer-implemented method for optimizing network policies between microservices of a service mesh, the computer-implemented method comprising:

collecting, by the service mesh, a history of Application Programming Interface (API) calls sent to the service mesh, including within the history of the API calls, transaction timeouts between microservices of each microservice chain invoked by the API calls;

tracking, by the service mesh, timeout configurations associated with the transaction timeouts between the microservices of the service mesh for each user profile transmitting one or more of the API calls;

receiving, by the service mesh, an incoming API call requesting the microservices of the service mesh, wherein the incoming API call is routed through a microservice chain comprising a first microservice to a second microservice;

analyzing, by the service mesh, a timeout configuration of a network policy, the timeout configuration comprising a timeout value between the first microservice and the second microservice;

determining by the service mesh, whether the history of API calls indicates a timeout rate between the first microservice and the second microservice using the timeout value as configured in the timeout configuration is less than a threshold timeout rate;

upon the service mesh determining the timeout rate between the first micro service and the second microservice is less than the threshold timeout rate, automatically decreasing, by the service mesh, the timeout value to a decreased timeout value by updating the network policy with the decreased timeout value; and

pushing, by the service mesh, the network policy to a proxy of the first microservice.

2. The computer-implemented method of claim 1 , further comprising:

determining by the service mesh, whether the timeout rate between the first microservice and the second microservice using the timeout value as configured in the timeout configuration is above a maximum threshold timeout rate; and

in response to determining the timeout rate is above the maximum threshold timeout rate, automatically increasing, by the service mesh, the timeout value to an increased timeout value by updating the network policy with the increased timeout value.

3. The computer-implemented method of claim 1 , further comprising:

evaluating, by the service mesh the transaction timeouts between microservices of each microservice chain invoked by the API calls of the API call history;

determining, by the service mesh, whether a threshold percentage of transaction timeouts of the first microservice or the second microservice, recorded by the API call history, occurred while the first microservice or the second microservice utilized resources of the service mesh above a threshold level of resource utilization; and

in response to the threshold percentage of the transaction timeouts recorded by the API call history occurring while one or more microservices utilized resources of the service mesh above the threshold level of resource utilization, autoscaling, by the service mesh, the first microservice or the second microservice by replicating the first microservice or the second microservice.

4. The computer-implemented method of claim 1 , further comprising:

calculating, by the service mesh, based on the history of API calls, API calls to the second microservice that are the same or similar to the incoming API call that timed out initially but succeeded after at a specified number of retry attempts; and

automatically setting a retry count in the network policy to the specified number of retry attempts for the incoming API call routed to the first microservice and the second microservice.

5. The computer-implemented method of claim 1 further comprising:

collecting, by the service mesh, as part of the history of API calls sent to the service mesh, the API calls being rate limited by the service mesh;

tracking, by the service mesh, for each user profile, which of the microservices are being rate limited during the API calls by the service mesh;

checking, by the service mesh, whether one or more of the microservices requested by the incoming API call are globally rate limited for all users; and

upon identifying one or more of the microservices requested by the incoming API call are globally rate limited for all users, pre-emptively applying, by the service mesh, rate limits to all microservices within the microservice chain for a user profile transmitting the incoming API call.

6. The computer-implemented method of claim 5 , further comprising:

checking, by the service mesh, whether all API calls for the first microservice or the second microservice are rate limited; and

rate limiting, by the service mesh, all microservices of microservice chains invoked by the incoming API calls wherein the first microservice or the second microservice are rate limited and a target of the incoming API calls.

7. The computer-implemented method of claim 5 , wherein the incoming API call being routed through the microservice chain comprises at least one microservice limiting a number of API calls per second for the user profile submitting the incoming API call; and

applying, by the service mesh, a rate limit of the number of API calls per second for the user profile to all microservices of the microservice chain that follow the at least one microservice limiting the number of API calls per second.

8. A computer-implemented method for optimizing network policies between microservices of a service mesh comprising:

collecting, by the service mesh, a history of Application Programming Interface (API) calls sent to the service mesh, including within the history of the API calls, the API calls being rate limited by the service mesh;

tracking, by the service mesh, which microservices of microservice chains invoked by the API calls, for each user profile, are being rate limited;

receiving, by the service mesh, an incoming API call requesting the microservices of the service mesh, wherein the incoming API call is routed through a microservice chain comprising a first microservice to a second microservice;

checking, by the service mesh, whether one or more of the microservices requested by the incoming API call are globally rate limited for all users; and

upon identifying one or more of the microservices requested by the incoming API call are globally rate limited for all users, pre-emptively applying, by the service mesh, rate limits to all microservices within the microservice chain for a user profile transmitting the incoming API call.

9. The computer-implemented method of claim 8 , further comprising:

checking, by the service mesh, whether all API calls for the first microservice or the second microservice are rate limited; and

rate limiting, by the service mesh, all microservices of microservice chains invoked by the incoming API calls if the first microservice or the second microservice are rate limited and a target of the incoming API calls.

10. The computer-implemented method of claim 8 , wherein the incoming API call being routed through the microservice chain comprises at least one microservice limiting a number of API calls per second for the user profile submitting the incoming API call; and

applying, by the service mesh, a rate limit of the number of API calls per second for the user profile to all microservices of the microservice chain that follow the at least one microservice limiting the number of API calls per second.

11. The computer-implemented method of claim 8 further comprising:

analyzing, by the service mesh, the user profile associated with the incoming API call and determine whether the user profile is rate limited on at least two microservice chains or at least two API calls by the service mesh; and

in response to the user profile being associated being determined to be rate limited on at least two of the microservice chains or at least two API calls by the service mesh, applying, by the service mesh, a user level rate limit at an ingress of an API gateway to the service mesh.

12. The computer-implemented method of claim 8 , analyzing, by the service mesh, the user profile associated with the incoming API call and determine whether the user profile is rate limited on at least two microservice chains or at least two API calls by the service mesh; and

in response to the user profile being associated being determined to be rate limited on at least two of the microservice chains or at least two API calls by the service mesh, selectively migrating, by the service mesh, the incoming API call and user profile to a subsection of the service mesh.

13. The computer-implemented method of claim 12 , further comprising:

collecting, by the service mesh, as part of the history of API calls sent to the service mesh, transaction timeouts between the microservices of each microservice chain invoked by the API calls;

tracking, by the service mesh, timeout configurations associated with the transaction timeouts between the microservices of the service mesh for each user profile transmitting one or more of the API calls;

analyzing, by the service mesh, a timeout configuration of a network policy, the timeout configuration comprising a timeout value between the first microservice and the second microservice;

determining by the service mesh, whether the history of API calls indicates a timeout rate between the first microservice and the second microservice using the timeout value as configured in the timeout configuration is less than a threshold timeout rate; and

upon the service mesh determining the timeout rate between the first micro service and the second microservice is less than the threshold timeout rate, automatically decreasing, by the service mesh, the timeout value to a decreased timeout value by updating the network policy with the decreased timeout value.

14. The computer-implemented method of claim 12 , further comprising:

determining by the service mesh, whether a timeout rate between the first microservice and the second microservice using a timeout value as configured in a timeout configuration is above a maximum threshold timeout rate; and

in response to determining the timeout rate is above the maximum threshold timeout rate, automatically increasing, by the service mesh, the timeout value to an increased timeout value by updating a network policy with the increased timeout value.

15. A computer program product for optimizing network policies between microservices of a service mesh comprising:

one or more computer readable storage media having computer-readable program instructions stored on the one or more computer readable storage media, said program instructions executes a computer-implemented method comprising:

collecting, by the service mesh, a history of Application Programming Interface (API) calls sent to the service mesh, including within the history of the API calls, transaction timeouts between microservices of each microservice chain invoked by the API calls;

tracking, by the service mesh, timeout configurations associated with the transaction timeouts between the microservices of the service mesh for each user profile transmitting one or more of the API calls;

receiving, by the service mesh, an incoming API call requesting the microservices of the service mesh, wherein the incoming API call is routed through a microservice chain comprising a first microservice to a second microservice;

analyzing, by the service mesh, a timeout configuration of a network policy, the timeout configuration comprising a timeout value between the first microservice and the second microservice;

determining by the service mesh, whether the history of API calls indicates a timeout rate between the first microservice and the second microservice using the timeout value as configured in the timeout configuration is less than a threshold timeout rate;

upon the service mesh determining the timeout rate between the first micro service and the second microservice is less than the threshold timeout rate, automatically decreasing, by the service mesh, the timeout value to a decreased timeout value by updating the network policy with the decreased timeout value; and

pushing, by the service mesh, the network policy to a proxy of the first microservice.

16. The computer program product of claim 15 , further comprising:

determining by the service mesh, whether the timeout rate between the first microservice and the second microservice using the timeout value as configured in the timeout configuration is above a maximum threshold timeout rate; and

in response to determining the timeout rate is above the maximum threshold timeout rate, automatically increasing, by the service mesh, the timeout value to an increased timeout value by updating the network policy with the increased timeout value.

17. The computer program product of claim 15 , further comprising:

evaluating, by the service mesh the transaction timeouts between microservices of each microservice chain invoked by the API calls of the API call history;

determining, by the service mesh, whether a threshold percentage of transaction timeouts of the first microservice or the second microservice, recorded by the API call history, occurred while the first microservice or the second microservice utilized resources of the service mesh above a threshold level of resource utilization; and

in response to the threshold percentage of the transaction timeouts recorded by the API call history occurring while one or more microservices utilized resources of the service mesh above the threshold level of resource utilization, autoscaling, by the service mesh, the first microservice or the second microservice by replicating the first microservice or the second microservice.

18. The computer program product of claim 15 , further comprising:

calculating, by the service mesh, based on the history of API calls, API calls to the second microservice that are the same or similar to the incoming API call that timed out initially but succeeded after at a specified number of retry attempts; and

automatically setting a retry count in the network policy to the specified number of retry attempts for the incoming API call routed to the first microservice and the second microservice.

19. The computer program product of claim 15 , further comprising:

collecting, by the service mesh, as part of the history of API calls sent to the service mesh, the API calls being rate limited by the service mesh;

tracking, by the service mesh, for each user profile, which of the microservices are being rate limited during the API calls being rate limited by the service mesh;

checking, by the service mesh, whether one or more of the microservices requested by the incoming API call are globally rate limited for all users; and

upon identifying one or more the microservices requested by the incoming API call are globally rate limited for all users, pre-emptively applying, by the service mesh, rate limits to all microservices within the microservice chain for a user profile transmitting the incoming API call.

20. The computer program product of claim 19 , further comprising:

checking, by the service mesh, whether all API calls for the first microservice or the second microservice are rate limited; and

rate limiting, by the service mesh, all microservices of microservice chains invoked by the incoming API calls wherein the first microservice or the second microservice are rate limited and a target of the incoming API calls.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 15, 2022
From: KAIRALI, SUDHEESH S.; RAKSHIT, SARBAJIT K.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 059014/0748 →
Continuity (1)
Related Publication 20230259415A1 · Aug 17, 2023