{"id":45311311,"url":"https://github.com/chatwork/aws-lambda-runtime-benchmarks","last_synced_at":"2026-02-21T07:23:31.212Z","repository":{"id":46579178,"uuid":"411079314","full_name":"chatwork/aws-lambda-runtime-benchmarks","owner":"chatwork","description":"AWS Lambda ランタイムを比較する実験","archived":false,"fork":false,"pushed_at":"2024-02-27T07:03:55.000Z","size":314,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-05T19:52:09.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chatwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-28T00:04:51.000Z","updated_at":"2022-05-13T09:37:03.000Z","dependencies_parsed_at":"2022-07-20T06:32:35.132Z","dependency_job_id":null,"html_url":"https://github.com/chatwork/aws-lambda-runtime-benchmarks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chatwork/aws-lambda-runtime-benchmarks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Faws-lambda-runtime-benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Faws-lambda-runtime-benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Faws-lambda-runtime-benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Faws-lambda-runtime-benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chatwork","download_url":"https://codeload.github.com/chatwork/aws-lambda-runtime-benchmarks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Faws-lambda-runtime-benchmarks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-21T07:23:30.687Z","updated_at":"2026-02-21T07:23:31.203Z","avatar_url":"https://github.com/chatwork.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-lambda-runtime-benchmarks\n\nAWS Lambda の各ランタイムを比較するためのデモコードです。\n\n- `benchmark-tool` ディレクトリには、 Lambda 関数として実装した簡易ベンチマーク用ツールがあります。Lambda 関数にリクエストを投げて、CloudWatch Logs から性能を収集します。。\n- `test-events` ディレクトリには、↑のベンチマークツールで使う（後述）テストイベントJSONが格納してあります。\n- `terraform` ディレクトリには、Lambda 関数からアクセスする DynamoDB テーブルをセットアップする terraform があります。\n- その他の `java` や `python` などのディレクトリには、各ランタイムでの Lambda 関数と Serverless Framework の設定が入っています。\n\n## 前提\n\n- AWS リージョンは ap-northeast-1 を利用します。\n- ap-northeast-1 に `TestRuntimeBenchmark` という名前の DynamoDB テーブルを作成しておいてください。\n    - `S` 型の `pk` という名前のハッシュキー、`S` 型の `sk` という名前のレンジキーが必要です。\n- 以下をインストールしておいてください。 \n    - Node.js 12 以上 \n    - (Pythonプロジェクトを試すなら）Python 3 \n    - (Java、Scalaプロジェクトを試すなら）Java 11、[sbt](https://www.scala-sbt.org/1.x/docs/ja/Setup.html)\n    - (Rust プロジェクトを試すなら）[rustup](https://doc.rust-lang.org/cargo/getting-started/installation.html)\n    - (Terraform で環境を構築するなら）[Terraform](https://www.terraform.io/)\n\n## テスト用 DynamoDB テーブルの作成\n\n今回の Lambda 関数は、ap-northeast-1 にある `TestRuntimeBenchmark` という名前の DynamoDB テーブルに接続します。\n`S` 型の `pk` という名前のハッシュキー、`S` 型の `sk` という名前のレンジキーが必要です。\nまたテスト用データには、キー属性に加えて、`S` 型 の `attr1`、`attr2`、`attr3`、`attr4` という属性が必要です。\n\nこのテスト用テーブルの作成とテスト用初期データの構築は、Terraform を使って以下で行なえます。\n\n1. `terraform` ディレクトリに移動する。\n2. `terraform init` で初期化する。\n3. `terraform apply` でプロビジョニングする。\n4. 使い終わったら `terraform destroy` で削除する。\n\n## 各サンプルプロジェクトのデプロイ方法\n\n1. 各サンプルプロジェクトのディレクトリに移動します。例えば `java/sdk/` です。\n2. 各種ライブラリをインストールするため、`npm install` を実行します。\n3. Lambda 関数をプロビジョニングするため、`npm run deploy` を実行します。\n4. 関数を使い終わってもう不要になったら `npm run remove` を実行します。\n\n## benchmark-tool の利用方法\n\n1. `benchmark-tool` に移動します。\n2. 各種ライブラリをインストールするため、`npm install` を実行します。\n3. Lambda 関数をプロビジョニングするため、`npm run deploy` を実行します。\n4. Web ブラウザで AWS Lambda コンソールを開きます。\n5. デプロイしたベンチマーク用 Lambda関数（例えば `RuntimeBenchmark-TypeScript-Bench-dev-benchmark`）のテストコンソールを開きます。\n6. テストイベントとして、以下のような JSON を作成し、テスト実行します。\n    ```json5\n    {\n      \"FunctionName\": \"RuntimeBenchmark-TypeScript-SDK-dev-getItem\",\n      \"Concurrency\": \"100\",\n      \"PayloadJson\": { \n          /* PayloadJson の中身は test-events ディレクトリから取得します */\n         \"rawPath\": \"/getItem\",\n         \"queryStringParameters\": {\n               \"pk\": \"1\",\n               \"sk\": \"1\"\n         },\n         ...\n      }\n    }\n    ```\n   - `FunctionName`: Lambda 関数名。ARN ではありません。\n   - `Concurrency`: Lambda の並列実行を試みる回数。通常、100〜200くらいを指定します。\n   - `PayLoadJson`: 指定した関数に与える JSON オブジェクト。\n7. テスト結果は JSON 形式で、指定された Lambda について、次の測定結果を含みます。\n    - `count.initDurations`: コールドスタートした回数 \n    - `count.durations`: 実際の処理を行った回数 \n    - `durations.initDurations`: コールドスタートにかかった時間（ミリ秒）\n    - `durations.durations`: 実際の処理にかかった時間（ミリ秒）\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatwork%2Faws-lambda-runtime-benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchatwork%2Faws-lambda-runtime-benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatwork%2Faws-lambda-runtime-benchmarks/lists"}