{"componentChunkName":"component---src-templates-blog-detail-tsx","path":"/blog/2019-12-10-resource-cost","result":{"data":{"currentBlog":{"id":"1e54dd30-fe20-593b-952b-869b890aced3","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020114/1579000616928-HEAD.png","authors":["Anycodes"],"categories":["guides-and-tutorials"],"date":"2019-12-10T00:00:00.000Z","title":"Serverless 的资源评估与成本探索","description":"本文介绍了使用 Serverless 架构布局业务时，需要关注的资源和费用","authorslink":["https://www.zhihu.com/people/liuyu-43-97"],"translators":null,"translatorslink":null,"tags":["资源成本","Serverless"],"keywords":"Serverless 架构,Serverless 布局业务,Serverless 资源评估","outdated":null},"wordCount":{"words":341,"sentences":66,"paragraphs":66},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-12-10-resource-cost.md","fields":{"slug":"/blog/2019-12-10-resource-cost/","keywords":["serverless","云函数","内存","serverlesscloud"]},"html":"<p>Serverless 布道师在讲解 Serverless 架构和云主机等区别的时候，总会有类似的描述：</p>\n<blockquote>\n<p>传统业务开发完成想要上线，需要评估资源使用。根据评估结果，购买云主机，并且需要根据业务的发展不断对主机等资源进行升级维。而 Serverless 架构，则不需要这样复杂的流程，只需要将函数部署到线上，一切后端服务交给运营商来处理。即使是瞬时高并发，也有云厂商为您自动扩缩。</p>\n</blockquote>\n<p>但是在实际生产中，Serverless 真的无需评估资源么？还是说在 Serverless 架构下，资源评估的内容、对象发生了变化，或者简化呢？</p>\n<p>在 <a href=\"https://cloud.tencent.com/product/scf\">腾讯云云函数</a> 中，我们创建一个云函数之后，有这么几个设置项：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616830-HEAD.png\" alt=\"设置项\"></p>\n<p>内存设置范围为 64~1536M，超时时间范围为 1~900s。这些设置项其实已经涉及到了资源评估。</p>\n<h2 id=\"超时时间\"><a href=\"#%E8%B6%85%E6%97%B6%E6%97%B6%E9%97%B4\" aria-label=\"超时时间 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>超时时间</h2>\n<p>先说超时时间，一个项目或者一个函数，一个 Action 都是有执行时间的。如果超过某个时间没执行完，就可以评估其为发生了「意外」，可以被「干掉」了，这个就是超时时间。</p>\n<p>例如一个获取用户信息的简单请求，假设 10s 内没有返回，证明已经不满足业务需求，此时就可以将超时设置为 10s。如果有另一个业务，运行速度比较慢，至少要 50s 才能执行完，那么这个值的设置就要大于 50，否则程序可能因为超时被强行停止。</p>\n<h2 id=\"内存\"><a href=\"#%E5%86%85%E5%AD%98\" aria-label=\"内存 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>内存</h2>\n<p>内存是一个有趣的东西，可能衍生两个关联点。</p>\n<h3 id=\"关联点-1：\"><a href=\"#%E5%85%B3%E8%81%94%E7%82%B9-1%EF%BC%9A\" aria-label=\"关联点 1： permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>关联点 1：</strong></h3>\n<p><strong>程序本身需要一定的内存，这个内存要大于程序本身的内存。</strong></p>\n<p>以 Python 语言为例：</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\"># encoding=utf-8\nimport jieba\ndef main_handler(event, context):\n\n    jieba.load_userdict(&quot;./jieba/dict.txt&quot;)\n    seg_list = jieba.cut(&quot;我来到北京清华大学&quot;, cut_all=True)\n    print(&quot;Full Mode: &quot; + &quot;/ &quot;.join(seg_list))  # 全模式\n\n    seg_list = jieba.cut(&quot;我来到北京清华大学&quot;, cut_all=False)\n    print(&quot;Default Mode: &quot; + &quot;/ &quot;.join(seg_list))  # 精确模式\n\n    seg_list = jieba.cut(&quot;他来到了网易杭研大厦&quot;)  # 默认是精确模式\n    print(&quot;, &quot;.join(seg_list))\n\n    seg_list = jieba.cut_for_search(&quot;小明硕士毕业于中国科学院计算所，后在日本京都大学深造&quot;)  # 搜索引擎模式\n    print(&quot;, &quot;.join(seg_list))</code></pre></div>\n<blockquote>\n<p>注：为了让结果更直观，差距更加大，这里每次都重新导入了自带了 dict，该操作本身就是相对浪费时间和内存的。在实际使用中 jieba 自带缓存，并且无需手动导入本身的 dict。</p>\n</blockquote>\n<p>当导入一个自定义的 dict 到 jieba 中，如果此时用默认设置：128M 内存限制 + 3s 超时限制，就会这样：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616832-HEAD.png\" alt=\"结果\"></p>\n<p>可以看到，在导入自定义 dict 的时候，内存消耗过大， 默认值 128M 不能满足需求，此时将其修改成最大：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616751-HEAD.png\" alt=\"修改为最大值\"></p>\n<p>系统提醒时间超时，因此还需要再修改超时时间为适当的数值（此处设定为10s）：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616750-HEAD.png\" alt=\"时间设置\"></p>\n<p>因此，在关注程序本身的前提下，内存需要设置到一个合理范围内。这个范围是 >= 程序本身需要的内存数值。</p>\n<h3 id=\"关联点-2：计费相关。\"><a href=\"#%E5%85%B3%E8%81%94%E7%82%B9-2%EF%BC%9A%E8%AE%A1%E8%B4%B9%E7%9B%B8%E5%85%B3%E3%80%82\" aria-label=\"关联点 2：计费相关。 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>关联点 2：计费相关。</h3>\n<p>在云函数的 <a href=\"https://cloud.tencent.com/document/product/583/12284\">计费文档</a> 中，有如下描述：</p>\n<blockquote>\n<p>云函数 SCF 按照实际使用付费，采用后付费小时结，以<strong>元</strong>为单位进行结算。\nSCF 账单由以下三部分组成，每部分根据自身统计结果和计算方式进行费用计算，结果以<strong>元</strong>为单位，并保留小数点后两位。</p>\n<ul>\n<li>资源使用费用</li>\n<li>调用次数费用</li>\n<li>外网出流量费用</li>\n</ul>\n</blockquote>\n<p>调用次数和出网流量这部分，都是程序或者使用相关了，而资源使用费用则有一些注意点：</p>\n<blockquote>\n<p><strong>资源使用量 = 函数配置内存 × 运行时长</strong>\n用户资源使用量，由函数配置内存，乘以函数运行时的计费时长得出。其中配置内存转换为 GB 单位，计费时长由毫秒 (ms) 转换为秒 (s) 单位，因此，资源使用量的计算单位为 <strong>GBs</strong>（GB-秒）。\n例如，配置为 256MB 的函数，单次运行了 1760 ms，计费时长为 1760 ms，则单次运行的资源使用量为（256/1024）×（1760/1000） = 0.44 GBs。\n针对函数的每次运行，均会计算资源使用量，并按小时汇总求和，作为该小时的资源使用量。</p>\n</blockquote>\n<p>这里有一个非常重要的公式，那就是<strong>函数配置内存运行时长。</strong></p>\n<p>函数配置内存就是刚才所讲：我们为程序选择的内存大小。运行时长，就是我们运行程序之后得到的结果：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616731-HEAD.png\" alt=\"计费时间\"></p>\n<p>以该程序为例，用的是1536MB，则使用量为 (1536/1024) * (3200/1000) = 4.8 GBs</p>\n<p>当然，250MB 的情况下，程序也可以运行：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616706-HEAD.png\" alt=\"250M\"></p>\n<p>此时的资源使用量为 (256/1024) * (3400/1000) = 0.85GBs</p>\n<p>相对比上一次，程序执行时间增加了 0.2s，但是资源使用量降低了将近 6 倍！</p>\n<p>尽管 GBs 的单价很低，但是当业务量上来之后，也不能忽略。刚才的只是一个单次请求，如果每天有 1000 此次请求，那：</p>\n<ul>\n<li>1536 MB： 4.8<em>1000</em>0.00011108 = 0.5 元</li>\n<li>25 MB：0.85<em>1000</em>0.00011108 = 0.09442 元</li>\n</ul>\n<blockquote>\n<p>仅计算资源使用量费用，而不计算调用次数/外网流量）</p>\n</blockquote>\n<p>如果是一万次调用，那就是 50 元和 9 元的区别。随着流量越大，差距越大。</p>\n<p>当然很多时候函数执行时间不会这么久，以个人的某函数为例：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000958286-v2-e049b3aa60ad1f690b83067bd35f19ef_hd.png\" alt=\"一个例子\"></p>\n<p>计费时间均是 100ms，每日调用量在 6000 次左右：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616632-HEAD.png\" alt=\"详细数据\"></p>\n<p>按照 64M 内存来看，单资源费用只要 76 元一年，如果内存都设置称为 1536，则一年要 1824 元！这个费用相当于：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616595-HEAD.png\" alt=\"等效费用\"></p>\n<p>所以说，「超时时间」的设置需要评估代码和业务场景，它关系到程序运行的稳定性和功能完整性。同时，「内存」也不仅仅影响程序的使用层面，还关乎费用成本。那么，既然资源评估如此重要，如何评估呢？</p>\n<p>还是以上述代码为例，在本地进行简单的脚本编写：</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">from tencentcloud.common import credential\nfrom tencentcloud.common.profile.client_profile import ClientProfile\nfrom tencentcloud.common.profile.http_profile import HttpProfile\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.scf.v20180416 import scf_client, models\n\nimport json\nimport numpy\nimport matplotlib.pyplot as plt\n\ntry:\n    cred = credential.Credential(&quot;&quot;, &quot;&quot;)\n    httpProfile = HttpProfile()\n    httpProfile.endpoint = &quot;scf.tencentcloudapi.com&quot;\n\n    clientProfile = ClientProfile()\n    clientProfile.httpProfile = httpProfile\n    client = scf_client.ScfClient(cred, &quot;ap-shanghai&quot;, clientProfile)\n\n    req = models.InvokeRequest()\n    params = &#39;{&quot;FunctionName&quot;:&quot;hello_world_2&quot;}&#39;\n    req.from_json_string(params)\n\n    billTimeList = []\n    timeList = []\n    for i in range(1,50):\n        print(&quot;times: &quot;, i)\n        resp = json.loads(client.Invoke(req).to_json_string())\n        billTimeList.append(resp[&#39;Result&#39;][&#39;BillDuration&#39;])\n        timeList.append(resp[&#39;Result&#39;][&#39;Duration&#39;])\n\n    print(&quot;计费最大时间&quot;, int(max(billTimeList)))\n    print(&quot;计费最小时间&quot;, int(min(billTimeList)))\n    print(&quot;计费平均时间&quot;, int(numpy.mean(billTimeList)))\n\n    print(&quot;运行最大时间&quot;, int(max(timeList)))\n    print(&quot;运行最小时间&quot;, int(min(timeList)))\n    print(&quot;运行平均时间&quot;, int(numpy.mean(timeList)))\n\n    plt.figure()\n    plt.subplot(4, 1, 1)\n    x_data = range(0, len(billTimeList))\n    plt.plot(x_data, billTimeList)\n    plt.subplot(4, 1, 2)\n    plt.hist(billTimeList, bins=20)\n    plt.subplot(4, 1, 3)\n    x_data = range(0, len(timeList))\n    plt.plot(x_data, timeList)\n    plt.subplot(4, 1, 4)\n    plt.hist(timeList, bins=20)\n    plt.show()\n\nexcept TencentCloudSDKException as err:\n    print(err)</code></pre></div>\n<p>执行代码会得到这么一张图：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616608-HEAD.png\" alt=\"资源评估图\"></p>\n<p>从上到下分别是不同次数计费时间图、计费时间分布图、不同次数运行时间图和运行时间分布图。通过对 256M 起步，1536M 终止，步长 128M，每个内存大小串行靠用 50 次，统计表：</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616623-HEAD.png\" alt=\"统计表\"></p>\n<blockquote>\n<p>注：为了让统计结果更加清晰，差异性更大，在程序代码中进行了部分无用操作用来增加程序执行时间。正常使用 jieba 基本都是毫秒级的。</p>\n</blockquote>\n<p><img src=\"https://img.serverlesscloud.cn/2020114/1579000616594-HEAD.png\" alt=\"测试结果\"></p>\n<p>通过表统计可以看到，在满足程序内存消耗的前提下，内存大小对程序执行时间的影响并不是很大，反而对计费影响很大。</p>\n<h3 id=\"函数并发量\"><a href=\"#%E5%87%BD%E6%95%B0%E5%B9%B6%E5%8F%91%E9%87%8F\" aria-label=\"函数并发量 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>函数并发量</h3>\n<p>除了超时时间和运行内存，用户还需要评估一个参数：函数并发量。在项目上线之后，需要对项目的并发量进行评估。当并发量超过默认值，要及时联系售后同学或者提交工单进行最大并发量的提升。</p>\n<h2 id=\"小结\"><a href=\"#%E5%B0%8F%E7%BB%93\" aria-label=\"小结 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>小结</h2>\n<p>综上，Serverless 架构也是需要资源评估的，而且资源评估同样和成本是直接挂钩。只不过这个资源评估的对象逐渐发生了变化，相对之前的评估维度、难度而言，都是大幅度缩小或者降低的。</p>\n<blockquote>\n<p><strong>传送门：</strong></p>\n<ul>\n<li>GitHub: <a href=\"https://github.com/serverless/serverless/blob/master/README_CN.md\">github.com/serverless</a> </li>\n<li>官网：<a href=\"https://serverless.com/\">serverless.com</a></li>\n</ul>\n</blockquote>\n<p>欢迎访问：<a href=\"https://serverlesscloud.cn/\">Serverless 中文网</a>，您可以在 <a href=\"https://serverlesscloud.cn/best-practice\">最佳实践</a> 里体验更多关于 Serverless 应用的开发！</p>","tableOfContents":"<ul>\n<li><a href=\"/blog/2019-12-10-resource-cost/#%E8%B6%85%E6%97%B6%E6%97%B6%E9%97%B4\">超时时间</a></li>\n<li>\n<p><a href=\"/blog/2019-12-10-resource-cost/#%E5%86%85%E5%AD%98\">内存</a></p>\n<ul>\n<li><a href=\"/blog/2019-12-10-resource-cost/#%E5%85%B3%E8%81%94%E7%82%B9-1%EF%BC%9A\">关联点 1：</a></li>\n<li><a href=\"/blog/2019-12-10-resource-cost/#%E5%85%B3%E8%81%94%E7%82%B9-2%EF%BC%9A%E8%AE%A1%E8%B4%B9%E7%9B%B8%E5%85%B3%E3%80%82\">关联点 2：计费相关。</a></li>\n<li><a href=\"/blog/2019-12-10-resource-cost/#%E5%87%BD%E6%95%B0%E5%B9%B6%E5%8F%91%E9%87%8F\">函数并发量</a></li>\n</ul>\n</li>\n<li><a href=\"/blog/2019-12-10-resource-cost/#%E5%B0%8F%E7%BB%93\">小结</a></li>\n</ul>"},"previousBlog":{"id":"8d3e0a32-3028-5f67-b38e-9088a83b37ab","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020115/1579078112543-1577769064015-joshua-aragon-FGXqbqbGt5o-unsplash.jpg","authors":["Aceyclee"],"categories":["guides-and-tutorials"],"date":"2019-12-17T00:00:00.000Z","title":"使用 Serverless Framework，结合云函数 SCF、API 网关和云数据库 MySQL 构建 REST API","description":"本文介绍如何创建一个进行自动化面试评估的 Serverless 应用！","authorslink":["https://www.zhihu.com/people/Aceyclee"],"translators":null,"translatorslink":null,"tags":["Node.js","API 网关"],"keywords":"Serverless 自动化面试评估,Serverless 云数据库 MySQL,云函数 SCF","outdated":null},"wordCount":{"words":259,"sentences":62,"paragraphs":62},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-12-17-node-rest-api-with-serverless-scf-and-mongodb.md","fields":{"slug":"/blog/2019-12-17-node-rest-api-with-serverless-scf-and-mongodb/","keywords":["java","nodejs","serverless","无服务器","云函数","candidate","Serverless","serverless","dev","candidateSubmission","service"]}},"nextBlog":{"id":"b98a7315-e71b-560d-b061-b72ed78b121f","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/20191227/1577411056121-v2-a72ab46370bfdcd6d32b65b592ab4552_1200x500.jpg","authors":["jenswang"],"categories":["news"],"date":"2019-12-09T00:00:00.000Z","title":"深入浅出 Serverless：优势、意义与应用","description":"本文对 Serverless 的前瞻和落地应用进行了深入却易懂的诠释","authorslink":["https://www.zhihu.com/people/jenswang"],"translators":null,"translatorslink":null,"tags":["云计算","Serverless"],"keywords":"Serverless 优势,Serverless 意义,Serverless 应用","outdated":null},"wordCount":{"words":537,"sentences":56,"paragraphs":56},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-12-09-serverless-means-applications.md","fields":{"slug":"/blog/2019-12-09-serverless-means-applications/","keywords":["koa","serverless","无服务器","无服务器架构","云函数","Serverless","架构","业务","工程师","serverlesscloud","函数"]}},"recommendBlogs":{"edges":[{"node":{"id":"665f9ce2-4451-59fd-bf98-1861789d3b3b","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/Serverless_logo.png","authors":["AndreaPasswater"],"categories":["guides-and-tutorials","engineering-culture"],"date":"2018-03-19T00:00:00.000Z","title":"如何为无服务器开放源代码项目做贡献","description":"想要为无服务器开放源代码项目做贡献？您可以遵循下面的指南。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":96,"sentences":36,"paragraphs":36},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-03-19-how-contribute-to-serverless-open-source.md","fields":{"slug":"/blog/2018-03-19-how-contribute-to-serverless-open-source/","keywords":["serverless","无服务器","serverless","github","插件","服务器","贡献","示例","blog","contribute"]}}},{"node":{"id":"a3e92579-65c3-5159-937c-32d18c5df7d7","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/why-not/why-not-header.png","authors":["AndreaPasswater"],"categories":["guides-and-tutorials","operations-and-observability","engineering-culture"],"date":"2018-03-21T00:00:00.000Z","title":"不适合选择无服务器的情境及原因","description":"无服务器既有优点也有缺点。那么，哪些情境下不适合选择无服务器？原因又是什么呢？","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":163,"sentences":43,"paragraphs":43},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-03-21-when-why-not-use-serverless.md","fields":{"slug":"/blog/2018-03-21-when-why-not-use-serverless/","keywords":["faas","react","serverless","spa","无服务器","无服务器函数","无服务器架构","无服务器开发","服务器","twitter","serverless","blockquote","lang","script","en"]}}},{"node":{"id":"6a16520b-7886-582e-9182-64e50712d486","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/vendor+choice/serverless-data-portability.jpg","authors":["NickGottlieb"],"categories":["engineering-culture","guides-and-tutorials"],"date":"2018-06-20T00:00:00.000Z","title":"浅谈无服务器、数据锁定和供应商选择","description":"供应商选择是如今 IT 领导者需要考虑的最重要事项，而这一点可利用数据可移植性来实现。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":205,"sentences":33,"paragraphs":33},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-06-20-data-lockin-vendor-choice-portability.md","fields":{"slug":"/blog/2018-06-20-data-lockin-vendor-choice-portability/","keywords":["go","serverless","无服务器","无服务器架构","供应商","serverless","开发人员","数据","锁定","选择","服务"]}}},{"node":{"id":"94741abb-10ba-5db1-9756-cd1d573473fa","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/webstorm-ide/streamline-webstorm-serverless2.jpg","authors":["EslamHefnawy"],"categories":["guides-and-tutorials","engineering-culture"],"date":"2018-08-15T00:00:00.000Z","title":"如何使用 WebStorm 简化无服务器工作流程","description":"在本文中，我将和您分享如何使用 WebStorm 进行无服务器特定的 IDE 设置以及如何利用它来极大地加快无服务器工作流程。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":234,"sentences":54,"paragraphs":54},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-08-15-streamline-serverless-workflow-webstorm.md","fields":{"slug":"/blog/2018-08-15-streamline-serverless-workflow-webstorm/","keywords":["nodejs","serverless","无服务器","无服务器开发","serverless","WebStorm","webstorm","服务器","blog","assets"]}}},{"node":{"id":"713a0563-4bf9-5721-bacb-3b4ef609fe4a","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/camp-fire/camp-fire-housing-thumb.jpg","authors":["EricWyne"],"categories":["guides-and-tutorials","user-stories"],"date":"2018-12-05T00:00:00.000Z","title":"Serverless Twitter 机器人帮助为坎普山火受灾者安置住房","description":"加利福尼亚州的坎普山火致使数千人流离失所，为此，我构建了一个简单的 Serverless Twitter 机器人来帮助将受灾者安置在临时住房！","authorslink":["https://serverless.com/author/ericwyne/"],"translators":["Aceyclee"],"translatorslink":["zhihu.com/people/Aceyclee"],"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":157,"sentences":26,"paragraphs":26},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-12-05-serverless-twitter-camp-fire.md","fields":{"slug":"/blog/2018-12-05-serverless-twitter-camp-fire/","keywords":["serverless","无服务器","云函数","Serverless","org","住房","Twitter","函数","受灾","机器人","山火"]}}},{"node":{"id":"17c972d9-0583-51f6-9d5d-c2ba5f21b6a3","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/20191227/1577409288454-v2-577c2b21d600e3ea07f156f3e9d2d6b8_1200x500.jpg","authors":["Alfred Huang"],"categories":["guides-and-tutorials"],"date":"2019-08-21T00:00:00.000Z","title":"Serverless 的运行原理与组件架构","description":"本文重点探讨下开发者使用 Serverless 时经常遇到的一些问题，以及如何解决","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["运行原理","serverless"],"keywords":"Serverless 运行原理,Serverless 组件架构","outdated":null},"wordCount":{"words":236,"sentences":33,"paragraphs":33},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-08-21-serverless-operation-architecture.md","fields":{"slug":"/blog/2019-08-21-serverless-operation-architecture/","keywords":["koa","serverless","云函数","Serverless","用户","函数","请求","实例","形态","业务","serverlesscloud"]}}},{"node":{"id":"ae4fd2f8-515c-5aec-b584-38427ef33f7e","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020114/1578989800047-part-00492-780.jpg","authors":["Anycodes"],"categories":["guides-and-tutorials","user-stories"],"date":"2019-09-16T00:00:00.000Z","title":"突破传统 OJ 瓶颈，「判题姬」接入云函数","description":"通过 Serverless 实现在线编程","authorslink":["https://www.zhihu.com/people/liuyu-43-97"],"translators":null,"translatorslink":null,"tags":["在线编程","云函数"],"keywords":"Serverless 在线编程,Serverless OJ","outdated":null},"wordCount":{"words":169,"sentences":30,"paragraphs":30},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-09-16-online-Judge.md","fields":{"slug":"/blog/2019-09-16-online-Judge/","keywords":["python","serverless","云函数","代码","函数","serverless"]}}},{"node":{"id":"545ab3d2-e14e-5cc2-8548-0e863eac942b","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/2019-10-deployment-best-practices/safeguard-header.png","authors":["FernandoMedinaCorey"],"categories":["guides-and-tutorials"],"date":"2019-10-14T00:00:00.000Z","title":"无服务器部署最佳实践","description":"了解部署无服务器应用时的一些最佳实践。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":221,"sentences":46,"paragraphs":46},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-10-14-serverless-deployment-best-practices.md","fields":{"slug":"/blog/2019-10-14-serverless-deployment-best-practices/","keywords":["serverless","无服务器","serverless","部署","服务器","开发人员","应用","安全措施","使用","函数"]}}}],"totalCount":31}},"pageContext":{"isCreatedByStatefulCreatePages":false,"blogId":"1e54dd30-fe20-593b-952b-869b890aced3","previousBlogId":"8d3e0a32-3028-5f67-b38e-9088a83b37ab","nextBlogId":"b98a7315-e71b-560d-b061-b72ed78b121f","categories":["guides-and-tutorials"]}}}