11. Microsoft Azure#gwab #ViseoSpirit
Cost efficiency, why would you care ?
When you scale, every cost optimization pays
*10000
– Selling many robots,
– many connected cars,
– having many players on your game …
12. Microsoft Azure#gwab #ViseoSpirit
And because when it’s cheap, you can do
even crazier things !
– GMail pre-opening/rendering all your email attachments
Cost efficiency, why would you care ?
24. Microsoft Azure#gwab #ViseoSpirit
Mesuring Quality of service
– Cloud solutions bring new opportunities to lower costs
– But sometimes at the expense of QoS !
• Which is why is very important to consider the
costEff and not just the cost
25. Microsoft Azure#gwab #ViseoSpirit
QoS - Examples
• Perfect(costEff)
– A system that is ‘on’ only when a user request comes in
• Nearly infinite cost efficiency (by moving the cost
toward 0)
27. Microsoft Azure#gwab #ViseoSpirit
Cloud cost maturity level
Initial
Monitored
Allocated
Business valued
1 Cost are not estimated or
monitored and are are to predict
1 Costs are monitored at a global
level, or per account
1 Costs are monitored by amount
of business transactions
1 Costs are monitored and
allocated to business units,
products, …
29. Microsoft Azure#gwab #ViseoSpirit
• Don’t let things running if you don’t use them
– Easier said than done ! How do you know what is used
and what is not ?
–
– Examples of pure waste
• Don’t keep 'stopped' Azure Applications in any other
tier than the 'F1 Free tier' (automation helps here)
Pure Waste
30. Microsoft Azure#gwab #ViseoSpirit
• Ensure you use what has been pre-
purchased at the optimal price
– Avoid using rogue Subscriptions that would be at on-
demand (instead of within Enterprise Agreement) prices
Less obvious waste
37. Microsoft Azure#gwab #ViseoSpirit
Exemple of expensive resources
• Caviar in cloud = outgoing traffic
– Can you implement efficient client-side caching ?
– Can you move part of the trafic to a CDN (hopefully
less expensive) ?
40. Microsoft Azure#gwab #ViseoSpirit
How can you act on that ?
– Thread swapping is a major SYSTEM CPU cycles
burner !
• Real customer story about this
41. Microsoft Azure#gwab #ViseoSpirit
New concerns
• Speed of boot
– Wasn’t a concern up to now
• Now, slow booting speed is a major pain in some
Cloud environments (Jersey + Google AppEngine
for instance)
• And the Azure Cloud …
44. Microsoft Azure#gwab #ViseoSpirit
Ex1 – Web site with external depend.
• Move to non-blocking I/O
– Runtime cost divided by 8 !
• For the exact same service, same QoS, same SLA
• 4 Xlarge instances become 2 small instances
• Tomcat/Java => NodeJS (would be the same with
RxJava/…)
45. Microsoft Azure#gwab #ViseoSpirit
Ex1 – Web site with external depend.
• The perfect « ad » for NodeJS
– This is not always the case, as we will see in the
following examples
– Actually perfect Ad for any Reactive framework
(NodeJS based or not)
46. Microsoft Azure#gwab #ViseoSpirit
Ex2 – Unfreq. used service
• Web site with unfrequently called micro-
service
• Only called once each time a new user creates an
account
47. Microsoft Azure#gwab #ViseoSpirit
Ex2 – Unfreq. used service
– Perfect candidate for onDemand short duration
instances +
– Non-blocking I/Os
• Would bring the cost close to 0
50. Microsoft Azure#gwab #ViseoSpirit
Ex2 – Need ultra fast resp.
• So we keep an instance idle
• A CSP with very very fast booting instances could
solve it though !
– => cf AWS Lambda (should appear in Azure shortly)
52. Microsoft Azure#gwab #ViseoSpirit
Ex3 – Web ticketing
• Looks like another ideal case for non
blocking I/O
– Cut the number of instances from 54 to 9
54. Microsoft Azure#gwab #ViseoSpirit
Ex3 – Web ticketing
• Actually another ideal case for Object
Storage
– Amazon S3, Azure Blob Storage, Google GCS, …
• Just need one instance (non-blocking) to generate
self-signed URLs
57. Microsoft Azure#gwab #ViseoSpirit
• You need to be able to shut things DOWN
and turn them ON very regularly
– It shouldn’t take long to switch power ON/OFF
– You can’t spend several minutes every morning and
night switching things on and off. With the potentiel
errors that would come with it
Deployment automation benefits
58. Microsoft Azure#gwab #ViseoSpirit
• You need to be able to test several variants
of your systems
– Test with different instance types
– Test various configurations
Deployment automation benefits
59. Microsoft Azure#gwab #ViseoSpirit
• You need to be able to test several variants
of your systems regularly
– Things change fast in the Cloud world
Deployment automation benefits
60. Microsoft Azure#gwab #ViseoSpirit
• Continuous cost improvement
– Continuous deployment (Infra + App)
– Load generation
– Cost measurement
– Comparison with previous runs
=> Feedback for architects and developers
Deployment automation benefits
63. Microsoft Azure#gwab #ViseoSpirit
Measuring tests costs
• Measuring small cost increments (few mins)
• Tags (Need to change tag values on each run)
• Need to change instances (1h / 10min)
• Need to use taggable servicesTag *all* services
64. Microsoft Azure#gwab #ViseoSpirit
Measuring tests costs
• Cost-allocate every test execution
– Tag all the resources created
• Propagate tags to elements which are not tagged
by default
• If some elements are not taggeable, run them on
specific subscriptions (cost are per subscriptions)
tag[TestId]=bfd3e690-ce14-11e3-9c1a-0800200c9a66
65. Microsoft Azure#gwab #ViseoSpirit
Measuring tests costs (continued)
• With some Cloud providers, you can
retrieve specific debug cost information
– Detailed cost items provided by the Cloud provider
– For instance, Google AppEngine log lines contain cost
information
• Very precise because isolated per requests but no
global overview
66. Microsoft Azure#gwab #ViseoSpirit
Collect the cost data (after test execution)
• Scan through detailed cost logs
– Detailed Billing Files provided by Azure (equivalent to
the information provided by AWS or Google Cloud)
– Cost data coming after a delay (4 to 24h)
67. Microsoft Azure#gwab #ViseoSpirit
Collect the business value data (after exec)
• Scan through application logs and
performance logs
– Application logs to determine the value produced
– Performance logs for the QoS computation
68. Microsoft Azure#gwab #ViseoSpirit
Compute your cost-efficiency level
• « Cost of test run »
+ « Generated business throughput »
=> « Cost by business metrics »
– Exemple : 3.47€ HT per 100 « vehicule configuration
simulation »