SlideShare a Scribd company logo
1 of 3
Download to read offline
Machine Learning Model as API with AWS
Serverless- Loves Cloud
Piggybacking Cloud technologies, business processes and activities are undergoing a
profound digital transformation. There is an emergence of new technologies and new
pathways every day. When the Internet was first introduced, its basic job was to
provide information. The objective of search engines have changed drastically from
providing just information which was before; to providing most accurate and relatable
information in the modern days. Machine Learning in general has helped this cause a
lot. Machine Learning in general, is basically an application of artificial intelligence.
Thus, machine learning can work and find solutions on it’s own from previous
experiences and trends; without explicitly manual user instructions.
Why and how Machine Learning is related to this?
Nowadays, Machine learning models are used in within different platforms. In general
terms, any machine learning model can be termed as a mathematical or statistical
representation of any real-life problem or situation. All machine learning models
consist of huge number of algorithms and training data. Whenever, any certain
situation occurs, the algorithm tries to find the best solution by finding different
patterns within the training data while corresponding to the different parameters given
by the input target. Machine learning as an application and machine learning models
go hand in hand while machine learning models do function as a sub-division under
the vast umbrella of artificial intelligence. All the big guns in the IT industry like
Google, Amazon, IBM and a lot of others are using Machine Learning as one of their
greatest tools to deliver different services to their customers.
Why use Machine Learning Model as API?
For understanding this concept, we first need to understand what API is exactly. The
full form of API is ‘Application Programming Interface.’ Basically, by using API, two
different software can communicate with each other. API, in general terms, is a pack
of codes, definitions, protocols, and tools all bundled together for building a software
or an application. Being the link between two software, APIs not only allow the
software to communicate but send and receive requests as well. This is the main
reason to use Machine Learning model as an API for distinctive application building
on the cloud. API gateway or in short, API becomes the connecting link to send and
receive requests over different servers in different locations, for the ease of work.
The Use of Machine Learning Model as API with AWS Serverless: A Case Study
The Use case
We recently got the chance to help one of our start-up clients from the Oil and Gas
research domain. They have to deal with heavy workloads on AWS for their
application. This was achieved by training and deploying a lot of machine learning
models using AWS SageMaker and AWS EC2. AWS SageMaker is a tool which
helps the data scientists and developers to quickly build and deploy applications
within a hosted environment. Also, AWS EC2 or elastic Compute Cloud is the tool for
providing scalable computing capacity across different virtual servers.
The Problem
For every single model that is going to be trained, deployed and exported, the
developers need to launch separate AWS EC2 instances, copy the models over to the
machines or to be precise the virtual machines and then again launch Flask or Django
based APIs to consume the pickle models. This is exactly where our client was
incurring too much cost for running AWS EC2 and SageMaker as they had to launch
new virtual machines each time they wanted to run the APIs which are eventually
based on different models. Deploying models using the AWS SageMaker dashboard
into a secure or scalable environment could be easily done with just one click. But, the
billing for the same is done based on the GPU instances and usage by minutes.
AWS Services Cost
EC2 (4x t3.medium) $ 133.3
EBS $ 15.0
Other AWS services
(including support)
$ 2
The testing phase:
Whenever our client wanted to test and train a new API, they had to launch a new
AWS EC2 instance. Not only this approach was difficult to handle and expensive, but
it was also the opposite of what our client had planned for using Machine Learning
models. Further tests implied that the EC2 instances were handling fewer numbers of
requests per hour. This test was conducted depending on some variables such as API
request, response data, and resource utilization. Tests also revealed that the EC2
instances are the reason for 90% of the total cost incurred by the client as the EC2
instances were idle for too long and at times, the virtual machines were serving as few
as 10 API requests per hour, or sometimes even less than that.
Our solution to the client
We had to keep in mind that there has to be a minimum number of instances running
just to make sure that the application can be accessed from anywhere. Rigorous
testing and analysis of APIs along with other variables were done such as the
following to make sure that we provide a robust solution to our client:
 Resource Utilization
 Request and response data size
 Size of Python API code
 Execution time (within a range of 200ms ~ 20000ms)
 Memory utilization for processing request with pickle model (that was in a
range of 500mb to 2400mb)
Our decision was to architect the APIs with the use of AWS Serverless components
such as:
 AWS Lambda
 API Gateway
 S3 for Storage
 and AWS Cognito
Since our Model were bit heavier on size, we stored them in a S3 Bucket and packed
all of the deployable codes for Lambda and deploy using AWS SAM template. The
result was- reduced cost incurrence.
AWS ServicesCost Per month
AWS Lambda $ 15
API Gateway < $ 26
AWS Cognito for Authentication
{Less than 50K users}
$ 0
AWS S3 < $5
As it is visible from the above chart, the machine learning model with API running
costs came down significantly. Plus, it was also possible to serve more requests with
an acceptable performance level using the same architecture.
At Loves Cloud, we are constantly leveraging the power of various open source
software solutions to automate, optimize, and scale the workloads of our customers.
To learn more about our services aimed at digital transformation of your business,
check https://www.loves.cloud/.

More Related Content

What's hot

AWS CodeStar - AWS TelAviv Summit 2017
AWS CodeStar - AWS TelAviv Summit 2017  AWS CodeStar - AWS TelAviv Summit 2017
AWS CodeStar - AWS TelAviv Summit 2017 Tara Walker
 
NEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon Pinpoint
NEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon PinpointNEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon Pinpoint
NEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon PinpointAmazon Web Services
 
Deploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gatewayDeploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gatewayShirish Gupta
 
Piyali Kamra - Building a Conversational AI Ecosystem on AWS Sage maker
Piyali Kamra - Building a Conversational AI Ecosystem on AWS Sage makerPiyali Kamra - Building a Conversational AI Ecosystem on AWS Sage maker
Piyali Kamra - Building a Conversational AI Ecosystem on AWS Sage makerAWS Chicago
 
Aws online course
Aws online courseAws online course
Aws online courseaashema
 
AI Services_Alastair Cousins_AWS
AI Services_Alastair Cousins_AWSAI Services_Alastair Cousins_AWS
AI Services_Alastair Cousins_AWSHelen Rogers
 
Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...
Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...
Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...Amazon Web Services
 
Announcing Amazon Pinpoint - January 2017 AWS Online Tech Talks
Announcing Amazon Pinpoint - January 2017 AWS Online Tech TalksAnnouncing Amazon Pinpoint - January 2017 AWS Online Tech Talks
Announcing Amazon Pinpoint - January 2017 AWS Online Tech TalksAmazon Web Services
 
Cloud-powered Mobile Apps
Cloud-powered Mobile AppsCloud-powered Mobile Apps
Cloud-powered Mobile AppsDanilo Poccia
 
(MBL317) NEW! Introducing AWS Mobile Hub
(MBL317) NEW! Introducing AWS Mobile Hub(MBL317) NEW! Introducing AWS Mobile Hub
(MBL317) NEW! Introducing AWS Mobile HubAmazon Web Services
 
API moderne e real-time per applicazioni innovative
API moderne e real-time per applicazioni innovativeAPI moderne e real-time per applicazioni innovative
API moderne e real-time per applicazioni innovativeCommit University
 
Connected Energy - An API Journey
Connected Energy - An API JourneyConnected Energy - An API Journey
Connected Energy - An API JourneyNordic APIs
 
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...Edureka!
 
Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications
Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications
Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications Amazon Web Services
 
ActiveCampaign API Developer Talks - Motivating Sales with Code
ActiveCampaign API Developer Talks - Motivating Sales with CodeActiveCampaign API Developer Talks - Motivating Sales with Code
ActiveCampaign API Developer Talks - Motivating Sales with CodeJordan Skole
 
Quantum Computing with Amazon Braket
Quantum Computing with Amazon BraketQuantum Computing with Amazon Braket
Quantum Computing with Amazon BraketAmazon Web Services
 
Aws training banglore 15
Aws training banglore 15Aws training banglore 15
Aws training banglore 15AshishApponix
 

What's hot (20)

AWS CodeStar - AWS TelAviv Summit 2017
AWS CodeStar - AWS TelAviv Summit 2017  AWS CodeStar - AWS TelAviv Summit 2017
AWS CodeStar - AWS TelAviv Summit 2017
 
NEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon Pinpoint
NEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon PinpointNEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon Pinpoint
NEW LAUNCH! How to Enable Real-Time Mobile App Engagement with Amazon Pinpoint
 
AWS Amplify
AWS AmplifyAWS Amplify
AWS Amplify
 
Deploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gatewayDeploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gateway
 
Piyali Kamra - Building a Conversational AI Ecosystem on AWS Sage maker
Piyali Kamra - Building a Conversational AI Ecosystem on AWS Sage makerPiyali Kamra - Building a Conversational AI Ecosystem on AWS Sage maker
Piyali Kamra - Building a Conversational AI Ecosystem on AWS Sage maker
 
Aws online course
Aws online courseAws online course
Aws online course
 
Aws autopilot
Aws autopilotAws autopilot
Aws autopilot
 
AI Services_Alastair Cousins_AWS
AI Services_Alastair Cousins_AWSAI Services_Alastair Cousins_AWS
AI Services_Alastair Cousins_AWS
 
Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...
Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...
Dennis Hills - Hands-On Building a Smarter Mobile App with Machine Learning o...
 
Announcing Amazon Pinpoint - January 2017 AWS Online Tech Talks
Announcing Amazon Pinpoint - January 2017 AWS Online Tech TalksAnnouncing Amazon Pinpoint - January 2017 AWS Online Tech Talks
Announcing Amazon Pinpoint - January 2017 AWS Online Tech Talks
 
Cloud-powered Mobile Apps
Cloud-powered Mobile AppsCloud-powered Mobile Apps
Cloud-powered Mobile Apps
 
(MBL317) NEW! Introducing AWS Mobile Hub
(MBL317) NEW! Introducing AWS Mobile Hub(MBL317) NEW! Introducing AWS Mobile Hub
(MBL317) NEW! Introducing AWS Mobile Hub
 
API moderne e real-time per applicazioni innovative
API moderne e real-time per applicazioni innovativeAPI moderne e real-time per applicazioni innovative
API moderne e real-time per applicazioni innovative
 
Connected Energy - An API Journey
Connected Energy - An API JourneyConnected Energy - An API Journey
Connected Energy - An API Journey
 
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
 
Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications
Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications
Deep Dive on AWS Mobile Hub for Enterprise Mobile Applications
 
ActiveCampaign API Developer Talks - Motivating Sales with Code
ActiveCampaign API Developer Talks - Motivating Sales with CodeActiveCampaign API Developer Talks - Motivating Sales with Code
ActiveCampaign API Developer Talks - Motivating Sales with Code
 
AWS API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
 
Quantum Computing with Amazon Braket
Quantum Computing with Amazon BraketQuantum Computing with Amazon Braket
Quantum Computing with Amazon Braket
 
Aws training banglore 15
Aws training banglore 15Aws training banglore 15
Aws training banglore 15
 

Similar to Machine Learning Model as API with AWS Serverless- Loves Cloud

Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
AWS Cloud School, Barcelona, Spain - intro and closing remarks
AWS Cloud School, Barcelona, Spain - intro and closing remarksAWS Cloud School, Barcelona, Spain - intro and closing remarks
AWS Cloud School, Barcelona, Spain - intro and closing remarksklamarv
 
Introduction to the AWS Cloud from Digital Tuesday Meetup
Introduction to the AWS Cloud from Digital Tuesday MeetupIntroduction to the AWS Cloud from Digital Tuesday Meetup
Introduction to the AWS Cloud from Digital Tuesday MeetupIan Massingham
 
AWS featuring Mechanical Turk for Financial Services_2014
AWS featuring Mechanical Turk for Financial Services_2014AWS featuring Mechanical Turk for Financial Services_2014
AWS featuring Mechanical Turk for Financial Services_2014Daniel Gray
 
AWS Cloud Solutions Architects & Tech Enthusiasts
AWS Cloud Solutions Architects & Tech EnthusiastsAWS Cloud Solutions Architects & Tech Enthusiasts
AWS Cloud Solutions Architects & Tech EnthusiastsJasonRoy50
 
Andy Jassy Illuminates Amazon Web Services
Andy Jassy Illuminates Amazon Web ServicesAndy Jassy Illuminates Amazon Web Services
Andy Jassy Illuminates Amazon Web ServicesMichael Skok
 
Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...
Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...
Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...Amazon Web Services
 
Amazon Webservices Introduction And Core Modules
Amazon Webservices Introduction And Core Modules Amazon Webservices Introduction And Core Modules
Amazon Webservices Introduction And Core Modules Manish Kumar
 
AWS Cloud School Introductory Presentation
AWS Cloud School Introductory PresentationAWS Cloud School Introductory Presentation
AWS Cloud School Introductory PresentationIan Massingham
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesIntroduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesAmazon Web Services
 
Amazon Web Services (AWS) Presentation
Amazon Web Services (AWS) PresentationAmazon Web Services (AWS) Presentation
Amazon Web Services (AWS) PresentationSunil Jagani
 
Aws serverless multi-tier_architectures
Aws serverless multi-tier_architecturesAws serverless multi-tier_architectures
Aws serverless multi-tier_architecturessonpro2312
 
What is Cloud Computing with AWS?
What is Cloud Computing with AWS?What is Cloud Computing with AWS?
What is Cloud Computing with AWS?Amazon Web Services
 
Cloud School Dublin - Intro
Cloud School Dublin - IntroCloud School Dublin - Intro
Cloud School Dublin - IntroIan Massingham
 
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and MicroservicesReply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and MicroservicesAndrea Mercanti
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computingwebscale
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesIntroduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesAmazon Web Services
 
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptxGangTingFan
 

Similar to Machine Learning Model as API with AWS Serverless- Loves Cloud (20)

Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
AWS Cloud School, Barcelona, Spain - intro and closing remarks
AWS Cloud School, Barcelona, Spain - intro and closing remarksAWS Cloud School, Barcelona, Spain - intro and closing remarks
AWS Cloud School, Barcelona, Spain - intro and closing remarks
 
Introduction to the AWS Cloud from Digital Tuesday Meetup
Introduction to the AWS Cloud from Digital Tuesday MeetupIntroduction to the AWS Cloud from Digital Tuesday Meetup
Introduction to the AWS Cloud from Digital Tuesday Meetup
 
What is Cloud Computing?
What is Cloud Computing?What is Cloud Computing?
What is Cloud Computing?
 
AWS featuring Mechanical Turk for Financial Services_2014
AWS featuring Mechanical Turk for Financial Services_2014AWS featuring Mechanical Turk for Financial Services_2014
AWS featuring Mechanical Turk for Financial Services_2014
 
AWS Cloud Solutions Architects & Tech Enthusiasts
AWS Cloud Solutions Architects & Tech EnthusiastsAWS Cloud Solutions Architects & Tech Enthusiasts
AWS Cloud Solutions Architects & Tech Enthusiasts
 
Scaling Fast & Running Lean
Scaling Fast & Running LeanScaling Fast & Running Lean
Scaling Fast & Running Lean
 
Andy Jassy Illuminates Amazon Web Services
Andy Jassy Illuminates Amazon Web ServicesAndy Jassy Illuminates Amazon Web Services
Andy Jassy Illuminates Amazon Web Services
 
Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...
Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...
Introduction to Cloud Computing with Amazon Web Services-ASEAN Workshop Serie...
 
Amazon Webservices Introduction And Core Modules
Amazon Webservices Introduction And Core Modules Amazon Webservices Introduction And Core Modules
Amazon Webservices Introduction And Core Modules
 
AWS Cloud School Introductory Presentation
AWS Cloud School Introductory PresentationAWS Cloud School Introductory Presentation
AWS Cloud School Introductory Presentation
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesIntroduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services
 
Amazon Web Services (AWS) Presentation
Amazon Web Services (AWS) PresentationAmazon Web Services (AWS) Presentation
Amazon Web Services (AWS) Presentation
 
Aws serverless multi-tier_architectures
Aws serverless multi-tier_architecturesAws serverless multi-tier_architectures
Aws serverless multi-tier_architectures
 
What is Cloud Computing with AWS?
What is Cloud Computing with AWS?What is Cloud Computing with AWS?
What is Cloud Computing with AWS?
 
Cloud School Dublin - Intro
Cloud School Dublin - IntroCloud School Dublin - Intro
Cloud School Dublin - Intro
 
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and MicroservicesReply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesIntroduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services
 
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
 

More from Loves Cloud

Setting up a kubernetes cluster on ubuntu 18.04- loves cloud
Setting up a kubernetes cluster on ubuntu 18.04- loves cloudSetting up a kubernetes cluster on ubuntu 18.04- loves cloud
Setting up a kubernetes cluster on ubuntu 18.04- loves cloudLoves Cloud
 
Jira for DevOps - Loves Cloud
Jira for DevOps - Loves CloudJira for DevOps - Loves Cloud
Jira for DevOps - Loves CloudLoves Cloud
 
Managing cost for your cloud workloads - Loves cloud
Managing cost for your cloud workloads - Loves cloudManaging cost for your cloud workloads - Loves cloud
Managing cost for your cloud workloads - Loves cloudLoves Cloud
 
Loves cloud - How do you manage your cloud
Loves cloud - How do you manage your cloudLoves cloud - How do you manage your cloud
Loves cloud - How do you manage your cloudLoves Cloud
 
Evolve your workloads with cloud - Loves Cloud
Evolve your workloads with cloud - Loves CloudEvolve your workloads with cloud - Loves Cloud
Evolve your workloads with cloud - Loves CloudLoves Cloud
 
March 2020 update - Loves cloud
March 2020 update - Loves cloudMarch 2020 update - Loves cloud
March 2020 update - Loves cloudLoves Cloud
 
Cloud management - loves cloud
Cloud management -  loves cloudCloud management -  loves cloud
Cloud management - loves cloudLoves Cloud
 
Cloud adoption - Loves cloud
Cloud adoption - Loves cloudCloud adoption - Loves cloud
Cloud adoption - Loves cloudLoves Cloud
 
Azure - Loves cloud
Azure - Loves cloudAzure - Loves cloud
Azure - Loves cloudLoves Cloud
 
A perfect lift off my journey
A perfect lift off  my journeyA perfect lift off  my journey
A perfect lift off my journeyLoves Cloud
 
Secure your jenkins
Secure your jenkinsSecure your jenkins
Secure your jenkinsLoves Cloud
 
Kubernetes - An introduction
Kubernetes - An introductionKubernetes - An introduction
Kubernetes - An introductionLoves Cloud
 

More from Loves Cloud (12)

Setting up a kubernetes cluster on ubuntu 18.04- loves cloud
Setting up a kubernetes cluster on ubuntu 18.04- loves cloudSetting up a kubernetes cluster on ubuntu 18.04- loves cloud
Setting up a kubernetes cluster on ubuntu 18.04- loves cloud
 
Jira for DevOps - Loves Cloud
Jira for DevOps - Loves CloudJira for DevOps - Loves Cloud
Jira for DevOps - Loves Cloud
 
Managing cost for your cloud workloads - Loves cloud
Managing cost for your cloud workloads - Loves cloudManaging cost for your cloud workloads - Loves cloud
Managing cost for your cloud workloads - Loves cloud
 
Loves cloud - How do you manage your cloud
Loves cloud - How do you manage your cloudLoves cloud - How do you manage your cloud
Loves cloud - How do you manage your cloud
 
Evolve your workloads with cloud - Loves Cloud
Evolve your workloads with cloud - Loves CloudEvolve your workloads with cloud - Loves Cloud
Evolve your workloads with cloud - Loves Cloud
 
March 2020 update - Loves cloud
March 2020 update - Loves cloudMarch 2020 update - Loves cloud
March 2020 update - Loves cloud
 
Cloud management - loves cloud
Cloud management -  loves cloudCloud management -  loves cloud
Cloud management - loves cloud
 
Cloud adoption - Loves cloud
Cloud adoption - Loves cloudCloud adoption - Loves cloud
Cloud adoption - Loves cloud
 
Azure - Loves cloud
Azure - Loves cloudAzure - Loves cloud
Azure - Loves cloud
 
A perfect lift off my journey
A perfect lift off  my journeyA perfect lift off  my journey
A perfect lift off my journey
 
Secure your jenkins
Secure your jenkinsSecure your jenkins
Secure your jenkins
 
Kubernetes - An introduction
Kubernetes - An introductionKubernetes - An introduction
Kubernetes - An introduction
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Machine Learning Model as API with AWS Serverless- Loves Cloud

  • 1. Machine Learning Model as API with AWS Serverless- Loves Cloud Piggybacking Cloud technologies, business processes and activities are undergoing a profound digital transformation. There is an emergence of new technologies and new pathways every day. When the Internet was first introduced, its basic job was to provide information. The objective of search engines have changed drastically from providing just information which was before; to providing most accurate and relatable information in the modern days. Machine Learning in general has helped this cause a lot. Machine Learning in general, is basically an application of artificial intelligence. Thus, machine learning can work and find solutions on it’s own from previous experiences and trends; without explicitly manual user instructions. Why and how Machine Learning is related to this? Nowadays, Machine learning models are used in within different platforms. In general terms, any machine learning model can be termed as a mathematical or statistical representation of any real-life problem or situation. All machine learning models consist of huge number of algorithms and training data. Whenever, any certain situation occurs, the algorithm tries to find the best solution by finding different patterns within the training data while corresponding to the different parameters given by the input target. Machine learning as an application and machine learning models go hand in hand while machine learning models do function as a sub-division under the vast umbrella of artificial intelligence. All the big guns in the IT industry like Google, Amazon, IBM and a lot of others are using Machine Learning as one of their greatest tools to deliver different services to their customers. Why use Machine Learning Model as API? For understanding this concept, we first need to understand what API is exactly. The full form of API is ‘Application Programming Interface.’ Basically, by using API, two different software can communicate with each other. API, in general terms, is a pack of codes, definitions, protocols, and tools all bundled together for building a software or an application. Being the link between two software, APIs not only allow the software to communicate but send and receive requests as well. This is the main reason to use Machine Learning model as an API for distinctive application building on the cloud. API gateway or in short, API becomes the connecting link to send and receive requests over different servers in different locations, for the ease of work. The Use of Machine Learning Model as API with AWS Serverless: A Case Study
  • 2. The Use case We recently got the chance to help one of our start-up clients from the Oil and Gas research domain. They have to deal with heavy workloads on AWS for their application. This was achieved by training and deploying a lot of machine learning models using AWS SageMaker and AWS EC2. AWS SageMaker is a tool which helps the data scientists and developers to quickly build and deploy applications within a hosted environment. Also, AWS EC2 or elastic Compute Cloud is the tool for providing scalable computing capacity across different virtual servers. The Problem For every single model that is going to be trained, deployed and exported, the developers need to launch separate AWS EC2 instances, copy the models over to the machines or to be precise the virtual machines and then again launch Flask or Django based APIs to consume the pickle models. This is exactly where our client was incurring too much cost for running AWS EC2 and SageMaker as they had to launch new virtual machines each time they wanted to run the APIs which are eventually based on different models. Deploying models using the AWS SageMaker dashboard into a secure or scalable environment could be easily done with just one click. But, the billing for the same is done based on the GPU instances and usage by minutes. AWS Services Cost EC2 (4x t3.medium) $ 133.3 EBS $ 15.0 Other AWS services (including support) $ 2 The testing phase: Whenever our client wanted to test and train a new API, they had to launch a new AWS EC2 instance. Not only this approach was difficult to handle and expensive, but it was also the opposite of what our client had planned for using Machine Learning models. Further tests implied that the EC2 instances were handling fewer numbers of requests per hour. This test was conducted depending on some variables such as API request, response data, and resource utilization. Tests also revealed that the EC2 instances are the reason for 90% of the total cost incurred by the client as the EC2 instances were idle for too long and at times, the virtual machines were serving as few as 10 API requests per hour, or sometimes even less than that. Our solution to the client
  • 3. We had to keep in mind that there has to be a minimum number of instances running just to make sure that the application can be accessed from anywhere. Rigorous testing and analysis of APIs along with other variables were done such as the following to make sure that we provide a robust solution to our client:  Resource Utilization  Request and response data size  Size of Python API code  Execution time (within a range of 200ms ~ 20000ms)  Memory utilization for processing request with pickle model (that was in a range of 500mb to 2400mb) Our decision was to architect the APIs with the use of AWS Serverless components such as:  AWS Lambda  API Gateway  S3 for Storage  and AWS Cognito Since our Model were bit heavier on size, we stored them in a S3 Bucket and packed all of the deployable codes for Lambda and deploy using AWS SAM template. The result was- reduced cost incurrence. AWS ServicesCost Per month AWS Lambda $ 15 API Gateway < $ 26 AWS Cognito for Authentication {Less than 50K users} $ 0 AWS S3 < $5 As it is visible from the above chart, the machine learning model with API running costs came down significantly. Plus, it was also possible to serve more requests with an acceptable performance level using the same architecture. At Loves Cloud, we are constantly leveraging the power of various open source software solutions to automate, optimize, and scale the workloads of our customers. To learn more about our services aimed at digital transformation of your business, check https://www.loves.cloud/.