Monday, May 8, 2023

Azure functions - When to go for premium plan

 


Azure functions are one of the serverless offerings from Azure where we can deploy some application logic which will be executed on a trigger.

Azure function application on consumption plan

There are many hosting options available, but hosting the function app with consumption plan is the way to go if there is no specific reason to do otherwise as this offers many benefits.

  • This is fully serverless and highly scalable, can scale up to 200 instances
  • You get free quota and charged for what you use (processing power and executions)
  • Its charged pay as go, so it the best place to start So the consumption plan is great for many requirements, but when would we need to go for premium plan?

Azure function application on Premium plan

Premium plan is offered with rapid scalability and special features at premium cost. Here from truly serverless behavior in consumption plan you get choice on the VMs we run out application on. Even though this offers high performance it uses the same scale controller for scaling. We will go thorough some of these features as we discuss.

More power

First reason you need to move to premium plan is when your application need more power. Here there are three SKUs to select from. These configuration offers much better CPU and memory than consumption plan. You can check these metrics of your app plan and decide on what size you need to scale up.

Rapid scaling and no cold starts

With Always Ready instances your application will be ready to serve when ever event occurs. You can go up to 20 always ready instances per app. So your application handle even a sudden load without any delay. As these instances start processing events new pre-warmed instance will be spawned ready to scale when needed. But remember these going to cost you even they don't process any events. You can scale up to 100 instances in the same plan and you can configure the max instance count per plan and app.

Virtual Networks Integration

If your function app need VNet integration you need to go for premium applications it is not supported in consumption plan. This provide function application access to resources in the VNet. Inbound IP restriction is available even with consumption plan.

High number of executions

In premium plan you are not charged for executions. So your enterprise application that have high number of small executions will benefit from moving to premium plan. Try out your scenario with pricing calculator.

When your load have predictable component

When the load of your application consist of dynamic and predictable components you can go for premium and use savings plan to reduce your cost. In an enterprise environment savings plan would benefit you as it will apply to many compute resources, not to single premium plan.

Long running process

Premium plan provide much lengthier timeouts (30 minutes to unlimited) to opposing to what offered in consumption plan (5 mins - 10 minute).

Docker image support

If you need to run your application custom Linux image that mean you need to go for premium plan.

When have multiple function apps

If you are running multiple application in same plan you might benefit from premium plan as several app can run on same VM depending on app footprint and SKU.

Conclusion

Be mindful as some of these will depend on the application you deploy such as what type of trigger it act on, resource usage, workload it handles and premium plan configuration. I would suggest first to deploy the application on consumption plan, identify the load and how it changing. Make your move based on your observations.

Friday, November 20, 2020

Board Games

 Board games are with long history. Whenever friends and family got together people used to play these. Some even get together just to play board games. These games could vary country to country, but some are very famous like Chess. Currently there are large number of new board games developed in the world. Also there are newer versions to classical board games. However these are not coming cheap for country like Sri Lanka. Luckily there are digitized online versions of these games. Some of the Sri Lankan board games enthusiasts are started to introduce these board games and the online platforms to Sri Lankan. And they are doing it in Sinhala so many can benefit from that. They are introducing to new board games explaining the rules and strategies used in them. They also show you how play the games with game play videos. Check there Youtube channel here. Hope you enjoy playing those games.



Saturday, April 9, 2016

Getting started with Node.js

What is Node.js?

Node.js is a buzzword in the software development industry and it has become a trend to develop enterprise level applications using Node. Some of the big companies are already converting their applications to Node. This seems to be good point to start to look in to Node.js.
This is an Open Source JavaScript runtime environment for developing server-side networking applications using JavaScript developed by Ryan Dahl in 2009. This uses Google Chrome V8 JavaScript Engine as Interpreter and libuv as the abstraction layer. Core libraries in Node.js itself are written in JavaScript. There is huge number of Packages available to use in Node.js with Node Package Manager (NPM). Node.js is cross platform, which can be deployed on Windows, Linux and OS X.

Sunday, January 12, 2014

How to simulate WAN (Wide Area Network) in LAN (Local Area Network)



Anyone ever needed to test the web application on a low bandwidth WAN link? But u can’t afford create a link using actual routers and other networking equipment.  I came across such situation where, a web application works fine within the development environment which is a LAN. But when application is deployed in the actual environment which is a WAN with low bandwidths like 128Kbps it becomes very slow to response. My solution was WINEM.

Saturday, July 20, 2013

Oracle Trigger to Log column level changes of Table

The requirement was to log changes to columns on any table to a common table. The information to be recorded was Table Name, Column Name, Action (Deletion, Insertion, and Modification), Old Value, New Value, Modified User, Modified Time and Modified PC.
The solution I came up with is to create the triggers on table using a script that trigger that fires on Update Delete and Insert. This trigger sends the information to a function that checks for changes. In the function if there are changes it will be logged to the Audit table. When calling the function I checked for the ‘Action’ and according to that change the information send to it.

Saturday, July 13, 2013

How to prevent user from double clicking button on a web application

I faced with situations where users click a button on a web application, and before the request was processed and response comes to the client user clicks again. This may produce inconsistent and unexpected results. A calculation will be performed twice or an entry is posted twice.
In order to prevent this I used was disabling the button until the response using java script.

Tuesday, December 25, 2012

Merry Christmas

Wish you all Peaceful & Joyful Christmas !!!