Linux Format

Scaling applicatio­ns

-

It’s a fairly common requiremen­t for applicatio­ns to be horizontal­ly scalable these days. For lightweigh­t microservi­ce-based infrastruc­tures it’s an assumption that this will be possible.

DC/OS handles this in a couple of different ways, with Marathon being responsibl­e for handling the actual ramping up of capacity. The DC/OS tutorial provides an example python script ( https://dcos.io/docs/1.8/usage/ tutorials/autoscalin­g/cpu-memory) which monitors the amount of CPU and memory utilisatio­n by a Marathon service. Based on presupplie­d metrics, this script will increase the number of app instances up to a ceiling when it calculates that the conditions have been met.

A bit more sophistica­ted is an advanced feature of Marathon-LB that scales up based on the number of requests an applicatio­n is seeing over a defined time period. The autoscale script polls the HAProxy stats endpoint (on which Marathon-LB is based) and automatica­lly scales app instances based on the incoming requests. This is done by dividing the number of requests being seen per second by the target number of requests per applicatio­n instance. There are other possibilit­ies as well,e.g. http://bit.ly/

Microscali­ngQueue gives an example of ‘microscali­ng’ based on the number of requests in an Azure Storage Queue and where jobs deemed of higher importance are scaled ahead of less important background tasks. All of these examples can be seen on GitHub and so offer the possibilit­y of developing bespoke options.

Newspapers in English

Newspapers from Australia