{"id":35861,"date":"2024-11-26T17:15:56","date_gmt":"2024-11-26T09:15:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/35861\/"},"modified":"2024-11-26T17:15:56","modified_gmt":"2024-11-26T09:15:56","slug":"%e5%b8%a6%e6%9c%89-graalvm-native-image-%e7%9a%84-lambda-%e5%87%bd%e6%95%b0-%e4%bd%bf%e7%94%a8%e4%b8%8d%e5%90%8c%e7%9a%84-lambda-%e5%86%85%e5%ad%98%e8%ae%be%e7%bd%ae%e9%83%a8%e5%88%86%e7%bc%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/35861\/","title":{"rendered":"\u5e26\u6709 GraalVM Native Image \u7684 Lambda \u51fd\u6570 &#8211; \u4f7f\u7528\u4e0d\u540c\u7684 Lambda \u5185\u5b58\u8bbe\u7f6e\u90e8\u5206\u7f13\u89e3\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173078065014790.jpg\" class=\"aligncenter\" title=\"\u5e26\u6709 GraalVM Native Image \u7684 Lambda \u51fd\u6570 &#8211; \u4f7f\u7528\u4e0d\u540c\u7684 Lambda \u5185\u5b58\u8bbe\u7f6e\u90e8\u5206\u7f13\u89e3\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\u63d2\u56fe\" alt=\"\u5e26\u6709 GraalVM Native Image \u7684 Lambda \u51fd\u6570 &#8211; \u4f7f\u7528\u4e0d\u540c\u7684 Lambda \u5185\u5b58\u8bbe\u7f6e\u90e8\u5206\u7f13\u89e3\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\u63d2\u56fe\" \/><\/p>\n<h2> \u4ecb\u7ecd <\/h2>\n<p>\u5728\u6211\u4eec\u7684\u6587\u7ae0\u7cfb\u5217\u7684\u7b2c 2 \u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u63a2\u7d22\u4e86\u5982\u4f55\u4f7f\u7528\u5305\u542b GraalVM 21 \u8fd0\u884c\u65f6\u7684 GraalVM Native Image \u7684\u81ea\u5b9a\u4e49\u8fd0\u884c\u65f6\u6765\u5f00\u53d1\u548c\u90e8\u7f72\u7eaf Lambda \u51fd\u6570\uff08\u4e0d\u4f7f\u7528 Spring Boot 3 \u7b49\u4efb\u4f55\u6846\u67b6\uff09\uff0c\u5728\u7b2c 3 \u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u6d4b\u91cf\u4e86\u4f7f\u7528\u6b64\u65b9\u6cd5\u4f7f\u7528 1024 MB \u5185\u5b58\u7684 Lambda \u51fd\u6570\u7684\u6027\u80fd\uff08\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\u65f6\u95f4\uff09\u3002<\/p>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 256 \u5230 1536 MB \u4e4b\u95f4\u7684\u4e0d\u540c\u5185\u5b58\u8bbe\u7f6e\u6765\u6d4b\u91cf Lambda \u7684\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\uff0c\u4ee5\u63a2\u7d22\u6210\u672c\u548c\u6027\u80fd\u4e4b\u95f4\u7684\u6743\u8861\u3002<\/p>\n<h2> \u4f7f\u7528\u5305\u542b\u5177\u6709\u4e0d\u540c\u5185\u5b58\u8bbe\u7f6e\u7684 GraalVM \u672c\u673a\u6620\u50cf\u7684\u81ea\u5b9a\u4e49\u8fd0\u884c\u65f6\u6d4b\u91cf Lambda \u51fd\u6570\u7684\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8 <\/h2>\n<p>\u6211\u4eec\u5c06\u91cd\u590d\u4f7f\u7528\u672c\u7cfb\u5217\u6587\u7ae0\u7b2c 3 \u90e8\u5206\u4e2d\u63cf\u8ff0\u7684\u5b8c\u5168\u76f8\u540c\u7684\u5b9e\u9a8c\uff0c\u4f46\u5185\u5b58\u8bbe\u7f6e\u5728 256 \u5230 1536 MB \u4e4b\u95f4\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u5b9e\u9a8c\u7ed3\u679c\uff1a<\/p>\n<p><strong>\u51b7 (c) \u548c\u6696 (m) \u5f00\u59cb\u65f6\u95f4\uff08\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\uff09\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Memory setting<\/th>\n<th>c p50<\/th>\n<th>c p75<\/th>\n<th>c p90<\/th>\n<th>c p99<\/th>\n<th>c p99.9<\/th>\n<th>c max<\/th>\n<th>w p50<\/th>\n<th>w p75<\/th>\n<th>w p90<\/th>\n<th>w p99<\/th>\n<th>w p99.9<\/th>\n<th>w max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>256 MB<\/td>\n<td>822.74<\/td>\n<td>833.50<\/td>\n<td>845.25<\/td>\n<td>923.88<\/td>\n<td>952.96<\/td>\n<td>953.84<\/td>\n<td>4.04<\/td>\n<td>4.59<\/td>\n<td>5.47<\/td>\n<td>18.55<\/td>\n<td>137.10<\/td>\n<td>471.76<\/td>\n<\/tr>\n<tr>\n<td>512 MB<\/td>\n<td>620.04<\/td>\n<td>621.40<\/td>\n<td>657.70<\/td>\n<td>705.37<\/td>\n<td>727.57<\/td>\n<td>727.97<\/td>\n<td>4.16<\/td>\n<td>4.65<\/td>\n<td>5.46<\/td>\n<td>14.32<\/td>\n<td>64.54<\/td>\n<td>229.29<\/td>\n<\/tr>\n<tr>\n<td>768 MB<\/td>\n<td>561.63<\/td>\n<td>574.11<\/td>\n<td>589.82<\/td>\n<td>628.15<\/td>\n<td>633.83<\/td>\n<td>634.23<\/td>\n<td>4.23<\/td>\n<td>4.73<\/td>\n<td>5.55<\/td>\n<td>13.01<\/td>\n<td>42.31<\/td>\n<td>203.22<\/td>\n<\/tr>\n<tr>\n<td>1024 MB<\/td>\n<td>525.77<\/td>\n<td>532.12<\/td>\n<td>542.32<\/td>\n<td>632.56<\/td>\n<td>635.73<\/td>\n<td>636.11<\/td>\n<td>4.16<\/td>\n<td>4.69<\/td>\n<td>5.46<\/td>\n<td>12.30<\/td>\n<td>37.25<\/td>\n<td>211.83<\/td>\n<\/tr>\n<tr>\n<td>1280 MB<\/td>\n<td>515.37<\/td>\n<td>524.20<\/td>\n<td>539.08<\/td>\n<td>577.57<\/td>\n<td>624.39<\/td>\n<td>624.52<\/td>\n<td>4.23<\/td>\n<td>4.77<\/td>\n<td>5.64<\/td>\n<td>12.80<\/td>\n<td>34.67<\/td>\n<td>126.97<\/td>\n<\/tr>\n<tr>\n<td>1536 MB<\/td>\n<td>504.16<\/td>\n<td>516.40<\/td>\n<td>528.93<\/td>\n<td>548.86<\/td>\n<td>628.15<\/td>\n<td>628.31<\/td>\n<td>4.26<\/td>\n<td>4.73<\/td>\n<td>5.55<\/td>\n<td>12.70<\/td>\n<td>44.03<\/td>\n<td>105.46<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2> \u7ed3\u8bba <\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u4f7f\u7528\u5305\u542b GraalVM Native Image \u548c GraalVM 21 \u8fd0\u884c\u65f6\u7684\u81ea\u5b9a\u4e49\u8fd0\u884c\u65f6\uff0c\u6d4b\u91cf\u4e86\u5185\u5b58\u8bbe\u7f6e\u5728 256 \u5230 1536 MB \u4e4b\u95f4\u7684\u7eaf Lambda \u51fd\u6570\u7684\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\u3002<\/p>\n<p>\u6211\u4eec\u89c2\u5bdf\u5230\uff0c\u5bf9\u4e8e\u8bbe\u7f6e\u8f83\u4f4e\u7684\u5185\u5b58\uff08\u4f8b\u5982 256 \u6216 512 MB\uff09\uff0c\u70ed\u542f\u52a8\u65f6\u95f4\u5f7c\u6b64\u975e\u5e38\u63a5\u8fd1\uff0c\u5e76\u4e14\u5dee\u5f02\u4e3b\u8981\u5728\u9ad8\u767e\u5206\u4f4d\u5904\u53ef\u89c1\uff08&gt;= p90\uff09\u3002 256 \u548c 512 MB \u7684\u51b7\u542f\u52a8\u65f6\u95f4\u76f8\u5f53\u957f\uff0c\u4ece 768 MB \u5f00\u59cb\uff0c\u901a\u8fc7\u4e3a Lambda \u63d0\u4f9b\u66f4\u591a\u5185\u5b58\uff0c\u51b7\u542f\u52a8\u65f6\u95f4\u53ea\u4f1a\u7a0d\u5fae\u51cf\u5c11\u4e00\u70b9\uff0c\u800c\u5bf9\u4e8e\u5927\u4e8e 1024 MB \u7684\u5185\u5b58\u6ca1\u6709\u4efb\u4f55\u660e\u663e\u5dee\u5f02\u3002 \u6839\u636e\u60a8\u7684\u6027\u80fd\u8981\u6c42\uff0c\u60a8\u53ef\u4ee5\u4e3a Lambda \u63d0\u4f9b\u5c11\u4e8e 1024 MB \u7684\u5185\u5b58\uff08\u6b63\u5982\u6211\u4eec\u6700\u521d\u5728\u793a\u4f8b\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7ed9\u51fa\u7684\u90a3\u6837\uff09\uff0c\u5e76\u4e14\u4f7f\u7528 768 MB \u751a\u81f3\u66f4\u5c11\u7684\u5185\u5b58\u53ef\u4ee5\u83b7\u5f97\u975e\u5e38\u597d\u7684\u6027\u4ef7\u6bd4\u3002<\/p>\n<p>\u5728\u53d1\u5e03\u65f6\uff0c\u8fd8\u63d0\u4f9b\u4e86\u8f83\u65b0\u7684\u7248\u672c\uff08\u4f8b\u5982 GraalVM 23 \u8fd0\u884c\u65f6\uff09\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u6309\u7167\u672c\u7cfb\u5217\u7b2c 2 \u90e8\u5206\u4e2d\u7684\u8bf4\u660e\u8fdb\u884c\u7248\u672c\u66f4\u6539\u5e76\u91cd\u65b0\u7f16\u8bd1 GraalVM Native \u6620\u50cf\uff0c\u5e76\u91cd\u65b0\u6d4b\u91cf\u6027\u80fd.<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5e26\u6709 GraalVM Native Image \u7684 Lambda \u51fd\u6570 &#8211; \u4f7f\u7528\u4e0d\u540c\u7684 Lambda \u5185\u5b58\u8bbe\u7f6e\u90e8\u5206\u7f13\u89e3\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7ecd \u5728\u6211\u4eec\u7684\u6587\u7ae0\u7cfb\u5217\u7684\u7b2c 2 \u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u63a2\u7d22\u4e86\u5982\u4f55\u4f7f\u7528\u5305\u542b GraalVM 21 \u8fd0\u884c\u65f6\u7684 GraalVM Native Image \u7684\u81ea\u5b9a\u4e49\u8fd0\u884c\u65f6\u6765\u5f00\u53d1\u548c\u90e8\u7f72\u7eaf Lambda \u51fd\u6570\uff08\u4e0d\u4f7f\u7528 Spring Boot 3 \u7b49\u4efb\u4f55\u6846\u67b6\uff09\uff0c\u5728\u7b2c 3 \u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u6d4b\u91cf\u4e86\u4f7f\u7528\u6b64\u65b9\u6cd5\u4f7f\u7528 1024 MB \u5185\u5b58\u7684 Lambda \u51fd\u6570\u7684\u6027\u80fd\uff08\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\u65f6\u95f4\uff09\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 256 \u5230 1536 MB \u4e4b\u95f4\u7684\u4e0d\u540c\u5185\u5b58\u8bbe\u7f6e\u6765\u6d4b\u91cf Lambda \u7684\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8\uff0c\u4ee5\u63a2\u7d22\u6210\u672c\u548c\u6027\u80fd\u4e4b\u95f4\u7684\u6743\u8861\u3002 \u4f7f\u7528\u5305\u542b\u5177\u6709\u4e0d\u540c\u5185\u5b58\u8bbe\u7f6e\u7684 GraalVM \u672c\u673a\u6620\u50cf\u7684\u81ea\u5b9a\u4e49\u8fd0\u884c\u65f6\u6d4b\u91cf Lambda \u51fd\u6570\u7684\u51b7\u542f\u52a8\u548c\u70ed\u542f\u52a8 \u6211\u4eec\u5c06\u91cd\u590d\u4f7f\u7528\u672c\u7cfb\u5217\u6587\u7ae0\u7b2c 3 \u90e8\u5206\u4e2d\u63cf\u8ff0\u7684\u5b8c\u5168\u76f8\u540c\u7684\u5b9e\u9a8c\uff0c\u4f46\u5185\u5b58\u8bbe\u7f6e\u5728 256 \u5230 1536 MB \u4e4b\u95f4\u3002 \u4ee5\u4e0b\u662f\u5b9e\u9a8c\u7ed3\u679c\uff1a \u51b7 (c) \u548c\u6696 (m) \u5f00\u59cb\u65f6\u95f4\uff08\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\uff09\uff1a Memory setting c p50 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-35861","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/35861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=35861"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/35861\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=35861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=35861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=35861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}