Accelerating KBY-AI SDKs with Kubernetes Configuration
KBY-AI’s server SDKs can run on a Kubernetes configuration to enable acceleration and handle multiple requests efficiently
Last updated
KBY-AI’s server SDKs can run on a Kubernetes configuration to enable acceleration and handle multiple requests efficiently
Last updated
If you are using a Kubernetes
configuration, you can send multiple requests in parallel and receive responses simultaneously. This approach significantly reduces API
response time and optimizes performance efficiently.
To validate the performance, we tested the KBY-AI ID Document Liveness SDK by measuring the response time when sending multiple requests in parallel.
EKS
stands for Elastic Container Service
for Kubernetes
. It's a managed container service offered by Amazon Web Services (AWS)
that allows users to run Kubernetes
without having to manage the underlying infrastructure.
It simplifies deploying, managing, and scaling containerized applications using Kubernetes on AWS infrastructure.
AWS
provides official documentation for creating an EKS
cluster. You can follow their step-by-step guide to create EKS
cluster on AWS
console.
Once you have created the EKS
cluster, you need to add a node group to it.
We added a node
group with 100
nodes to the cluster to measure the response time of the KBY-AI ID Document Liveness Detection SDK under multi-threading conditions. Each node
was configured with 2
CPU
cores and 8GB
of RAM
.
We allocated CPU
, RAM
, and pods
to each node
as shown in the diagram below.
We provided a Python
script to measure API
response time when sending 1,000
requests simultaneously using a Base64
image.
To run the script, you need to prepare the Base64
image data (base64.txt
file).
We ran the Python
script against the API
from both the EKS
cluster and an EC2
instance to compare the response time between sending requests simultaneously and sending them serially from the EC2
instance.
It took 1,381.77
seconds to receive all 1,000
responses through the API
from the EC2
instance when sending requests sequentially.
In contrast, it took 57.25
seconds to receive all 1,000
responses through the API
from the EKS
Kubernetes
cluster when sending all requests simultaneously.
As you can see, deploying the KBY-AI ID Document Liveness Detection SDK to an EKS
cluster with a node group significantly reduced API
response time.
To learn more about accelerating our SDK
s, please contact us.