The alarm clock rings. You stop it. Gradually, all senses are activated. And then you think. You think about that cool web application you made the day before and then deployed to the Cloud environment. While you are having your coffee, you access the Cloud manager to see how everything is going, and you find that in not even one day you have accumulated more than 100 euros to pay. How can this be? If when… Oh, of course, when I set it all up I hit “next” because I just wanted to see if it would work…. How complicated all this Cloud stuff is… I wish there was a tool that would tell me the minimum resources I need and I could pay the minimum….
EXACTLY! If you are looking for no more headaches when it comes to deployments, changes of infrastructure, suppliers and you want to pay the minimum while having a good performance and no complaints from your customers and users, CLab is your solution!
CLab (temporary name, we accept proposals!) is a discrete event optimization and simulation tool/model developed and owned by inLab FIB, which is able to simulate any around any web application or system in general, that is wanted to deploy to, at the moment, 3 Cloud providers which are Amazon Web Services (AWS), Microsoft Azure and Google Cloud Platform (GCP). CLab is developed with FlexSim and consists of the following elements:
- Process Flow. It is the “brain” of the model.
- Global Tables. It is where all the data of the different Cloud providers, the data of the application to be simulated, and other data about the simulation process are located.
- Performance Measure Tables. This is where the different decision variables that the optimizer takes when maximizing or minimizing the respective objective functions are defined.
- Dashboards. Set of figures and graphs to view different metrics and simulation results.
- Global Parameters. List of parameters to configure different simulation scenarios.
Of all these elements, we will explain a little about how we have designed the one that is the “core” of the model, that is, the ProcessFlow element. In the following image you can see its architecture:
Model architecture
First of all, there is the generation of tokens. Each token represents a user, and accesses the system following a distribution that varies according to the type of user.
The next step is for the user to enter the web/system, and this involves a series of resources that have to be activated. If this activation of resources exceeds the limit that we have defined for our Cloud, then the user will go to a waiting queue until resources are released. To give a very simple example: accessing a website to buy tickets. When the website detects that the number of users is very high, start putting them in a waiting queue. In our case, this situation helps us to detect the number of users that cannot access, how long they are waiting until they can access, and in short, it helps us to have a value on the performance of the system.
Once the user has been able to log in, the model assigns a task to the user. Each user role has a defined list of tasks it can perform. Each task has a probability that the model takes into account to make the assignment. When the user performs the assigned task, the model simulates a series of events (queues, delays, resource consumption,…) that affect system performance.
Finally, when the user finishes the task, he can return to do another one or he can exit the system and finish his journey, which is the same as pressing the X to the browser to close it or to exit the web.
This is all well and good, but…. How can we optimize cost and performance? FlexSim incorporates a tool called “Optimizer” which, given a set of data, the simulation model, and the problem to be optimized, returns a list of the best solutions. In our case, we have previously collected data from each Cloud provider that we pass on to them as possible scenarios. The model is the one we have made. And for the problem to be optimized, a trade-off between performance and cost is made by applying some multi-objective optimization techniques, since, on the one hand, we are interested in minimizing the cost and, on the other hand, in maximizing the performance.
The Cloud world is becoming more and more widely used. Many companies are faced with the need to migrate from an on-premises environment to the cloud. About 4-5 years ago the UPC did it with some of its services as now the email, with the agreement it reached with Google. Therefore, it is very important to know the market well and to know what we need, and unfortunately this is not a simple process. That is why we believe that CLab can be of great help in this type of situation.