📜 ⬆️ ⬇️

Tweaking memory on demand in the cloud


News in one line: now clients can change the MOD parameters from the control panel.

A long time ago, in our mod-server, the ability to control memory allocation parameters was implemented. This was implemented at the level of the server itself and the parameters of the database.

... But this was not in the web interface. The most persistent customers asked to change the settings - and we changed them manually. Stupid right
')
Finally, we fixed the situation - the MOD-server settings were made available to clients. Most of them are applied on the go and do not require a restart or suspension of service.

Memory-on-Demand working principle

Depending on the number of running programs, a different amount of memory is required. Since the memory is paid in "gigabyte hours" (in fact, in kilobyte-nanoseconds), then it is a pity to spend extra money on unused memory. But to huddle in a small amount, getting into a swap is also not good.

The whole MOD system consists of three components: a server, a database (settings) and agents.

The agent - modd (mod daemon) is running inside the guest machine, it writes to the xenstore (a system through which the guest system can interact with the manager in the dom0 without using the network) information about the current state of the memory. More precisely, it simply writes data from / proc / meminfo to the xenstore in data / mod_meminfo.

The server looks at these numbers and decides whether to add more memory or reduce it. MOD-server operation algorithm (in general): the amount of free memory is considered (we correctly take into account buffers and cached), if it is more than necessary, then the memory is reduced. If less than needed, then increase.

Parameters that control the operation of the MOD

MOD has the following parameters:

If the field is written zero (or nothing is written), then the default values ​​are used.

Exceptions


List of applications for which MOD is not needed. If the application is primary on the server, the memory limits can be set the same and do not torture the server in vain:


PS Previous topic on this topic: habrahabr.ru/company/selectel/blog/99157

Source: https://habr.com/ru/post/117925/


All Articles