In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
What this article shares with you is an example analysis of Serverless using Spot to run Job tasks at a low cost. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Cost optimization
In addition to the advantages of second flexibility and unlimited capacity, ECI also has obvious cost optimization in some specific scenarios. From the figure above, we can see that for instances of the same specification, it is cheaper to use ECI when the daily running time is less than 14 hours.
In addition to situations where the daily running time is less than 14 hours, ECI instances also support a variety of billing types. Customers can choose the corresponding billing methods according to their business: RI instance coupons can be used for long run instances, Spot bidding instances can be used for running hours less than 1 hour, and postpaid instances are used for burst traffic.
Overview of Spot instance
Preemptive instance is an on-demand instance, which can reduce the computing cost in scenarios such as data computing. A preemptive instance has a protection period of one hour after it is successfully created. The market price of preemptive instances fluctuates with supply and demand. We support two spot strategies, one is based entirely on the market bid, and the other is to specify a price ceiling. We only need to add the corresponding annotation to the pod, which is very easy to use.
SpotAsPriceGo: the system automatically bids, following the actual price in the current market (usually in the form of discounts)
SpotWithPriceLimit: sets the upper limit of preemptive instance price
User price
< Spot 市场价格,实例会处于 pending 状态,并每 5 分钟自动进行一次出价,当价格等于或高于市场价格时,开始自动创建实例。运行一小时后,市场价格如果高于用户价格,则实例随时可能会被释放; 用户价格 >= Spot market price. If the inventory is sufficient, the instance is automatically created and priced according to the market price when the instance is successfully created. The default market price is the hourly price. Divide the hourly price by 3600 to get the price per second. Preemptive instances are billed per second
User price > = ECI instance price. Use ECI instance price to create an instance.
Create a Spot instance
To view the price of instances by quantity according to the specifications, click query
First, we query [the price of ecs.c5.large by volume (hour) in North China 2 (Beijing) region: 0.62], and then we create a Spot bidding instance based on this specification.
Spot instance is used to run CronJob, which adopts the methods of "specifying maximum price" and "system automatic bidding" respectively. Currently, there is no way to see the real price directly in the scenario that follows the market price. You can only query the billing information based on the instance ID.
Use the Spot instance to run Deployment. In this experiment, we use the policy of specifying the maximum price and set a very low hourly price. You can see that the creation of both Pod failed. Using the kubectl describe command, you can see that the detailed reason for the failure is the price mismatch: The current price of recommend instanceTypes above user max price.
As shown in the figure above, when a Spot instance runs for more than one hour of protection, the instance may be triggered due to insufficient inventory or the set price is less than the market price. An event will be notified 3 minutes before the instance is released.
Application scenario
You can deploy the following businesses on preemptive instances:
Real-time analysis of business
Big data computing business
A scalable business site
Image and media coding service
Scientific computing service
Geospatial survey and analysis business
Web crawler service
Test service
Preemptive instances are suitable for stateless application scenarios, such as self-scalable Web site services, image rendering, big data analysis and large-scale parallel computing. The higher the distribution, scalability, and fault tolerance of the application, the more suitable it is to use preemptive instances to save costs and improve throughput.
Matters needing attention
How to avoid the failure of instance preemption caused by too low bid?
Need to combine their own business characteristics, and fully take into account market price fluctuations in the case of a reasonable bid.
The system automatically bids, will it be released after the expiration of 1 hour?
When 1 hour expires, the system will try to bid again and will not be released if there is sufficient inventory.
What is the upper limit of automatic bidding for the system?
Do not exceed the highest price by quantity of the same specification (original price).
Is only supported in ECS InstanceType form?
Preemptive ECI instances still support ECS InstanceType and CPU / memory creation methods.
Is GPU instance supported?
Yes, just like in non-GPU mode.
The above is an example analysis of Serverless using Spot to run Job tasks at a low cost. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.