forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
102 lines
19 KiB
HTML
102 lines
19 KiB
HTML
<a name="functiongraph_01_1837"></a><a name="functiongraph_01_1837"></a>
|
|
|
|
<h1 class="topictitle1">Reserved Instance Management</h1>
|
|
<div id="body32001227"><div class="section" id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section36993910598"><h4 class="sectiontitle">Introduction</h4><p id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_p1075111110486">FunctionGraph provides on-demand and reserved instances.</p>
|
|
<ul id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_ul160720493"><li id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_li1925321517495">On-demand instances are created and released by FunctionGraph based on actual function usage. When receiving requests to call functions, FunctionGraph automatically allocates execution resources to the requests.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_li33181941165318">Reserved instances can be created and released by you as required. After you create reserved instances for a function, FunctionGraph preferentially forwards requests to the reserved instances. If the number of requests exceeds the processing capability of the reserved instances, FunctionGraph will forward the excessive requests to on-demand instances and automatically allocates execution resources to these requests.<p id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_p18117114245319"><a name="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_li33181941165318"></a><a name="en-us_topic_0000001356130857_en-us_topic_0241013219_li33181941165318"></a>After reserved instances are created for a function, the code, dependencies, and initializer of the function are automatically loaded. Reserved instances are always alive in the execution environment, eliminating the influence of cold starts on your services. (Do not execute one-time services using the initializer of reserved instances.)</p>
|
|
<p id="functiongraph_01_1837__en-us_topic_0000001356130857_p629661734814"><strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b22991541161717">You can configure <a href="#functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section1064812184016">a fixed number of reserved instances</a> or <a href="#functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section516211925918">scheduled scaling policies</a>.</strong></p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section1064812184016"><a name="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section1064812184016"></a><a name="en-us_topic_0000001356130857_en-us_topic_0241013219_section1064812184016"></a><h4 class="sectiontitle">Configuring a Fixed Number of Reserved Instances</h4><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1781173453614">Ensure that the function for which you want to create reserved instances already exists on the FunctionGraph console.</p>
|
|
<ol id="functiongraph_01_1837__en-us_topic_0000001356130857_ol9726133131813"><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li19220424104513">Log in to the FunctionGraph console. In the navigation pane, choose <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b9437134615354">Functions</strong> > <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b114371464352">Function List</strong>.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li85541845124517">Click the target function to go to the details page.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li13283183812464">Choose <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b106151923102613">Configuration</strong> > <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b10616202311260">Concurrency</strong>, and click <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b27841544182619">Add</strong>.<div class="fignone" id="functiongraph_01_1837__en-us_topic_0000001356130857_fig132251148154410"><span class="figcap"><b>Figure 1 </b>Clicking Add</span><br><span><img id="functiongraph_01_1837__en-us_topic_0000001356130857_image122594814418" src="en-us_image_0000001356014693.png"></span></div>
|
|
</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li114910141459">Set parameters by referring to <a href="#functiongraph_01_1837__en-us_topic_0000001356130857_table133267395252">Table 1</a>.<div class="p" id="functiongraph_01_1837__en-us_topic_0000001356130857_p12986194062515">You can create a specified number of reserved instances for a function version or alias. This number cannot exceed the maximum number of requests per instance or the maximum number of instances per function.<div class="fignone" id="functiongraph_01_1837__en-us_topic_0000001356130857_fig111088463513"><span class="figcap"><b>Figure 2 </b>Basic settings</span><br><span><img id="functiongraph_01_1837__en-us_topic_0000001356130857_image14109104143510" src="en-us_image_0000001631298906.png"></span></div>
|
|
|
|
<div class="tablenoborder"><a name="functiongraph_01_1837__en-us_topic_0000001356130857_table133267395252"></a><a name="en-us_topic_0000001356130857_table133267395252"></a><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_1837__en-us_topic_0000001356130857_table133267395252" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Basic settings</caption><thead align="left"><tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1032463912519"><th align="left" class="cellrowborder" valign="top" width="13.270000000000001%" id="mcps1.3.2.3.4.2.2.2.3.1.1"><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1932317396253">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="86.72999999999999%" id="mcps1.3.2.3.4.2.2.2.3.1.2"><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p173241395254">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row43241539182519"><td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.2.3.4.2.2.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p19324133917255">Function Name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="86.72999999999999%" headers="mcps1.3.2.3.4.2.2.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p8324163911255">Name of the current function.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row332514399251"><td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.2.3.4.2.2.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1832483910258">Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="86.72999999999999%" headers="mcps1.3.2.3.4.2.2.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p17324439122517">Select <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b20856104210354">Version</strong> or <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b2831345133519">Aliases</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1232543918251"><td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.2.3.4.2.2.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1732513942510">Version</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="86.72999999999999%" headers="mcps1.3.2.3.4.2.2.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p143251839102512">Set this parameter when you select <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b629191112376">Version</strong> for <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b9732715203713">Type</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1132613396256"><td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.2.3.4.2.2.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p13254392259">Alias</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="86.72999999999999%" headers="mcps1.3.2.3.4.2.2.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p432518397258">Set this parameter when you select <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b930732114378">Aliases</strong> for <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b1308192118378">Type</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row113264391258"><td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.2.3.4.2.2.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p2326839172520">Min. Instances</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="86.72999999999999%" headers="mcps1.3.2.3.4.2.2.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p53261639152510">Minimum number of instances. Max.: <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b136217314301">1000</strong>. FunctionGraph reserves the specified number of instances for the function. These instances will always run unless you change <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b1751715232415">Min. Instances</strong> to <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b828782716414">0</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row93269396252"><td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.2.3.4.2.2.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p8326039122518">Idle Mode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="86.72999999999999%" headers="mcps1.3.2.3.4.2.2.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1332673916253">This mode saves costs as CPU resources are not used when reserved instances are not invoked.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="functiongraph_01_1837__en-us_topic_0000001356130857_note173275396256"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="functiongraph_01_1837__en-us_topic_0000001356130857_ul1681193913230"><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li206814399234">Reserved instances cannot be configured for both a function alias and the corresponding version. For example, if the alias of the latest version is 1.0 and reserved instances have been configured for this version, no more instances can be configured for alias 1.0.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li52221741162311">After the idle mode is enabled, reserved instances are initialized and the mode change needs some time to take effect. You will still be billed at the price of reserved instances for non-idle mode in this period.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li141401352111219">If the function concurrency is greater than the number of reserved instances, the excess requests will be allocated to on-demand instances, which involve a cold start.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li51711196215">Click <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b19707245114312">OK</strong>. The new policy is displayed in the reserved instance policy list.<div class="fignone" id="functiongraph_01_1837__en-us_topic_0000001356130857_fig151714199215"><span class="figcap"><b>Figure 3 </b>Policy list</span><br><span><img id="functiongraph_01_1837__en-us_topic_0000001356130857_image1617171917217" src="en-us_image_0000001302775168.png"></span></div>
|
|
</li></ol>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section516211925918"><a name="functiongraph_01_1837__en-us_topic_0000001356130857_en-us_topic_0241013219_section516211925918"></a><a name="en-us_topic_0000001356130857_en-us_topic_0241013219_section516211925918"></a><h4 class="sectiontitle">Configuring a Scheduled Scaling Policy</h4><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p101364259276">Configure the number of reserved instances that will run in a specified period and a cron expression. During this period, FunctionGraph adjusts the number of reserved instances based on the cron expression. When the period expires, the fixed number of instances will be reserved.</p>
|
|
<ol id="functiongraph_01_1837__en-us_topic_0000001356130857_ol15320103714491"><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li163203374498">Configure the basic settings by referring to <a href="#functiongraph_01_1837__en-us_topic_0000001356130857_table133267395252">Table 1</a>, and then click <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b1674114326525">Add Policy</strong>.<div class="fignone" id="functiongraph_01_1837__en-us_topic_0000001356130857_fig1725105815382"><span class="figcap"><b>Figure 4 </b>Clicking Add Policy</span><br><span><img id="functiongraph_01_1837__en-us_topic_0000001356130857_image1972525813810" src="en-us_image_0000001631299366.png"></span></div>
|
|
</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li64191634195711">Set parameters by referring to <a href="#functiongraph_01_1837__en-us_topic_0000001356130857_table8405162215410">Table 2</a>.<div class="fignone" id="functiongraph_01_1837__en-us_topic_0000001356130857_fig204041922135414"><span class="figcap"><b>Figure 5 </b>Adding a policy</span><br><span><img id="functiongraph_01_1837__en-us_topic_0000001356130857_image340412222545" src="en-us_image_0000001303254576.png"></span></div>
|
|
|
|
<div class="tablenoborder"><a name="functiongraph_01_1837__en-us_topic_0000001356130857_table8405162215410"></a><a name="en-us_topic_0000001356130857_table8405162215410"></a><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_1837__en-us_topic_0000001356130857_table8405162215410" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Scheduled scaling policy parameters</caption><thead align="left"><tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1740414229543"><th align="left" class="cellrowborder" valign="top" width="15.47%" id="mcps1.3.3.3.2.3.2.3.1.1"><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p940414221548">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="84.53%" id="mcps1.3.3.3.2.3.2.3.1.2"><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p12404112210545">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1340417228544"><td class="cellrowborder" valign="top" width="15.47%" headers="mcps1.3.3.3.2.3.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p9404182295415">Policy Name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.53%" headers="mcps1.3.3.3.2.3.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1940411228543">Policy name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row114046220545"><td class="cellrowborder" valign="top" width="15.47%" headers="mcps1.3.3.3.2.3.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p2404122219541">Cron Expression (UTC)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.53%" headers="mcps1.3.3.3.2.3.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1969109125910">Set this parameter by referring to <a href="functiongraph_01_0908.html#functiongraph_01_0908">Cron Expressions for a Function Timer Trigger</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1540410226547"><td class="cellrowborder" valign="top" width="15.47%" headers="mcps1.3.3.3.2.3.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p164041922175410">Validity</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.53%" headers="mcps1.3.3.3.2.3.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p5902164517310">Local time when the cron expression is effective.</p>
|
|
<p id="functiongraph_01_1837__en-us_topic_0000001356130857_p15664105211319">The scheduled scaling policy is effective only during this validity period. In other time, the <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b14425735311">Min. Instances</strong> in the basic settings is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1837__en-us_topic_0000001356130857_row1340572213541"><td class="cellrowborder" valign="top" width="15.47%" headers="mcps1.3.3.3.2.3.2.3.1.1 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1340452285413">Min. Instances</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.53%" headers="mcps1.3.3.3.2.3.2.3.1.2 "><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1873894015315">The number of reserved instances to be created when the policy is effective.</p>
|
|
<p id="functiongraph_01_1837__en-us_topic_0000001356130857_p8405922145418">Set a number that meets your service requirements.</p>
|
|
<div class="note" id="functiongraph_01_1837__en-us_topic_0000001356130857_note13405192225414"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p540542275414">The number must be greater than or equal to the <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b358619388135">Min. Instances</strong> in the basic settings.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li10745171319811">Click <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b184594485011">OK</strong>. The new policy is displayed in the reserved instance policy list.<div class="fignone" id="functiongraph_01_1837__en-us_topic_0000001356130857_fig10468164810314"><span class="figcap"><b>Figure 6 </b>Policy list</span><br><span><img id="functiongraph_01_1837__en-us_topic_0000001356130857_image134693482036" src="en-us_image_0000001356134133.png"></span></div>
|
|
</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li3996181552414">To modify the reserved instance policy, click <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b1096830101519">Edit</strong> in the <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b1330433611518">Operation</strong> column. Then modify or add scheduled scaling policies.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li113465511120">To delete a reserved instance policy under a function version or alias, click <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b135610142416">Delete</strong> in the <strong id="functiongraph_01_1837__en-us_topic_0000001356130857_b15561414841">Operation</strong> column.</li><li id="functiongraph_01_1837__en-us_topic_0000001356130857_li7773346388">To view concurrent instances, click a quantifier in the reserved instance policy list, and click a scheduled scaling policy name.<div class="note" id="functiongraph_01_1837__en-us_topic_0000001356130857_note194211128113310"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="functiongraph_01_1837__en-us_topic_0000001356130857_p1142132811337">Multiple scheduled policies can be configured. For example, the number of reserved instances at 08:00 and 21:00 is updated to 100 and 10 respectively.</p>
|
|
</div></div>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
|