📜 ⬆️ ⬇️

Selectel Cloud - About Super Habraeffect, Small Optimization, and Costs for 2 Years

Almost 2 years ago I wrote a review about the then new “cloud” virtual machines of Selectel (the difference from all the others was and remains that memory consumption, disk operations, traffic - all this is considered and paid for separately and in great detail).

Now I want to draw a line under the results of almost 2 years of use, share a small hack on saving 600 rubles per year, and tell how I experienced the Über effect on it (repost on a dozen popular bourgeois sites).

Optimization

Under the virtual machine at selectk memory can be allocated on-demand. The best position will be when a virtual machine sticks out a bit in a swap. In the settings of memory-on-demand, I indicated “to keep free memory in the range of 24-32MB.” Such a value, however, is suitable only if your average memory consumption is relatively constant (apache2-mpm-prefork, nowhere processes under load are started).
')
To discard unused data and cache from memory, we write to crontab (this is for Ubuntu Server):
9 3 * * * echo 3 > /proc/sys/vm/drop_caches 
In this case, the data from the memory is discarded once a day. This gives a saving of 50 rubles per month from memory. If you throw it out once an hour, the gain is reduced by increasing the load on the disks.
Update: We found out that this only works when using a swap, when the standard Selectlel algorithm supports the amount of free memory larger than requested by the size of the used swap.

On the graph it looks like this (April):


SuperHub Effect

Average daily traffic is 5-6 GB. But on November 22, when I got on a massive repost on the bourgeois sites of links to my article about the opening of microcircuits, 242 GB of traffic arrived in one day (500 GB in a week), and this did not cause any problems.


Immediately striking atypically large consumption of disk operations. And the reason is simple - I'm a lazy person, and nginx didn’t set up a distribution of statics directly to nginx without Apache. nginx didn’t have enough memory to immediately cache Apache’s responses in memory for several giant photos up to 20Mb each (they accounted for most of the traffic), and he wrote temporary files to disk.

Total expenses for 2 years


We see that expenditure items besides traffic and memory are not too significant for a regular site.
It must be remembered that now this figure would be higher by 72 * 23 = 1656 rubles due to the lease of an IP address.

I had to contact the support only once - when the system time on the virtual machine differed from the correct one by 0.5 seconds: I couldn’t put ntpd myself on the virtual machine (= useless). Corrected.

Summary

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


All Articles