{"id":15008793,"url":"https://github.com/aliyun/alibabacloud-kms-python2-sdk","last_synced_at":"2025-04-09T16:22:29.383Z","repository":{"id":66081440,"uuid":"598969418","full_name":"aliyun/alibabacloud-kms-python2-sdk","owner":"aliyun","description":"Alibaba Cloud KMS SDK for Python2 can help Python developers to use the KMS.","archived":false,"fork":false,"pushed_at":"2024-01-26T11:34:13.000Z","size":96,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T16:18:44.613Z","etag":null,"topics":["aliyun","dedicated-kms","dkms","kms","python2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliyun.png","metadata":{"files":{"readme":"README-benchmark.rst","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-08T07:11:38.000Z","updated_at":"2023-04-11T16:09:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"897d419b-c348-4a3e-92be-776bac6c0d85","html_url":"https://github.com/aliyun/alibabacloud-kms-python2-sdk","commit_stats":{"total_commits":10,"total_committers":5,"mean_commits":2.0,"dds":0.6,"last_synced_commit":"b3abd1634fdf9ae752c329d59c7d6eb46d5924d3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Falibabacloud-kms-python2-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Falibabacloud-kms-python2-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Falibabacloud-kms-python2-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Falibabacloud-kms-python2-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliyun","download_url":"https://codeload.github.com/aliyun/alibabacloud-kms-python2-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065491,"owners_count":21041909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aliyun","dedicated-kms","dkms","kms","python2"],"created_at":"2024-09-24T19:20:34.688Z","updated_at":"2025-04-09T16:22:29.350Z","avatar_url":"https://github.com/aliyun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pressure Measurement Tools\n==========================\n\nThe pressure measurement tools could be used to test KMS instance\nperformance.\n\nCompile\n-------\n\nLogin to a Linux ECS instance, the ECS can access the KMS instance.\n\n-  1.Install requirement packages\n\n.. code:: shell\n\n   $ pip install alibabacloud-kms-python2-sdk\n\n-  2.Download tools code\n\n.. code:: shell\n\n   $ git clone https://github.com/aliyun/alibabacloud-kms-python2-sdk.git\n\nUsage\n-----\n\n-  1.Go to the project directory named benchmarks.\n\n.. code:: shell\n\n   $ cd alibabacloud-kms-python2-sdk/benchmarks\n\n-  2.Execute the following command to test, command line parameters\n   refer to the following `configurable\n   parameters \u003c#configurable%20parameters\u003e`__.\n\nRuntime environment: KMS instance computing performance option is 2000,\nand the configuration of the pressure measurement clients may be 8\ncores*6.\n\nExample: Use the key specification Aliyun_AES_256 to perform encryption\noperation (encrypt) pressure test, the data size is 32 bytes, the number\nof threads is 32, and the pressure test duration is 600 seconds. The\ncommand is as follows:\n\n.. code:: shell\n\n   $ python benchmark.py --case=encrypt --client_key_file=./ClientKey_****.json --client_key_password=**** --endpoint=kst-****.cryptoservice.kms.aliyuncs.com --key_id=key-**** --data_size=32 --concurrence_nums=32 --duration=600 --log_path=./log\n\nConfigurable parameters\n-----------------------\n\n+---+-------------------------------------------------------------------+\n| N | Description                                                       |\n| a |                                                                   |\n| m |                                                                   |\n| e |                                                                   |\n+===+===================================================================+\n| c | Test case name, currently supported test case names are as        |\n| a | follows: encrypt: encryption operation, call the Encrypt decrypt: |\n| s | decryption operation, call the Decrypt sign: signature operation, |\n| e | call the Sign verify: verification operation, call the Verify     |\n|   | get_secret_value: to obtain the secret value operation, call the  |\n|   | GetSecretValue                                                    |\n+---+-------------------------------------------------------------------+\n| e | KMS instance endpoint                                             |\n| n |                                                                   |\n| d |                                                                   |\n| p |                                                                   |\n| o |                                                                   |\n| i |                                                                   |\n| n |                                                                   |\n| t |                                                                   |\n+---+-------------------------------------------------------------------+\n| c | the file path of Client Key                                       |\n| l |                                                                   |\n| i |                                                                   |\n| e |                                                                   |\n| n |                                                                   |\n| t |                                                                   |\n| _ |                                                                   |\n| k |                                                                   |\n| e |                                                                   |\n| y |                                                                   |\n| _ |                                                                   |\n| p |                                                                   |\n| a |                                                                   |\n| t |                                                                   |\n| h |                                                                   |\n+---+-------------------------------------------------------------------+\n| c | the password of Client Key                                        |\n| l |                                                                   |\n| i |                                                                   |\n| e |                                                                   |\n| n |                                                                   |\n| t |                                                                   |\n| _ |                                                                   |\n| k |                                                                   |\n| e |                                                                   |\n| y |                                                                   |\n| _ |                                                                   |\n| p |                                                                   |\n| a |                                                                   |\n| s |                                                                   |\n| s |                                                                   |\n| w |                                                                   |\n| o |                                                                   |\n| r |                                                                   |\n| d |                                                                   |\n+---+-------------------------------------------------------------------+\n| c | concurrence goroutines number, default 32                         |\n| o |                                                                   |\n| n |                                                                   |\n| c |                                                                   |\n| u |                                                                   |\n| r |                                                                   |\n| r |                                                                   |\n| e |                                                                   |\n| n |                                                                   |\n| c |                                                                   |\n| e |                                                                   |\n| _ |                                                                   |\n| n |                                                                   |\n| u |                                                                   |\n| m |                                                                   |\n| s |                                                                   |\n+---+-------------------------------------------------------------------+\n| d | testing duration,default 600s                                     |\n| u |                                                                   |\n| r |                                                                   |\n| a |                                                                   |\n| t |                                                                   |\n| i |                                                                   |\n| o |                                                                   |\n| n |                                                                   |\n+---+-------------------------------------------------------------------+\n| p | The result output period, default 1 per second                    |\n| e |                                                                   |\n| r |                                                                   |\n| i |                                                                   |\n| o |                                                                   |\n| d |                                                                   |\n+---+-------------------------------------------------------------------+\n| l | Log output path, if this parameter is not configured, output to   |\n| o | the console                                                       |\n| g |                                                                   |\n| _ |                                                                   |\n| p |                                                                   |\n| a |                                                                   |\n| t |                                                                   |\n| h |                                                                   |\n+---+-------------------------------------------------------------------+\n| k | The kms cmk id, which needs to be set for the encrypt and decrypt |\n| e | test, and ignored for the get secret value test                   |\n| y |                                                                   |\n| _ |                                                                   |\n| i |                                                                   |\n| d |                                                                   |\n+---+-------------------------------------------------------------------+\n| d | Test data size, unit byte, default 32                             |\n| a |                                                                   |\n| t |                                                                   |\n| a |                                                                   |\n| _ |                                                                   |\n| s |                                                                   |\n| i |                                                                   |\n| z |                                                                   |\n| e |                                                                   |\n+---+-------------------------------------------------------------------+\n| s | Secret name, which needs to be set for get secret value test, and |\n| e | ignored for the encrypt and decrypt test                          |\n| c |                                                                   |\n| r |                                                                   |\n| e |                                                                   |\n| t |                                                                   |\n| _ |                                                                   |\n| n |                                                                   |\n| a |                                                                   |\n| m |                                                                   |\n| e |                                                                   |\n+---+-------------------------------------------------------------------+\n| c | the path of CA certificate , Ignore verifying the server          |\n| a | certificate by default                                            |\n| _ |                                                                   |\n| p |                                                                   |\n| a |                                                                   |\n| t |                                                                   |\n| h |                                                                   |\n+---+-------------------------------------------------------------------+\n\nTest case instructions:\n\n-  encrypt: test Encrypt api performance.\n\nExample: The data size is 32 bytes, the number of threads is 32, the\npressure test time is 600 seconds, and the output is output to the\nconsole.\n\n.. code:: shell\n\n   $ python benchmark.py --case=encrypt --client_key_file=./ClientKey_****.json --client_key_password=**** --endpoint=kst-****.cryptoservice.kms.aliyuncs.com --key_id=key-**** --data_size=32 --concurrence_nums=32 --duration=600\n\n-  decrypt: test Decrypt api performance.\n\nExample: The data size is 32 bytes, the number of threads is 32, the\npressure test time is 600 seconds, and the output is output to the\nconsole.\n\n.. code:: shell\n\n   $ python benchmark.py --case=decrypt --client_key_file=./ClientKey_****.json --client_key_password=**** --endpoint=kst-****.cryptoservice.kms.aliyuncs.com --key_id=key-**** --data_size=32 --concurrence_nums=32 --duration=600\n\n-  sign：test Sign api performance.\n\nExample: The data size is 32 bytes, the number of threads is 32, the\npressure test time is 600 seconds, and the output is output to the\nconsole.\n\n.. code:: shell\n\n   $ python benchmark.py --case=sgin --client_key_file=./ClientKey_****.json --client_key_password=**** --endpoint=kst-****.cryptoservice.kms.aliyuncs.com --key_id=key-**** --data_size=32 --concurrence_nums=32 --duration=600\n\n-  verify：test Verify api performance.\n\nExample: The data size is 32 bytes, the number of threads is 32, the\npressure test time is 600 seconds, and the output is output to the\nconsole.\n\n.. code:: shell\n\n   $ python benchmark.py --case=verify --client_key_file=./ClientKey_****.json --client_key_password=**** --endpoint=kst-****.cryptoservice.kms.aliyuncs.com --key_id=key-**** --data_size=32 --concurrence_nums=32 --duration=600\n\n-  get_secret_value：test GetSecretValue api performance.\n\nExample: The data size is 32 bytes, the number of threads is 32, the\npressure test time is 600 seconds, and the output is output to the\nconsole.\n\n.. code:: shell\n\n   $ python benchmark.py --case=get_secret_value --client_key_file=./ClientKey_****.json --client_key_password=**** --endpoint=kst-****.cryptoservice.kms.aliyuncs.com --secret_name=**** --data_size=32 --concurrence_nums=32 --duration=600\n\nReference configuration parameters for different performances of KMS instances\n------------------------------------------------------------------------------\n\n+--------------+-------------+------------+--------+---+-------+----+\n| Computing    | Client      | Client     | Key    | c | c     | d  |\n| Performance  | Machine     | Machine    | S      | a | oncur | at |\n| Options      | Co          | Load(%CPU) | pecifi | s | rence | a_ |\n|              | nfiguration |            | cation | e | _nums | si |\n|              |             |            |        |   |       | ze |\n+==============+=============+============+========+===+=======+====+\n| 2000         | 8 cores \\*  | 85         | Al     | e | 32    | 32 |\n|              | 6           |            | iyun_A | n |       |    |\n|              |             |            | ES_256 | c |       |    |\n|              |             |            |        | r |       |    |\n|              |             |            |        | y |       |    |\n|              |             |            |        | p |       |    |\n|              |             |            |        | t |       |    |\n+--------------+-------------+------------+--------+---+-------+----+\n| 3000         | 8 cores \\*  | 85         | Al     | e | 32(Si | 32 |\n|              | 8           |            | iyun_A | n | ngle) |    |\n|              |             |            | ES_256 | c |       |    |\n|              |             |            |        | r |       |    |\n|              |             |            |        | y |       |    |\n|              |             |            |        | p |       |    |\n|              |             |            |        | t |       |    |\n+--------------+-------------+------------+--------+---+-------+----+\n| 4000         | 16 cores \\* | 85         | Al     | e | 64    | 32 |\n|              | 6           |            | iyun_A | n |       |    |\n|              |             |            | ES_256 | c |       |    |\n|              |             |            |        | r |       |    |\n|              |             |            |        | y |       |    |\n|              |             |            |        | p |       |    |\n|              |             |            |        | t |       |    |\n+--------------+-------------+------------+--------+---+-------+----+\n| 6000         | 16 cores \\* | 85         | Al     | e | 64(Si | 32 |\n|              | 8           |            | iyun_A | n | ngle) |    |\n|              |             |            | ES_256 | c |       |    |\n|              |             |            |        | r |       |    |\n|              |             |            |        | y |       |    |\n|              |             |            |        | p |       |    |\n|              |             |            |        | t |       |    |\n+--------------+-------------+------------+--------+---+-------+----+\n| 8000         | 16 cores \\* | 85         | Al     | e | 64(Si | 32 |\n|              | 8           |            | iyun_A | n | ngle) |    |\n|              |             |            | ES_256 | c |       |    |\n|              |             |            |        | r |       |    |\n|              |             |            |        | y |       |    |\n|              |             |            |        | p |       |    |\n|              |             |            |        | t |       |    |\n+--------------+-------------+------------+--------+---+-------+----+\n\nDescription of configuration options:\n\n-  Client machine load: The CPU usage of the client machine is\n   recommended to be 85%.\n\n-  Concurrency nums: The recommended 32 for 8-core machines. If the\n   performance of the pressure test cannot meet expectations under this\n   concurrency, you can appropriately increase the client machine\n   configuration, and then increase the concurrency.\n\n-  Data size: The recommended data size is 32. The larger the data, the\n   lower the pressure measurement performance.\n\n-  If the business side calls the SDK for stress testing and the number\n   of connections continues to increase, you can set MaxIdleConns to be\n   the same as the number of concurrent connections.\n\nResult output\n-------------\n\n.. code:: text\n\n   2023-10-20 15:18:32,321 - report_log - INFO - ----------------- Time_49: [2023-10-20 15:18:32]--------------\n   2023-10-20 15:18:32,321 - report_log - INFO - [Benchmark-Detail]        RequestCount: 76205     ResponseCount: 76192    TPS: 1528       AvgTPS: 1532\n   MaxOnceTimeCost: 130 ms MinOnceTimeCost: 0 ms   AvgOnceTimeCost: 13 ms\n   ClientErrorCount: 0     LimitExceededErrorCount: 0      TimeoutErrorCount: 0\n   2023-10-20 15:18:32,599 - report_log - INFO - ----------------- Statistics: [2023-10-20 15:18:32]--------------\n   2023-10-20 15:18:32,599 - report_log - INFO - [Benchmark-Detail]        RequestCount: 76586     ResponseCount: 76586    AvgTPS: 1531\n   MaxOnceTimeCost: 130 ms MinOnceTimeCost: 0 ms   AvgOnceTimeCost: 13 ms\n   ClientErrorCount: 0     LimitExceededErrorCount: 0      TimeoutErrorCount: 0\n\nExplanation of output parameters:\n\nRequestCount: total number of requests\n\nResponseCount: total number of responses\n\nTPS：transactions per second\n\nAvgTPS：average transactions per second\n\nMaxOnceTimeCost：maximum time spent on a single request\n\nMinOnceTimeCost：minimum time spent on a single request\n\nAvgOnceTimeCost：average time spent on a single request\n\nClientErrorCount：client error count\n\nLimitExceededErrorCount：limit exceeded error count\n\nTimeoutErrorCount：timeout error count\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Falibabacloud-kms-python2-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliyun%2Falibabacloud-kms-python2-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Falibabacloud-kms-python2-sdk/lists"}