{"id":10809,"date":"2024-01-19T11:01:23","date_gmt":"2024-01-19T03:01:23","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=10809"},"modified":"2024-12-18T15:16:13","modified_gmt":"2024-12-18T07:16:13","slug":"performance-of-turn-on-tls-or-not","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2024\/01\/performance-of-turn-on-tls-or-not\/","title":{"rendered":"\u542f\u7528TLS\u4f20\u8f93\u52a0\u5bc6\u5bf9\u6570\u636e\u5e93\u6027\u80fd\u7684\u5f71\u54cd"},"content":{"rendered":"\n<p>\u968f\u7740\u4e91\u6570\u636e\u5e93\u7684\u666e\u53ca\uff0c\u6570\u636e\u5e93\u7684\u4f20\u8f93\u52a0\u5bc6\u4e5f\u4f1a\u968f\u4e4b\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u672c\u6587\uff0c\u5c06\u4f7f\u7528\u901a\u7528\u6d4b\u8bd5\u6765\u770b\u770b\uff0c\u5f00\u542fTLS\u4f20\u8f93\u5bf9\u6570\u636e\u5e93\u7684\u6027\u80fd\u6709\u4ec0\u4e48\u6837\u7684\u5f71\u54cd\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u539f\u7406\u6982\u8ff0<\/h3>\n\n\n\n<p>\u5f00\u542fTLS\u4f20\u8f93\u52a0\u5bc6\u4e4b\u540e\uff0c\u5206\u522b\u4f1a\u5728\u5efa\u7acb\u8fde\u63a5\u3001\u6570\u636e\u4f20\u8f93\u4e24\u4e2a\u9636\u6bb5\u5bf9\u6027\u80fd\u9020\u6210\u5f71\u54cd\u3002\u56e0\u4e3a\u5efa\u7acb\u8fde\u63a5\u7684\u8fc7\u7a0b\u901a\u5e38\u662f\u4e00\u6b21\u6027\u7684\uff0c\u8fde\u63a5\u4f1a\u88ab\u590d\u7528\uff0c\u6240\u4ee5\u8fd9\u90e8\u5206\u7684\u6027\u80fd\u5f00\u9500\u901a\u5e38\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002\u5728\u4f20\u8f93\u9636\u6bb5\uff0c\u662f\u4f20\u8f93\u52a0\u5bc6\u5bf9\u6027\u80fd\u5f71\u54cd\u7684\u91cd\u8981\u9636\u6bb5\uff0c\u8fd9\u65f6\u5019\u901a\u5e38\u4f1a\u4f7f\u7528\u5bf9\u79f0\u52a0\u5bc6\u7b97\u6cd5\uff08\u4f8b\u5982AES256\uff09\u5bf9\u6570\u636e\u8fdb\u884c\u52a0\u5bc6\uff0c\u90a3\u4e48\u5b9e\u9645\u7684\u5bf9\u79f0\u52a0\u5bc6\u7684\u6027\u80fd\u5c31\u662f\u5bf9TLS\u4f20\u8f93\u52a0\u5bc6\u6027\u80fd\u5f71\u54cd\u6700\u5927\u7684\u90e8\u5206\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5e94\u7528\u4f7f\u7528\u7684\u662f\u77ed\u94fe\u63a5\uff08\u5e94\u8be5\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\uff09\uff0cTLS\u52a0\u5bc6\u7684\u5bc6\u94a5\u4ea4\u6362\u9636\u6bb5\u4e5f\u4f1a\u5bf9\u6bcf\u4e2a\u8fde\u63a5\u5efa\u7acb\u7684\u8fc7\u7a0b\u90fd\u6709\u4e00\u5b9a\u7684\u6027\u80fd\u5f71\u54cd\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u4e91\u6570\u636e\u5e93\u5b9e\u9645\u6d4b\u8bd5<\/h3>\n\n\n\n<p>\u8fd9\u91cc\u9009\u62e9\u5bf9RDS MySQL\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4e91\u5382\u5546\u5219\u5404\u81ea\u9009\u62e9\u56fd\u5916\u3001\u56fd\u5185Top 1\u7684\u4e91\u5382\u5546AWS\u548c\u963f\u91cc\u4e91\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.1 \u6d4b\u8bd5\u65b9\u6cd5\u8bf4\u660e<\/h4>\n\n\n\n<p>\u4f7f\u7528sysbench 1.1.0\u7248\u672c\uff0c\u6d4b\u8bd5\u7c7b\u578b\u4e3aoltp_read_write\uff0c\u76f8\u5173\u53c2\u6570\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8211;mysql-ssl=REQUIRED \u662f\u5426\u4f7f\u7528TLS\u52a0\u5bc6\u4f20\u8f93<\/li>\n\n\n\n<li>&#8211;percentile=95 \u5173\u6ce895%Query\u7684\u5ef6\u8fdf<\/li>\n\n\n\n<li>&#8211;histogram=on \u53ef\u4ee5\u67e5\u770b\u5ef6\u8fdf\u5206\u5e03\u60c5\u51b5<\/li>\n\n\n\n<li>&#8211;time=600 sysbench\u8fd0\u884c\u7684\u603b\u65f6\u95f4\uff08\u79d2\uff09<\/li>\n\n\n\n<li>&#8211;warmup-time=60 \u5f00\u59cb\u8ba1\u7b97\u6027\u80fd\u524d\u9884\u70ed\u65f6\u95f4\uff08\u79d2\uff09<\/li>\n\n\n\n<li>&#8211;table_size=1000000 \u5355\u8868100\u4e07\u6761\u8bb0\u5f55<\/li>\n\n\n\n<li>&#8211;tables=5 \u5171\u6d4b\u8bd55\u4e2a\u8868<\/li>\n<\/ul>\n\n\n\n<!--more-->\n\n\n\n<h4 class=\"wp-block-heading\">2.2 \u963f\u91cc\u4e91RDS MySQL<\/h4>\n\n\n\n<p>\u8fd9\u91cc\u9009\u62e9\u4e86mysql.x4.large.2c\u89c4\u683c\uff084c16\uff09\uff0cMySQL 5.7\u7248\u672c\uff0c50GB\u5b58\u50a8\uff0cIOPS 4300\uff0c\u4e3b\u5907\u5747\u5728\u540c\u4e00\u4e2a\u53ef\u7528\u533a\u3002<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u4e2d\uff0c\u770b\u5230\u6027\u80fd\u5f71\u54cd\u7ea6\u4e3a3.5%~6.5%\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"241\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-5.7-1024x241.png\" alt=\"\" class=\"wp-image-10810\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-5.7-1024x241.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-5.7-300x71.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-5.7-768x181.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-5.7-1536x361.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-5.7-2048x481.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.3 \u963f\u91cc\u4e91ECS\u81ea\u5efa\u6570\u636e\u5e93<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>MySQL Server\u7aef\u4f7f\u7528\u4e86\u89c4\u683cecs.g6e.xlarge(4c16g)<\/li>\n\n\n\n<li>OS\u4f7f\u7528\u7684\u662fAlibaba Cloud Linux 3.2104 LTS 64\u4f4d<\/li>\n\n\n\n<li>\u78c1\u76d8\u4f7f\u7528\u4e86 ESSD 50G PL1<\/li>\n\n\n\n<li>MySQL\u914d\u7f6e\u4e3a\uff1a\n<ul class=\"wp-block-list\">\n<li>sync_binlog 1000<\/li>\n\n\n\n<li>innodb_flush_log_at_trx_commit 2<\/li>\n\n\n\n<li>Buffer Pool\u4e3a12G<\/li>\n\n\n\n<li>\u5176\u4ed6\u5747\u4e3a\u9ed8\u8ba4\u914d\u7f6e<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u6d4b\u8bd5\u4e2d\uff0c\u770b\u5230\u6027\u80fd\u5f71\u54cd\u7ea6\u4e3a4.5%~7.5%\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"220\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-ecs-1024x220.png\" alt=\"\" class=\"wp-image-10811\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-ecs-1024x220.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-ecs-300x64.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-ecs-768x165.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-ecs-1536x330.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aliyun-ecs-2048x440.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.4 AWS RDS MySQL<\/h4>\n\n\n\n<p>AWS RDS\u89c4\u683c\u9009\u62e9\u4e86db.m5.xlarge\uff084c16g\uff09\uff0c\u591a\u53ef\u7528\u533a\u7248\u672c\uff0c8.0\u7248\u672c\uff0c100GB\u5b58\u50a8\uff0cProvisioned IOPS\u3002<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u4e2d\uff0c\u770b\u5230\u6027\u80fd\u5f71\u54cd\u7ea6\u4e3a1.5%~3%:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"240\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aws-rds-8.0-1024x240.png\" alt=\"\" class=\"wp-image-10812\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aws-rds-8.0-1024x240.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aws-rds-8.0-300x70.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aws-rds-8.0-768x180.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aws-rds-8.0-1536x360.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2024\/01\/tls-performance-aws-rds-8.0-2048x481.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u5176\u4ed6\u7684\u4e00\u4e9b\u6d4b\u8bd5\u53c2\u8003<\/h3>\n\n\n\n<p>\u57282014\u5e74\u7684IEEE International Conference on Cloud Engineering (IC2E)\u6709\u4e00\u7bc7\u8bba\u6587\u6d4b\u8bd5\u4e86DynamoDB\u3001Cassandra\u5f00\u542fTLS\u7684\u6027\u80fd\u5f71\u54cd\uff1aBenchmarking the Performance Impact of Transport Layer Security in Cloud Database Systems\uff0c\u6587\u4e2d\u7684\u6d4b\u8bd5\uff0c\u541e\u5410\u6027\u80fd\u5f71\u54cd\u5206\u522b\u4e3a5%\u548c9%\u5de6\u53f3\u3002\u53e6\u5916\uff0c\u4e0d\u540c\u7684\u52a0\u5bc6\u7b97\u6cd5\u9009\u62e9\u4e5f\u4f1a\u5bf9\u6027\u80fd\u6709\u4e00\u5b9a\u7684\u5f71\u54cd\uff0c\u4f8b\u5982\uff0c\u6587\u4e2d\u7684Cassandra\u6d4b\u8bd5\u4e2d\uff0cAES128\u548cAES256\u7ea6\u670910%\u5de6\u53f3\u7684\u6027\u80fd\u5dee\u5f02\u3002<\/p>\n\n\n\n<p>2021\u5e74\uff0cyugabyteDB\u7684TPC-C\u6d4b\u8bd5\u4e2d\uff0c\u6027\u80fd\u7ea6\u67095%\u7684\u5f71\u54cd\uff1aMeasuring the Performance Impact of TLS Encryption Using TPC-C\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u5c0f\u7ed3<\/h3>\n\n\n\n<p>\u6574\u4f53\u4e0a\uff0c\u5f00\u542f\u4f20\u8f93\u52a0\u5bc6\u65f6\uff0c\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u7ea6\u4e3a2%~8%\uff0c\u4e0d\u540c\u7684\u73af\u5883\u4e0d\u540c\u7684\u6570\u636e\u5e93\u7248\u672c\u4f1a\u6709\u4e00\u4e9b\u4e0d\u540c\u3002\u5728\u5b9e\u9645\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u5efa\u8bae\u9ed8\u8ba4\u6253\u5f00\u8be5\u529f\u80fd\uff0c\u5e94\u7528\u8fde\u63a5\u662f\u5426\u9700\u8981\u5f00\u542f\uff0c\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u573a\u666f\u51b3\u5b9a\u3002\u901a\u5e38\uff0c\u5982\u679cClient\u7aef\u548c\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e0d\u518d\u540c\u4e00\u4e2a\u7f51\u7edc\u73af\u5883\u4e2d\uff0c\u5219\u5efa\u8baeClient\u7aef\u542f\u7528\u52a0\u5bc6\u4f20\u8f93\u3002<\/p>\n\n\n\n<p>\u53e6\u5916\uff0c\u5982\u679c\u670d\u52a1\u7aef\u5f00\u542fTLS\u52a0\u5bc6\uff0c\u4f46\u662f\u5ba2\u6237\u7aef\u5b9e\u9645\u8fde\u63a5\u4e2d\uff0c\u5e76\u6ca1\u6709\u4f7f\u7528\u7684\u8bdd\uff0c\u90a3\u4e48\u5bf9\u4e8e\u6027\u80fd\u662f\u6ca1\u6709\u5f71\u54cd\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u4e91\u6570\u636e\u5e93\u7684\u666e\u53ca\uff0c\u6570\u636e\u5e93\u7684\u4f20\u8f93\u52a0\u5bc6\u4e5f\u4f1a\u968f\u4e4b\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u672c\u6587\uff0c\u5c06\u4f7f\u7528\u901a\u7528\u6d4b\u8bd5\u6765\u770b\u770b\uff0c\u5f00\u542fTLS\u4f20\u8f93\u5bf9\u6570\u636e\u5e93\u7684\u6027\u80fd\u6709\u4ec0\u4e48\u6837\u7684\u5f71\u54cd\u3002 1. \u539f\u7406\u6982\u8ff0 \u5f00\u542fTLS\u4f20\u8f93\u52a0\u5bc6\u4e4b\u540e\uff0c\u5206\u522b\u4f1a\u5728\u5efa\u7acb\u8fde\u63a5\u3001\u6570\u636e\u4f20\u8f93\u4e24\u4e2a\u9636\u6bb5\u5bf9\u6027\u80fd\u9020\u6210\u5f71\u54cd\u3002\u56e0\u4e3a\u5efa\u7acb\u8fde\u63a5\u7684\u8fc7\u7a0b\u901a\u5e38\u662f\u4e00\u6b21\u6027\u7684\uff0c\u8fde\u63a5\u4f1a\u88ab\u590d\u7528\uff0c\u6240\u4ee5\u8fd9\u90e8\u5206\u7684\u6027\u80fd\u5f00\u9500\u901a\u5e38\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002\u5728\u4f20\u8f93\u9636\u6bb5\uff0c\u662f\u4f20\u8f93\u52a0\u5bc6\u5bf9\u6027\u80fd\u5f71\u54cd\u7684\u91cd\u8981\u9636\u6bb5\uff0c\u8fd9\u65f6\u5019\u901a\u5e38\u4f1a\u4f7f\u7528\u5bf9\u79f0\u52a0\u5bc6\u7b97\u6cd5\uff08\u4f8b\u5982AES256\uff09\u5bf9\u6570\u636e\u8fdb\u884c\u52a0\u5bc6\uff0c\u90a3\u4e48\u5b9e\u9645\u7684\u5bf9\u79f0\u52a0\u5bc6\u7684\u6027\u80fd\u5c31\u662f\u5bf9TLS\u4f20\u8f93\u52a0\u5bc6\u6027\u80fd\u5f71\u54cd\u6700\u5927\u7684\u90e8\u5206\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5e94\u7528\u4f7f\u7528\u7684\u662f\u77ed\u94fe\u63a5\uff08\u5e94\u8be5\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\uff09\uff0cTLS\u52a0\u5bc6\u7684\u5bc6\u94a5\u4ea4\u6362\u9636\u6bb5\u4e5f\u4f1a\u5bf9\u6bcf\u4e2a\u8fde\u63a5\u5efa\u7acb\u7684\u8fc7\u7a0b\u90fd\u6709\u4e00\u5b9a\u7684\u6027\u80fd\u5f71\u54cd\u3002 2. \u4e91\u6570\u636e\u5e93\u5b9e\u9645\u6d4b\u8bd5 \u8fd9\u91cc\u9009\u62e9\u5bf9RDS MySQL\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4e91\u5382\u5546\u5219\u5404\u81ea\u9009\u62e9\u56fd\u5916\u3001\u56fd\u5185Top 1\u7684\u4e91\u5382\u5546AWS\u548c\u963f\u91cc\u4e91\u3002 2.1 \u6d4b\u8bd5\u65b9\u6cd5\u8bf4\u660e \u4f7f\u7528sysbench 1.1.0\u7248\u672c\uff0c\u6d4b\u8bd5\u7c7b\u578b\u4e3aoltp_read_write\uff0c\u76f8\u5173\u53c2\u6570\u5982\u4e0b\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[138,126,6,125],"tags":[],"class_list":["post-10809","post","type-post","status-publish","format-standard","hentry","category-cloud-mysql-performance-benchmark","category-database","category-mysql","category-125"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/10809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=10809"}],"version-history":[{"count":2,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/10809\/revisions"}],"predecessor-version":[{"id":10814,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/10809\/revisions\/10814"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=10809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=10809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=10809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}