Use the correct posture of cloud computing

Editor's note: before the text began, let me first introduce the author, because this article let me on the Division I of the North University Pa has a new understanding of his mobile phone power supply is in the company Go back, just too will live a day. . . But only this spirit can write this article. Because, for the use of cloud computing business, save money is one of the demands.
The same time as the above-
Author brief introduction: Liu Mengxin, Ling-feng cloud senior software engineer, and comic master, is currently engaged in Caifei platform Caifei platform research and development work. Engaged in development, testing, operation and maintenance related positions, focusing on cloud computing and virtualization technology. Personal blog http://oilbeater.com . Another article "Docker engineers must read the paper: Google Borg" is also very popular.

The following text:

All say cloud computing like water and electricity, you will always have to open the faucet, do not turn off the lights?

Legend of the advantages of cloud computing is fast and cheap, that may be little difference between the quick, in the interface a few times a few VM came out, it can be said that the price difference came. To IDC to buy a physical machine, but the price of the host than the same configuration than the host a year more expensive, then the use of cloud computing is really more expensive than the physical machine? We use the posture to use the cloud computing in order to achieve the cost of optimization.

Pay on demand

The key to reducing costs is the four-word "pay on demand."

Say cloud computing like hydropower, you will put the faucet into the maximum 7 * 24 has been open, all the lights regardless of day and night are so bright it? Most people will wash the water left to wash the toilet, remove a few bulbs to save power, mobile phone power supply are also charged in the company just brought back. . .

Why use the time to calculate resources regardless of useful useless, the number of usage has been open, has been paying it?

For some services that do not need to be online, such as timing tasks, offline data processing If they are assigned a separate machine, then assuming that the machine is 30 yuan a month, the service is only 8 hours a day is working, then every month There are 20 yuan you are equivalent to the cloud service providers. If you can fine-tune the start-up time of the service, only when the service is running, the cost of each month will be significantly reduced.

For online services, we have traditionally controlled the load of the machine at a very low level in order to prevent the natural growth of visits and the sudden increase in access to certain conditions. May be the current level of 1 nuclear 1G can cope with, we have to keep the system jitter to get hold of a 4-core 8G, CPU use on the 20% are frightened, wait for CPU usage only single digits. So that you are equivalent to spend a expected peak cost, but only really use a small part of it, the remaining money and handed over to the transport manufacturers.

If we also like to pull their own water and electricity to think, we should let each of the existing machine load as high as possible, until the peak to the time, like a large pipe to open a few machines out, wait until the peak of the past Water pipes put a small, a surplus of water and electricity fees do not pay, and no longer have a headache this year, the budget in the end how to do.

If everything can be paid according to the idea of ​​the words to pay then every penny will be squeezed out of the most value, but the reality is not so good.

Reality is cruel

Pay for the ideal is very good, but the reality is very cruel. Said that the on-demand payment, provided that cloud manufacturers have the ability to provide on-demand fees, but a lot of the size is 1 hour, that is used 1 hour 1 second but also charge 2 hours of money. It's nice to be able to charge in seconds, but the hourly billing is much better than the year of the package, but there are some serious problems that limit our freedom to use cloud computing on demand.

On-demand means that the frequent start, stop, expansion, shrink, the current cloud vendors to provide computing resources are usually in the minute level, and to a bare machine to install your service is usually a long time, waiting for the process will let People feel irritable, such as the success of the expansion peak has long been over. If you provide the second level of billing, but the service line to the hour level, then this is still on the need for good.

On the other hand, the dynamic expansion of the shrinkage of the maintenance staff is also a burden, before buying the machine in a fixed time to deploy, and now will be on the line at any time off the assembly line may be late in the morning, may also play out, if so The collapse of the on-demand use, then let me waste some money, the annual package, the faucet to open a big bar.

Cloud computing weapons

In order to be able to use on demand, we need faster deployment speed and more convenient deployment method, give our faucet with intelligent control.
Cloud services typically provide virtual machine mirroring services to create services faster, but:

1. A virtual machine to create a mirror is a relatively heavy level of operation, the basic environment to do the mirror is also more appropriate, and frequent changes to the service to do the mirror image is a more troublesome thing;
2. Even if there is a mirror if the minute level of the start, we can not meet the requirements on demand.

iaasdocker.png

While the rapid deployment and the second level of the start is Docker is good at the field. If we can encapsulate and distribute the service using Docker mirroring, then we can reach the second level of deployment and start. Of course, the premise is that the cloud vendor is selling Docker containers, if you rely on the purchase of virtual machines and then manage the Docker, then it will be more tired.

Docker can solve the problem of deployment speed, but the frequent deployment of the manual operation caused by the problem is not resolved. This operation may be a few points in the interface can be, but automation is the correct use of cloud computing posture, or despite the billing level to reach the second level, the deployment has reached the second level, but the response to a few minutes to several hours , Then the speed in front is still meaningless.

We hope that the use of cloud computing can be used as smart home appliances, all things are automated, the door lights, out lights, air conditioning automatically control the indoor temperature, do not need people hands. This requires that the platform be able to provide enough APIs to allow the user to control all of the computing resources at will.

Docker and API are two of the tools that we are able to use cloud computing on demand. In the process of building the platform, we have been in accordance with the needs of the use of on-demand forward, our services are now in seconds billing, and can be achieved through the API on-demand start and stop. You can set the following two parameters when you start the service by calling the API:

  • Started_at start time
  • Stopped_at stop time

Complete API introduction documentation: http://docs.alauda.cn/api/services.html

    Heads up! This alert needs your attention, but it's not super important.