{"id":3337,"date":"2025-03-24T08:46:25","date_gmt":"2025-03-23T23:46:25","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=3337"},"modified":"2025-03-24T08:46:55","modified_gmt":"2025-03-23T23:46:55","slug":"%e3%80%90%e4%bf%9d%e5%ad%98%e7%89%88%e3%80%91windows%e7%92%b0%e5%a2%83%e3%81%a7redis%e3%82%92%e5%ae%8c%e7%92%a7%e3%81%ab%e4%bd%bf%e3%81%84%e3%81%93%e3%81%aa%e3%81%997%e3%81%a4%e3%81%ae%e6%a5%b5","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=3337","title":{"rendered":"\u3010\u4fdd\u5b58\u7248\u3011Windows\u74b0\u5883\u3067Redis\u3092\u5b8c\u74a7\u306b\u4f7f\u3044\u3053\u306a\u30597\u3064\u306e\u6975\u610f &#8211; \u74b0\u5883\u69cb\u7bc9\u304b\u3089\u30c8\u30e9\u30d6\u30eb\u5bfe\u51e6\u307e\u3067"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">Windows\u74b0\u5883\u3067\u306eRedis\u5c0e\u5165\u306e\u57fa\u790e\u77e5\u8b58<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">Redis\u306e\u7279\u5fb4\u3068Windows\u3067\u306e\u5229\u7528\u30e1\u30ea\u30c3\u30c8<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-2\">Windows Subsystem for Linux (WSL)\u3092\u4f7f\u7528\u3059\u308b\u5229\u70b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-3\">Windows\u74b0\u5883\u3067\u306eRedis\u74b0\u5883\u69cb\u7bc9\u30b9\u30c6\u30c3\u30d7<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-4\">WSL2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/a>      <\/li>      <li>        <a href=\"#i-5\">Ubuntu\u74b0\u5883\u3067\u306eRedis\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u624b\u9806<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-6\">Windows Native\u7248Redis\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-7\">Redis\u74b0\u5883\u306e\u52d5\u4f5c\u78ba\u8a8d\u3068\u30c6\u30b9\u30c8<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-8\">\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u30b3\u30de\u30f3\u30c9\u3068\u63a5\u7d9a\u30c6\u30b9\u30c8<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-9\">PHP\u304b\u3089Redis\u3078\u306e\u63a5\u7d9a\u8a2d\u5b9a<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-10\">Windows\u74b0\u5883\u3067\u306e\u6027\u80fd\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-11\">\u30e1\u30e2\u30ea\u8a2d\u5b9a\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-12\">\u30c7\u30a3\u30b9\u30af I\/O \u306e\u6700\u9069\u5316\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-13\">\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u3068\u6ce8\u610f\u70b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-14\">Windows\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-15\">\u8a8d\u8a3c\u8a2d\u5b9a\u3068\u6697\u53f7\u5316\u306e\u5b9f\u88c5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-16\">\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30ac\u30a4\u30c9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-17\">\u3088\u304f\u3042\u308b\u63a5\u7d9a\u30a8\u30e9\u30fc\u3068\u305d\u306e\u89e3\u6c7a\u65b9\u6cd5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-18\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4f4e\u4e0b\u6642\u306e\u5bfe\u51e6\u624b\u9806<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-19\">\u5b9f\u8df5\u7684\u306a\u904b\u7528\u7ba1\u7406\u306e\u30dd\u30a4\u30f3\u30c8<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-20\">\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u5fa9\u5143\u306e\u81ea\u52d5\u5316<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-21\">\u76e3\u8996\u4f53\u5236\u306e\u69cb\u7bc9\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">Windows\u74b0\u5883\u3067\u306eRedis\u5c0e\u5165\u306e\u57fa\u790e\u77e5\u8b58<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">Redis\u306e\u7279\u5fb4\u3068Windows\u3067\u306e\u5229\u7528\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<p>Redis\u306f\u3001\u9ad8\u6027\u80fd\u306a\u30a4\u30f3\u30e1\u30e2\u30ea\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001Windows\u74b0\u5883\u3067\u306e\u6d3b\u7528\u306b\u306f\u72ec\u81ea\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u6ce8\u610f\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. Redis\u306e\u4e3b\u8981\u306a\u7279\u5fb4<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30a4\u30f3\u30e1\u30e2\u30ea\u51e6\u7406\u306b\u3088\u308b\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9<\/li>\n\n\n\n<li>\u8aad\u307f\u53d6\u308a\u64cd\u4f5c: \u5e73\u57470.1\u30df\u30ea\u79d2\u672a\u6e80<\/li>\n\n\n\n<li>\u66f8\u304d\u8fbc\u307f\u64cd\u4f5c: \u5e73\u57470.2\u30df\u30ea\u79d2\u672a\u6e80<\/li>\n\n\n\n<li>\u8c4a\u5bcc\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u30b5\u30dd\u30fc\u30c8<\/li>\n\n\n\n<li>Strings, Lists, Sets, Sorted Sets, Hashes<\/li>\n\n\n\n<li>Streams\uff08\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u30a4\u30f3\u30b0\u7528\uff09<\/li>\n\n\n\n<li>HyperLogLog\uff08\u30e6\u30cb\u30fc\u30af\u5024\u306e\u30ab\u30a6\u30f3\u30c8\u7528\uff09<\/li>\n\n\n\n<li>\u6c38\u7d9a\u5316\u30aa\u30d7\u30b7\u30e7\u30f3<\/li>\n\n\n\n<li>RDB\uff08\u7279\u5b9a\u6642\u70b9\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\uff09<\/li>\n\n\n\n<li>AOF\uff08Write-Ahead\u30ed\u30b0\u65b9\u5f0f\uff09<\/li>\n<\/ul>\n\n\n\n<p><strong>2. Windows\u74b0\u5883\u3067\u306e\u5177\u4f53\u7684\u306a\u6d3b\u7528\u30b7\u30fc\u30f3<\/strong><\/p>\n\n\n<div id=\"id-b3f8c92a-6c42-4fed-9079-62a62eaf295f\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6d3b\u7528\u30b7\u30fc\u30f3<\/th><th>\u5b9f\u88c5\u4f8b<\/th><th>\u671f\u5f85\u3055\u308c\u308b\u52b9\u679c<\/th><\/tr><\/thead><tbody><tr><td>\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406<\/td><td><code>Redis::set('session:'.$userId, $sessionData, ['EX' =&gt; 3600])<\/code><\/td><td>\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u6c38\u7d9a\u5316\u3068\u9ad8\u901f\u306a\u30a2\u30af\u30bb\u30b9<\/td><\/tr><tr><td>\u30ad\u30e3\u30c3\u30b7\u30e5<\/td><td><code>Redis::hMset('user:'.$userId, $userProfile)<\/code><\/td><td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8ca0\u8377\u8efd\u6e1b<\/td><\/tr><tr><td>\u30b8\u30e7\u30d6\u30ad\u30e5\u30fc<\/td><td><code>Redis::lPush('jobs', json_encode($jobData))<\/code><\/td><td>\u975e\u540c\u671f\u51e6\u7406\u306e\u52b9\u7387\u5316<\/td><\/tr><tr><td>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u5206\u6790<\/td><td><code>Redis::zIncrBy('trending_topics', 1, $topic)<\/code><\/td><td>\u5373\u6642\u306e\u96c6\u8a08\u51e6\u7406<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>3. Windows\u3067\u306e\u5229\u7528\u306b\u304a\u3051\u308b\u30e1\u30ea\u30c3\u30c8<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u958b\u767a\u74b0\u5883\u306e\u7d71\u4e00\u6027<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u3068\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u306e\u4e00\u8cab\u6027\u78ba\u4fdd<\/li>\n\n\n\n<li>\u30c7\u30d0\u30c3\u30b0\u306e\u5bb9\u6613\u3055<\/li>\n\n\n\n<li>\u672c\u756a\u74b0\u5883\u3068\u306e\u4e92\u63db\u6027\u306e\u62c5\u4fdd<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u65e2\u5b58\u306eWindows\u8cc7\u7523\u3068\u306e\u9023\u643a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Active Directory\u3068\u306e\u8a8d\u8a3c\u9023\u643a<\/li>\n\n\n\n<li>Windows Task Scheduler\u306b\u3088\u308b\u81ea\u52d5\u5316<\/li>\n\n\n\n<li>PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3088\u308b\u904b\u7528\u7ba1\u7406<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Windows\u56fa\u6709\u306e\u6700\u9069\u5316\u8a2d\u5b9a\u304c\u53ef\u80fd<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u7ba1\u7406\u306e\u7d30\u304b\u306a\u5236\u5fa1<\/li>\n\n\n\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30b9\u30bf\u30c3\u30af\u306e\u8abf\u6574<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">Windows Subsystem for Linux (WSL)\u3092\u4f7f\u7528\u3059\u308b\u5229\u70b9<\/h3>\n\n\n\n<p>WSL\u3092\u5229\u7528\u3057\u305fRedis\u74b0\u5883\u306f\u3001Windows\u30cd\u30a4\u30c6\u30a3\u30d6\u306eRedis\u3068\u6bd4\u8f03\u3057\u3066\u591a\u304f\u306e\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. WSL\u3067\u306eRedis\u904b\u7528\u306e\u4e3b\u8981\u306a\u30e1\u30ea\u30c3\u30c8<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u672c\u756a\u74b0\u5883\u3068\u306e\u9ad8\u3044\u4e92\u63db\u6027<\/li>\n\n\n\n<li>Linux\u74b0\u5883\u3068\u540c\u3058\u30d0\u30a4\u30ca\u30ea\u304c\u4f7f\u7528\u53ef\u80fd<\/li>\n\n\n\n<li>\u74b0\u5883\u5909\u6570\u3084\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u306e\u4e00\u8cab\u6027<\/li>\n\n\n\n<li>\u30b7\u30b9\u30c6\u30e0\u30b3\u30fc\u30eb\u306e\u5b8c\u5168\u306a\u4e92\u63db\u6027<\/li>\n\n\n\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a<\/li>\n\n\n\n<li>\u30cd\u30a4\u30c6\u30a3\u30d6Linux\u306b\u8fd1\u3044I\/O\u6027\u80fd<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u7ba1\u7406\u306e\u52b9\u7387\u5316<\/li>\n\n\n\n<li>\u30d7\u30ed\u30bb\u30b9\u7ba1\u7406\u306e\u6700\u9069\u5316<\/li>\n\n\n\n<li>\u904b\u7528\u9762\u3067\u306e\u5229\u70b9<\/li>\n\n\n\n<li>Linux\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u304c\u5229\u7528\u53ef\u80fd<\/li>\n\n\n\n<li>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3088\u308b\u81ea\u52d5\u5316\u304c\u5bb9\u6613<\/li>\n\n\n\n<li>\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u306e\u8c4a\u5bcc\u306a\u9078\u629e\u80a2<\/li>\n<\/ul>\n\n\n\n<p><strong>2. WSL2\u306b\u304a\u3051\u308b\u5177\u4f53\u7684\u306a\u6539\u5584\u70b9<\/strong><\/p>\n\n\n\n<p>WSL2\u306f\u3001WSL1\u3068\u6bd4\u8f03\u3057\u3066\u4ee5\u4e0b\u306e\u70b9\u3067\u5927\u304d\u304f\u6539\u5584\u3055\u308c\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n<div id=\"id-f01b6c7d-8ea0-4da2-a42e-a59e54df8f33\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6a5f\u80fd<\/th><th>WSL1<\/th><th>WSL2<\/th><\/tr><\/thead><tbody><tr><td>\u30b7\u30b9\u30c6\u30e0\u30b3\u30fc\u30eb<\/td><td>\u5909\u63db\u5c64\u306b\u3088\u308b\u5b9f\u884c<\/td><td>\u30cd\u30a4\u30c6\u30a3\u30d6\u5b9f\u884c<\/td><\/tr><tr><td>\u30d5\u30a1\u30a4\u30ebI\/O\u6027\u80fd<\/td><td>\u4f4e\u901f<\/td><td>\u30cd\u30a4\u30c6\u30a3\u30d6\u306b\u8fd1\u3044\u901f\u5ea6<\/td><\/tr><tr><td>\u30e1\u30e2\u30ea\u7ba1\u7406<\/td><td>Windows\u306b\u4f9d\u5b58<\/td><td>Linux kernel\u306b\u3088\u308b\u7ba1\u7406<\/td><\/tr><tr><td>GPU\u30b5\u30dd\u30fc\u30c8<\/td><td>\u9650\u5b9a\u7684<\/td><td>\u5b8c\u5168\u306a\u30b5\u30dd\u30fc\u30c8<\/td><\/tr><tr><td>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<\/td><td>\u30db\u30b9\u30c8\u3068\u5171\u6709<\/td><td>\u4eee\u60f3NIC<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>3. WSL\u74b0\u5883\u3067\u306eRedis\u69cb\u7bc9\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u9078\u629e<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ubuntu 20.04 LTS\u4ee5\u964d\u3092\u63a8\u5968<\/li>\n\n\n\n<li>\u30b7\u30b9\u30c6\u30e0\u306e\u5b89\u5b9a\u6027\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u8c4a\u5bcc\u3055<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e1\u30e2\u30ea\u8a2d\u5b9a\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   # \/etc\/sysctl.conf \u3067\u306e\u8a2d\u5b9a\u4f8b\n   vm.overcommit_memory = 1<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30db\u30b9\u30c8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u8a2d\u5b9a<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   # redis.conf \u3067\u306e\u8a2d\u5b9a\u4f8b\n   bind 0.0.0.0\n   protected-mode yes<\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u306e\u57fa\u790e\u77e5\u8b58\u3092\u8e0f\u307e\u3048\u308b\u3053\u3068\u3067\u3001Windows\u74b0\u5883\u3067\u306eRedis\u5c0e\u5165\u3092\u30b9\u30e0\u30fc\u30ba\u306b\u9032\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5177\u4f53\u7684\u306a\u74b0\u5883\u69cb\u7bc9\u624b\u9806\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-3\">Windows\u74b0\u5883\u3067\u306eRedis\u74b0\u5883\u69cb\u7bc9\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">WSL2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/h3>\n\n\n\n<p>WSL2\u3092\u4f7f\u7528\u3057\u3066Redis\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u624b\u9806\u3092\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. WSL2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e96\u5099<\/strong><\/p>\n\n\n\n<p>\u307e\u305a\u3001Windows PowerShell\u3092\u7ba1\u7406\u8005\u6a29\u9650\u3067\u958b\u304d\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Windows\u306e\u6a5f\u80fd\u3092\u6709\u52b9\u5316\ndism.exe \/online \/enable-feature \/featurename:Microsoft-Windows-Subsystem-Linux \/all \/norestart\ndism.exe \/online \/enable-feature \/featurename:VirtualMachinePlatform \/all \/norestart\n\n# \u30b7\u30b9\u30c6\u30e0\u306e\u518d\u8d77\u52d5\nRestart-Computer<\/pre>\n\n\n\n<p><strong>2. WSL2\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<p>\u518d\u8d77\u52d5\u5f8c\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u3067WSL2\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>WSL2 Linux \u30ab\u30fc\u30cd\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   # WSL2 Linux \u30ab\u30fc\u30cd\u30eb\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\n   Invoke-WebRequest -Uri \"https:\/\/wslstorestorage.blob.core.windows.net\/wslblob\/wsl_update_x64.msi\" -OutFile \"wsl_update_x64.msi\"\n\n   # \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5b9f\u884c\n   Start-Process -FilePath \"wsl_update_x64.msi\" -ArgumentList \"\/quiet\" -Wait<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>WSL2\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u3057\u3066\u8a2d\u5b9a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   wsl --set-default-version 2<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>\u30e1\u30e2\u30ea\u8a2d\u5b9a\u306e\u6700\u9069\u5316\uff08\u63a8\u5968\uff09<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   # %UserProfile%\\.wslconfig \u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\n   @\"<\/pre>\n\n\n[wsl2]\n\n\n\n<p>memory=8GB processors=4 swapFile=C:\\\\wsl-swap.vhdx \u201c@ | Out-File \u201c$env:USERPROFILE\\.wslconfig\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">Ubuntu\u74b0\u5883\u3067\u306eRedis\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u624b\u9806<\/h3>\n\n\n\n<p>WSL2\u4e0a\u3067Ubuntu\u3092\u4f7f\u7528\u3057\u3066Redis\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. Ubuntu\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Microsoft Store\u304b\u3089Ubuntu\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nwsl --install -d Ubuntu-20.04<\/pre>\n\n\n\n<p><strong>2. Redis\u74b0\u5883\u306e\u69cb\u7bc9<\/strong><\/p>\n\n\n\n<p>WSL2\u306eUbuntu\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u30b7\u30b9\u30c6\u30e0\u306e\u66f4\u65b0\nsudo apt update &amp;&amp; sudo apt upgrade -y\n\n# Redis\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nsudo apt install redis-server -y\n\n# Redis\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\nsudo cp \/etc\/redis\/redis.conf \/etc\/redis\/redis.conf.backup\n\n# \u57fa\u672c\u7684\u306a\u8a2d\u5b9a\u306e\u5909\u66f4\nsudo sed -i 's\/bind 127.0.0.1\/bind 0.0.0.0\/g' \/etc\/redis\/redis.conf\nsudo sed -i 's\/# maxmemory-policy noeviction\/maxmemory-policy allkeys-lru\/g' \/etc\/redis\/redis.conf\nsudo sed -i 's\/# maxmemory &lt;bytes&gt;\/maxmemory 2gb\/g' \/etc\/redis\/redis.conf\n\n# Redis\u30b5\u30fc\u30d3\u30b9\u306e\u518d\u8d77\u52d5\nsudo systemctl restart redis-server<\/pre>\n\n\n\n<p><strong>3. \u52d5\u4f5c\u78ba\u8a8d\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Redis\u3078\u306e\u63a5\u7d9a\u30c6\u30b9\u30c8\nredis-cli ping\n\n# \u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\nredis-cli\n&gt; CONFIG SET requirepass \"your_strong_password\"\n&gt; AUTH your_strong_password\n&gt; CONFIG REWRITE<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">Windows Native\u7248Redis\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h3>\n\n\n\n<p>Windows Native\u7248\u306eRedis\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u672c\u756a\u74b0\u5883\u3067\u306f WSL2 \u7248\u306e\u4f7f\u7528\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. Windows Native\u7248Redis\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Chocolatey\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\uff08\u63a8\u5968\uff09<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   # Chocolatey\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u672a\u5c0e\u5165\u306e\u5834\u5408\uff09\n   Set-ExecutionPolicy Bypass -Scope Process -Force\n   [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072\n   iex ((New-Object System.Net.WebClient).DownloadString('https:\/\/chocolatey.org\/install.ps1'))\n\n   # Redis\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n   choco install redis-64 -y<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u624b\u52d5\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">   # Redis-x64-3.0.504.zip\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3068\u5c55\u958b\n   $redis_url = \"https:\/\/github.com\/microsoftarchive\/redis\/releases\/download\/win-3.0.504\/Redis-x64-3.0.504.zip\"\n   Invoke-WebRequest -Uri $redis_url -OutFile \"Redis-x64-3.0.504.zip\"\n   Expand-Archive \"Redis-x64-3.0.504.zip\" -DestinationPath \"C:\\Redis\"<\/pre>\n\n\n\n<p><strong>2. Windows Native\u7248\u306e\u57fa\u672c\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Redis\u30b5\u30fc\u30d3\u30b9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nC:\\Redis\\redis-server.exe --service-install redis.windows.conf\n\n# \u30b5\u30fc\u30d3\u30b9\u306e\u958b\u59cb\nStart-Service Redis\n\n# \u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a\nSet-Service Redis -StartupType Automatic<\/pre>\n\n\n\n<p><strong>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\uff08redis.windows.conf\uff09\u306e\u4e3b\u8981\u306a\u8a2d\u5b9a\u9805\u76ee<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u30e1\u30e2\u30ea\u5236\u9650\nmaxmemory 2gb\nmaxmemory-policy allkeys-lru\n\n# \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\nbind 127.0.0.1\nport 6379\n\n# \u6c38\u7d9a\u5316\u8a2d\u5b9a\ndir C:\/Redis\/data\ndbfilename dump.rdb\nappendonly yes\nappendfilename \"appendonly.aof\"<\/pre>\n\n\n\n<p><strong>3. Windows Native\u7248\u306e\u5236\u9650\u4e8b\u9805<\/strong><\/p>\n\n\n<div id=\"id-6fe1c4a4-0aa5-493b-8822-d83cbf7927ea\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6a5f\u80fd<\/th><th>\u5236\u9650\u5185\u5bb9<\/th><\/tr><\/thead><tbody><tr><td>fork()<\/td><td>\u672a\u30b5\u30dd\u30fc\u30c8<\/td><\/tr><tr><td>\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30bb\u30fc\u30d6<\/td><td>\u5236\u9650\u3042\u308a<\/td><\/tr><tr><td>\u30e1\u30e2\u30ea\u30aa\u30fc\u30d0\u30fc\u30b3\u30df\u30c3\u30c8<\/td><td>\u672a\u30b5\u30dd\u30fc\u30c8<\/td><\/tr><tr><td>UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8<\/td><td>\u672a\u30b5\u30dd\u30fc\u30c8<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u4ee5\u4e0a\u306e\u624b\u9806\u3067\u3001Windows\u74b0\u5883\u3067\u306eRedis\u74b0\u5883\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u69cb\u7bc9\u3057\u305f\u74b0\u5883\u306e\u52d5\u4f5c\u78ba\u8a8d\u3068\u30c6\u30b9\u30c8\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-7\">Redis\u74b0\u5883\u306e\u52d5\u4f5c\u78ba\u8a8d\u3068\u30c6\u30b9\u30c8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-8\">\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u30b3\u30de\u30f3\u30c9\u3068\u63a5\u7d9a\u30c6\u30b9\u30c8<\/h3>\n\n\n\n<p>Redis\u306e\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u74b0\u5883\u304c\u6b63\u3057\u304f\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. \u63a5\u7d9a\u78ba\u8a8d\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Redis\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u63a5\u7d9a\nredis-cli\n\n# \u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\nINFO server\n\n# \u57fa\u672c\u7684\u306a\u52d5\u4f5c\u78ba\u8a8d\nPING<\/pre>\n\n\n\n<p><strong>2. \u57fa\u672c\u7684\u306a\u30c7\u30fc\u30bf\u64cd\u4f5c\u306e\u30c6\u30b9\u30c8<\/strong><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001\u5404\u30c7\u30fc\u30bf\u578b\u306e\u64cd\u4f5c\u3092\u30c6\u30b9\u30c8\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u6587\u5b57\u5217\u306e\u64cd\u4f5c\nSET test_key \"Hello Redis on Windows\"\nGET test_key\n\n# \u30ea\u30b9\u30c8\u306e\u64cd\u4f5c\nLPUSH test_list \"first\"\nLPUSH test_list \"second\"\nLRANGE test_list 0 -1\n\n# \u30cf\u30c3\u30b7\u30e5\u306e\u64cd\u4f5c\nHMSET user:1 username \"testuser\" email \"test@example.com\"\nHGETALL user:1\n\n# \u30bb\u30c3\u30c8\u306e\u64cd\u4f5c\nSADD test_set \"A\" \"B\" \"C\"\nSMEMBERS test_set\n\n# \u30bd\u30fc\u30c8\u6e08\u307f\u30bb\u30c3\u30c8\u306e\u64cd\u4f5c\nZADD scores 100 \"player1\"\nZADD scores 200 \"player2\"\nZRANGE scores 0 -1 WITHSCORES<\/pre>\n\n\n\n<p><strong>3. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c6\u30b9\u30c8<\/strong><\/p>\n\n\n\n<p>\u57fa\u672c\u7684\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c1\u30a7\u30c3\u30af\u3092\u5b9f\u884c\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u30e2\u30fc\u30c9\u3067\u306e\u66f8\u304d\u8fbc\u307f\u30c6\u30b9\u30c8\nredis-cli -r 100000 PING\nredis-cli -r 100000 SET key:__rand_int__ value:__rand_int__\n\n# \u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u78ba\u8a8d\nINFO memory<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">PHP\u304b\u3089Redis\u3078\u306e\u63a5\u7d9a\u8a2d\u5b9a<\/h3>\n\n\n\n<p>PHP\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089Redis\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3068\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. PHP Redis\u62e1\u5f35\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/p>\n\n\n\n<p>Windows\u74b0\u5883\u3067\u306ePHP Redis\u62e1\u5f35\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># php.ini\u306e\u5834\u6240\u78ba\u8a8d\nphp -i | findstr \"php.ini\"\n\n# PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5408\u308f\u305b\u305fphpredis\u306eDLL\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\n# php.ini\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\nextension=redis.dll<\/pre>\n\n\n\n<p><strong>2. \u57fa\u672c\u7684\u306a\u63a5\u7d9a\u30c6\u30b9\u30c8\uff08PHP\u30b3\u30fc\u30c9\uff09<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ \u57fa\u672c\u7684\u306a\u63a5\u7d9a\u30c6\u30b9\u30c8\ntry {\n    $redis = new Redis();\n    $redis-&gt;connect('127.0.0.1', 6379);\n\n    \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\n    $redis-&gt;auth('your_password');\n\n    \/\/ \u63a5\u7d9a\u30c6\u30b9\u30c8\n    echo $redis-&gt;ping();\n} catch (RedisException $e) {\n    die('\u63a5\u7d9a\u30a8\u30e9\u30fc: ' . $e-&gt;getMessage());\n}<\/pre>\n\n\n\n<p><strong>3. \u30c7\u30fc\u30bf\u578b\u5225\u306e\u64cd\u4f5c\u30c6\u30b9\u30c8<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ Redis\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u521d\u671f\u5316\n$redis = new Redis();\n$redis-&gt;connect('127.0.0.1', 6379);\n\n\/\/ \u6587\u5b57\u5217\u64cd\u4f5c\u306e\u30c6\u30b9\u30c8\nfunction testString($redis) {\n    $redis-&gt;set('test_str', 'Hello Redis');\n    $value = $redis-&gt;get('test_str');\n    echo \"String Test: $value\\n\";\n}\n\n\/\/ \u30ea\u30b9\u30c8\u64cd\u4f5c\u306e\u30c6\u30b9\u30c8\nfunction testList($redis) {\n    $redis-&gt;del('test_list'); \/\/ \u65e2\u5b58\u306e\u30ea\u30b9\u30c8\u3092\u30af\u30ea\u30a2\n    $redis-&gt;lPush('test_list', 'item1');\n    $redis-&gt;lPush('test_list', 'item2');\n    $items = $redis-&gt;lRange('test_list', 0, -1);\n    echo \"List Test: \" . implode(', ', $items) . \"\\n\";\n}\n\n\/\/ \u30cf\u30c3\u30b7\u30e5\u64cd\u4f5c\u306e\u30c6\u30b9\u30c8\nfunction testHash($redis) {\n    $redis-&gt;hSet('test_hash', 'field1', 'value1');\n    $redis-&gt;hSet('test_hash', 'field2', 'value2');\n    $hash = $redis-&gt;hGetAll('test_hash');\n    echo \"Hash Test: \" . json_encode($hash) . \"\\n\";\n}\n\n\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u306e\u30c6\u30b9\u30c8\nfunction testSession($redis) {\n    $sessionId = uniqid();\n    $sessionData = [\n        'user_id' =&gt; 123,\n        'username' =&gt; 'testuser',\n        'last_access' =&gt; time()\n    ];\n\n    $redis-&gt;setex(\"session:$sessionId\", 3600, json_encode($sessionData));\n    $stored = $redis-&gt;get(\"session:$sessionId\");\n    echo \"Session Test: \" . $stored . \"\\n\";\n}\n\n\/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u306e\u30c6\u30b9\u30c8\nfunction testCache($redis) {\n    $cacheKey = 'cache:test';\n    $data = ['timestamp' =&gt; time(), 'data' =&gt; 'cached_value'];\n\n    $redis-&gt;set($cacheKey, json_encode($data));\n    $redis-&gt;expire($cacheKey, 300); \/\/ 5\u5206\u5f8c\u306b\u671f\u9650\u5207\u308c\n\n    $cached = $redis-&gt;get($cacheKey);\n    echo \"Cache Test: \" . $cached . \"\\n\";\n}\n\n\/\/ \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30c6\u30b9\u30c8\nfunction testTransaction($redis) {\n    $redis-&gt;multi();\n    try {\n        $redis-&gt;set('trans_test1', 'value1');\n        $redis-&gt;set('trans_test2', 'value2');\n        $result = $redis-&gt;exec();\n        echo \"Transaction Test: Success\\n\";\n    } catch (Exception $e) {\n        $redis-&gt;discard();\n        echo \"Transaction Test: Failed - \" . $e-&gt;getMessage() . \"\\n\";\n    }\n}\n\n\/\/ \u5168\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\ntestString($redis);\ntestList($redis);\ntestHash($redis);\ntestSession($redis);\ntestCache($redis);\ntestTransaction($redis);<\/pre>\n\n\n\n<p><strong>4. \u63a5\u7d9a\u30d7\u30fc\u30eb\u306e\u8a2d\u5b9a\uff08\u9ad8\u8ca0\u8377\u74b0\u5883\u7528\uff09<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ \u63a5\u7d9a\u30d7\u30fc\u30eb\u306e\u8a2d\u5b9a\u4f8b\n$pool = new RedisArray([\n    'tcp:\/\/127.0.0.1:6379',\n    'tcp:\/\/127.0.0.1:6380'  \/\/ \u30ec\u30d7\u30ea\u30ab\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\n], [\n    'connect_timeout' =&gt; 2.5,\n    'read_timeout' =&gt; 1.5,\n    'retry_interval' =&gt; 100\n]);\n\n\/\/ \u63a5\u7d9a\u30d7\u30fc\u30eb\u306e\u30c6\u30b9\u30c8\ntry {\n    foreach ($pool-&gt;_hosts() as $host) {\n        if ($pool-&gt;_instance($host)-&gt;ping()) {\n            echo \"$host is alive\\n\";\n        }\n    }\n} catch (RedisException $e) {\n    echo \"Pool error: \" . $e-&gt;getMessage() . \"\\n\";\n}<\/pre>\n\n\n\n<p><strong>5. \u30a8\u30e9\u30fc\u51e6\u7406\u3068\u30ea\u30c8\u30e9\u30a4\u6a5f\u69cb\u306e\u5b9f\u88c5<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisConnection {\n    private $redis;\n    private $maxRetries = 3;\n    private $retryDelay = 100; \/\/ \u30df\u30ea\u79d2\n\n    public function __construct() {\n        $this-&gt;redis = new Redis();\n    }\n\n    public function connect() {\n        $retries = 0;\n        while ($retries &lt; $this-&gt;maxRetries) {\n            try {\n                $this-&gt;redis-&gt;connect('127.0.0.1', 6379);\n                return true;\n            } catch (RedisException $e) {\n                $retries++;\n                if ($retries === $this-&gt;maxRetries) {\n                    throw $e;\n                }\n                usleep($this-&gt;retryDelay * 1000);\n            }\n        }\n        return false;\n    }\n\n    public function execute($callback) {\n        try {\n            return $callback($this-&gt;redis);\n        } catch (RedisException $e) {\n            \/\/ \u63a5\u7d9a\u304c\u5207\u308c\u305f\u5834\u5408\u306e\u518d\u63a5\u7d9a\u51e6\u7406\n            $this-&gt;connect();\n            return $callback($this-&gt;redis);\n        }\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$connection = new RedisConnection();\ntry {\n    $connection-&gt;connect();\n    $result = $connection-&gt;execute(function($redis) {\n        return $redis-&gt;get('test_key');\n    });\n    echo \"Result: $result\\n\";\n} catch (Exception $e) {\n    echo \"Error: \" . $e-&gt;getMessage() . \"\\n\";\n}<\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u306e\u52d5\u4f5c\u78ba\u8a8d\u3068\u30c6\u30b9\u30c8\u306b\u3088\u308a\u3001Redis\u74b0\u5883\u304c\u6b63\u3057\u304f\u6a5f\u80fd\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001Windows\u74b0\u5883\u3067\u306e\u6027\u80fd\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-10\">Windows\u74b0\u5883\u3067\u306e\u6027\u80fd\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">\u30e1\u30e2\u30ea\u8a2d\u5b9a\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<p>Windows\u74b0\u5883\u3067Redis\u306e\u30e1\u30e2\u30ea\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u9069\u5316\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3068\u63a8\u5968\u4e8b\u9805\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. \u30e1\u30e2\u30ea\u7ba1\u7406\u306e\u57fa\u672c\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># redis.conf \u3067\u306e\u4e3b\u8981\u306a\u30e1\u30e2\u30ea\u8a2d\u5b9a\nmaxmemory 2gb\nmaxmemory-policy allkeys-lru\nmaxmemory-samples 10\n\n# \u91cd\u8981\u306a\u30e1\u30e2\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\nhash-max-ziplist-entries 512\nhash-max-ziplist-value 64\nlist-max-ziplist-entries 512\nlist-max-ziplist-value 64\nset-max-intset-entries 512\nzset-max-ziplist-entries 128\nzset-max-ziplist-value 64<\/pre>\n\n\n\n<p><strong>2. \u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u76e3\u8996\u3068\u6700\u9069\u5316<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ \u30e1\u30e2\u30ea\u4f7f\u7528\u72b6\u6cc1\u306e\u76e3\u8996\u30b9\u30af\u30ea\u30d7\u30c8\nfunction monitorMemoryUsage($redis) {\n    $info = $redis-&gt;info('memory');\n    $metrics = [\n        'used_memory_human' =&gt; $info['used_memory_human'],\n        'used_memory_peak_human' =&gt; $info['used_memory_peak_human'],\n        'used_memory_lua_human' =&gt; $info['used_memory_lua_human'],\n        'mem_fragmentation_ratio' =&gt; $info['mem_fragmentation_ratio']\n    ];\n\n    \/\/ \u30e1\u30e2\u30ea\u65ad\u7247\u5316\u7387\u306e\u8b66\u544a\n    if ($metrics['mem_fragmentation_ratio'] &gt; 1.5) {\n        trigger_error(\n            \"High memory fragmentation: {$metrics['mem_fragmentation_ratio']}\", \n            E_USER_WARNING\n        );\n    }\n\n    return $metrics;\n}<\/pre>\n\n\n\n<p><strong>3. \u30ad\u30fc\u306e\u6709\u52b9\u671f\u9650\u8a2d\u5b9a\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/strong><\/p>\n\n\n<div id=\"id-a5c539e4-4b14-443e-ad3b-11d180ae1b59\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30c7\u30fc\u30bf\u30bf\u30a4\u30d7<\/th><th>\u63a8\u5968\u6709\u52b9\u671f\u9650<\/th><th>\u8a2d\u5b9a\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf<\/td><td>1-24\u6642\u9593<\/td><td>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u30e1\u30e2\u30ea\u52b9\u7387\u306e\u4e21\u7acb<\/td><\/tr><tr><td>API\u30ad\u30e3\u30c3\u30b7\u30e5<\/td><td>5-15\u5206<\/td><td>\u30c7\u30fc\u30bf\u306e\u9bae\u5ea6\u7dad\u6301<\/td><\/tr><tr><td>\u7d71\u8a08\u30c7\u30fc\u30bf<\/td><td>1-7\u65e5<\/td><td>\u5206\u6790\u7528\u30c7\u30fc\u30bf\u306e\u4fdd\u6301<\/td><\/tr><tr><td>\u4e00\u6642\u7684\u306a\u30ed\u30c3\u30af<\/td><td>1-5\u5206<\/td><td>\u30c7\u30c3\u30c9\u30ed\u30c3\u30af\u9632\u6b62<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">\u30c7\u30a3\u30b9\u30af I\/O \u306e\u6700\u9069\u5316\u65b9\u6cd5<\/h3>\n\n\n\n<p>Windows\u74b0\u5883\u3067\u306e\u30c7\u30a3\u30b9\u30afI\/O\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u9069\u5316\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. \u6c38\u7d9a\u5316\u8a2d\u5b9a\u306e\u6700\u9069\u5316<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># redis.conf \u3067\u306e\u6c38\u7d9a\u5316\u8a2d\u5b9a\nappendonly yes\nappendfsync everysec\nno-appendfsync-on-rewrite yes\nauto-aof-rewrite-percentage 100\nauto-aof-rewrite-min-size 64mb\n\n# RDB\u8a2d\u5b9a\nsave 900 1\nsave 300 10\nsave 60 10000\nrdbcompression yes\nrdbchecksum yes<\/pre>\n\n\n\n<p><strong>2. \u30c7\u30a3\u30b9\u30afI\/O\u6700\u9069\u5316\u306e\u305f\u3081\u306e\u30b7\u30b9\u30c6\u30e0\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Windows Storage Spaces\u306e\u6700\u9069\u5316\nSet-StoragePool -FriendlyName \"Storage Pool 1\" -WriteCacheSizeDefault 8GB\n\n# \u30c7\u30a3\u30b9\u30af\u306e\u66f8\u304d\u8fbc\u307f\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6709\u52b9\u5316\nGet-Disk | Where-Object { $_.Number -eq 0 } | Set-Disk -IsReadOnly $false<\/pre>\n\n\n\n<p><strong>3. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u306e\u5b9f\u88c5<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisPerformanceMonitor {\n    private $redis;\n    private $metrics = [];\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    public function collectMetrics() {\n        \/\/ I\/O\u7d71\u8a08\u306e\u53ce\u96c6\n        $info = $this-&gt;redis-&gt;info();\n\n        $this-&gt;metrics = [\n            'instantaneous_ops_per_sec' =&gt; $info['instantaneous_ops_per_sec'],\n            'total_commands_processed' =&gt; $info['total_commands_processed'],\n            'total_net_input_bytes' =&gt; $info['total_net_input_bytes'],\n            'total_net_output_bytes' =&gt; $info['total_net_output_bytes'],\n            'aof_current_size' =&gt; $info['aof_current_size'] ?? 0,\n            'rdb_changes_since_last_save' =&gt; $info['rdb_changes_since_last_save'] ?? 0\n        ];\n\n        return $this-&gt;metrics;\n    }\n\n    public function analyzePerformance() {\n        $metrics = $this-&gt;collectMetrics();\n        $recommendations = [];\n\n        \/\/ \u51e6\u7406\u901f\u5ea6\u306e\u5206\u6790\n        if ($metrics['instantaneous_ops_per_sec'] &lt; 1000) {\n            $recommendations[] = 'Consider increasing maxmemory for better performance';\n        }\n\n        \/\/ AOF\u30b5\u30a4\u30ba\u306e\u5206\u6790\n        if (($metrics['aof_current_size'] \/ 1024 \/ 1024) &gt; 1000) {\n            $recommendations[] = 'Consider triggering AOF rewrite to optimize file size';\n        }\n\n        return $recommendations;\n    }\n\n    public function logPerformanceMetrics() {\n        $metrics = $this-&gt;collectMetrics();\n        $timestamp = date('Y-m-d H:i:s');\n\n        \/\/ \u30e1\u30c8\u30ea\u30af\u30b9\u306e\u30ed\u30b0\u8a18\u9332\n        file_put_contents(\n            'redis_performance.log',\n            \"$timestamp: \" . json_encode($metrics) . \"\\n\",\n            FILE_APPEND\n        );\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$monitor = new RedisPerformanceMonitor($redis);\n$recommendations = $monitor-&gt;analyzePerformance();\nforeach ($recommendations as $recommendation) {\n    error_log(\"Redis Performance Recommendation: $recommendation\");\n}<\/pre>\n\n\n\n<p><strong>4. \u8ca0\u8377\u30c6\u30b9\u30c8\u3068\u6700\u9069\u5316\u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3<\/strong><\/p>\n\n\n<div id=\"id-44ce9a6c-dbfa-4695-bd23-a86319fb2cca\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9805\u76ee<\/th><th>\u63a8\u5968\u5024<\/th><th>\u76e3\u8996\u65b9\u6cd5<\/th><\/tr><\/thead><tbody><tr><td>\u6700\u5927\u63a5\u7d9a\u6570<\/td><td>10000<\/td><td>netstat -an | findstr \u201c6379\u201d<\/td><\/tr><tr><td>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30d0\u30c3\u30d5\u30a1<\/td><td>client-output-buffer-limit normal 0 0 0<\/td><td>INFO clients<\/td><\/tr><tr><td>TCP keepalive<\/td><td>300<\/td><td>INFO clients<\/td><\/tr><tr><td>I\/O\u30b9\u30ec\u30c3\u30c9\u6570<\/td><td>4<\/td><td>INFO stats<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>5. \u6027\u80fd\u6700\u9069\u5316\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>maxmemory\u306e\u9069\u5207\u306a\u8a2d\u5b9a<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u65ad\u7247\u5316\u306e\u76e3\u8996<\/li>\n\n\n\n<li>\u30ad\u30e3\u30c3\u30b7\u30e5\u30dd\u30ea\u30b7\u30fc\u306e\u8abf\u6574<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TCP backlog\u306e\u8a2d\u5b9a<\/li>\n\n\n\n<li>Windows\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u6700\u9069\u5316<\/li>\n\n\n\n<li>keepalive\u306e\u8a2d\u5b9a<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30b9\u30c8\u30ec\u30fc\u30b8\u8a2d\u5b9a\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AOF\/RDB\u8a2d\u5b9a\u306e\u8abf\u6574<\/li>\n\n\n\n<li>\u30c7\u30a3\u30b9\u30afI\/O\u306e\u76e3\u8996<\/li>\n\n\n\n<li>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u6226\u7565\u306e\u898b\u76f4\u3057<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30ec\u30d9\u30eb\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u51e6\u7406\u306e\u6d3b\u7528<\/li>\n\n\n\n<li>\u9069\u5207\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u9078\u629e<\/li>\n\n\n\n<li>\u30d0\u30c3\u30c1\u51e6\u7406\u306e\u5b9f\u88c5<\/li>\n<\/ul>\n\n\n\n<p>\u4ee5\u4e0a\u306e\u6700\u9069\u5316\u8a2d\u5b9a\u306b\u3088\u308a\u3001Windows\u74b0\u5883\u3067\u306eRedis\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u3068\u6ce8\u610f\u70b9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-13\">\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u3068\u6ce8\u610f\u70b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-14\">Windows\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<p>Windows\u74b0\u5883\u3067Redis\u3092\u5b89\u5168\u306b\u904b\u7528\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u8a2d\u5b9a\u3068\u6ce8\u610f\u70b9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. \u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Redis\u7528\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\nNew-NetFirewallRule `\n    -DisplayName \"Redis Server\" `\n    -Direction Inbound `\n    -Protocol TCP `\n    -LocalPort 6379 `\n    -Action Allow `\n    -Profile Private\n\n# \u7279\u5b9a\u306eIP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u306e\u307f\u3092\u8a31\u53ef\nSet-NetFirewallRule `\n    -DisplayName \"Redis Server\" `\n    -RemoteAddress 10.0.0.0\/24, 192.168.1.0\/24<\/pre>\n\n\n\n<p><strong>2. \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u5f37\u5316<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># redis.conf \u3067\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\nbind 127.0.0.1\nprotected-mode yes\ntcp-backlog 511\ntimeout 0\ntcp-keepalive 300<\/pre>\n\n\n\n<p><strong>3. SSL\/TLS\u901a\u4fe1\u306e\u5b9f\u88c5<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass SecureRedisConnection {\n    private $redis;\n    private $config;\n\n    public function __construct(array $config = []) {\n        $this-&gt;config = array_merge([\n            'host' =&gt; '127.0.0.1',\n            'port' =&gt; 6379,\n            'timeout' =&gt; 2.0,\n            'ssl' =&gt; [\n                'local_cert' =&gt; 'path\/to\/client-cert.pem',\n                'local_pk' =&gt; 'path\/to\/client-key.pem',\n                'cafile' =&gt; 'path\/to\/ca.pem',\n                'verify_peer' =&gt; true,\n                'verify_peer_name' =&gt; true\n            ]\n        ], $config);\n\n        $this-&gt;redis = new Redis();\n    }\n\n    public function connect() {\n        $context = stream_context_create([\n            'ssl' =&gt; $this-&gt;config['ssl']\n        ]);\n\n        return $this-&gt;redis-&gt;connect(\n            $this-&gt;config['host'],\n            $this-&gt;config['port'],\n            $this-&gt;config['timeout'],\n            null,\n            0,\n            0,\n            ['stream' =&gt; $context]\n        );\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-15\">\u8a8d\u8a3c\u8a2d\u5b9a\u3068\u6697\u53f7\u5316\u306e\u5b9f\u88c5<\/h3>\n\n\n\n<p><strong>1. \u5f37\u529b\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisAuthManager {\n    private $redis;\n    private const MIN_PASSWORD_LENGTH = 16;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    public function setSecurePassword($password) {\n        if (strlen($password) &lt; self::MIN_PASSWORD_LENGTH) {\n            throw new InvalidArgumentException(\n                'Password must be at least ' . self::MIN_PASSWORD_LENGTH . ' characters long'\n            );\n        }\n\n        if (!preg_match('\/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&amp;])[A-Za-z\\d@$!%*?&amp;]+$\/', $password)) {\n            throw new InvalidArgumentException(\n                'Password must contain uppercase, lowercase, numbers and special characters'\n            );\n        }\n\n        $this-&gt;redis-&gt;config('SET', 'requirepass', $password);\n        $this-&gt;redis-&gt;config('REWRITE');\n\n        return true;\n    }\n\n    public function rotatePassword() {\n        $newPassword = bin2hex(random_bytes(16));\n        $this-&gt;setSecurePassword($newPassword);\n        return $newPassword;\n    }\n}<\/pre>\n\n\n\n<p><strong>2. \u30c7\u30fc\u30bf\u6697\u53f7\u5316\u306e\u5b9f\u88c5<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisEncryption {\n    private $key;\n    private $cipher = 'aes-256-gcm';\n\n    public function __construct($key) {\n        $this-&gt;key = $key;\n    }\n\n    public function encrypt($data) {\n        $ivlen = openssl_cipher_iv_length($this-&gt;cipher);\n        $iv = openssl_random_pseudo_bytes($ivlen);\n        $tag = null;\n\n        $encrypted = openssl_encrypt(\n            json_encode($data),\n            $this-&gt;cipher,\n            $this-&gt;key,\n            OPENSSL_RAW_DATA,\n            $iv,\n            $tag\n        );\n\n        return base64_encode($iv . $tag . $encrypted);\n    }\n\n    public function decrypt($encryptedData) {\n        $data = base64_decode($encryptedData);\n        $ivlen = openssl_cipher_iv_length($this-&gt;cipher);\n        $iv = substr($data, 0, $ivlen);\n        $tag = substr($data, $ivlen, 16);\n        $ciphertext = substr($data, $ivlen + 16);\n\n        $decrypted = openssl_decrypt(\n            $ciphertext,\n            $this-&gt;cipher,\n            $this-&gt;key,\n            OPENSSL_RAW_DATA,\n            $iv,\n            $tag\n        );\n\n        return json_decode($decrypted, true);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$encryption = new RedisEncryption(random_bytes(32));\n\n\/\/ \u6a5f\u5bc6\u30c7\u30fc\u30bf\u306e\u4fdd\u5b58\n$redis-&gt;set('sensitive_data', $encryption-&gt;encrypt([\n    'credit_card' =&gt; '****-****-****-1234',\n    'expiry' =&gt; '12\/25'\n]));\n\n\/\/ \u6a5f\u5bc6\u30c7\u30fc\u30bf\u306e\u53d6\u5f97\n$encryptedData = $redis-&gt;get('sensitive_data');\n$decryptedData = $encryption-&gt;decrypt($encryptedData);<\/pre>\n\n\n\n<p><strong>3. \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u76e3\u67fb\u3068\u30ed\u30b0\u8a18\u9332<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisSecurityAuditor {\n    private $redis;\n    private $logFile;\n\n    public function __construct(Redis $redis, $logFile = 'redis_audit.log') {\n        $this-&gt;redis = $redis;\n        $this-&gt;logFile = $logFile;\n    }\n\n    public function auditConfiguration() {\n        $config = $this-&gt;redis-&gt;config('GET', '*');\n        $risks = [];\n\n        \/\/ \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u306e\u30c1\u30a7\u30c3\u30af\n        if ($config['protected-mode'] === 'no') {\n            $risks[] = 'Protected mode is disabled';\n        }\n\n        if ($config['bind'] === '') {\n            $risks[] = 'Redis is binding to all interfaces';\n        }\n\n        if (!isset($config['requirepass']) || $config['requirepass'] === '') {\n            $risks[] = 'Authentication is not enabled';\n        }\n\n        $this-&gt;logAuditResults($risks);\n        return $risks;\n    }\n\n    public function monitorCommands() {\n        $this-&gt;redis-&gt;monitor(function($redis, $pattern, $channel, $message) {\n            $this-&gt;logCommand($message);\n        });\n    }\n\n    private function logAuditResults(array $risks) {\n        $timestamp = date('Y-m-d H:i:s');\n        $log = \"[$timestamp] Security Audit Results:\\n\";\n        foreach ($risks as $risk) {\n            $log .= \"- $risk\\n\";\n        }\n        file_put_contents($this-&gt;logFile, $log, FILE_APPEND);\n    }\n\n    private function logCommand($command) {\n        $timestamp = date('Y-m-d H:i:s');\n        $log = \"[$timestamp] Command: $command\\n\";\n        file_put_contents($this-&gt;logFile, $log, FILE_APPEND);\n    }\n}<\/pre>\n\n\n\n<p><strong>4. \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/strong><\/p>\n\n\n<div id=\"id-adb22b2d-3569-445c-8388-d05926285e85\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30ab\u30c6\u30b4\u30ea<\/th><th>\u63a8\u5968\u8a2d\u5b9a<\/th><th>\u91cd\u8981\u5ea6<\/th><\/tr><\/thead><tbody><tr><td>\u8a8d\u8a3c<\/td><td>requirepass\u8a2d\u5b9a\u5fc5\u9808<\/td><td>\u9ad8<\/td><\/tr><tr><td>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<\/td><td>bind\u30a2\u30c9\u30ec\u30b9\u5236\u9650<\/td><td>\u9ad8<\/td><\/tr><tr><td>SSL\/TLS<\/td><td>\u8a3c\u660e\u66f8\u306b\u3088\u308b\u6697\u53f7\u5316<\/td><td>\u4e2d<\/td><\/tr><tr><td>\u30a2\u30af\u30bb\u30b9\u5236\u5fa1<\/td><td>ACL\u306e\u5b9f\u88c5<\/td><td>\u4e2d<\/td><\/tr><tr><td>\u76e3\u67fb<\/td><td>\u30b3\u30de\u30f3\u30c9\u30ed\u30b0\u306e\u6709\u52b9\u5316<\/td><td>\u4e2d<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u4ee5\u4e0a\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306b\u3088\u308a\u3001Windows\u74b0\u5883\u3067\u306eRedis\u904b\u7528\u3092\u5b89\u5168\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30ac\u30a4\u30c9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-16\">\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30ac\u30a4\u30c9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">\u3088\u304f\u3042\u308b\u63a5\u7d9a\u30a8\u30e9\u30fc\u3068\u305d\u306e\u89e3\u6c7a\u65b9\u6cd5<\/h3>\n\n\n\n<p>Windows\u74b0\u5883\u3067Redis\u3092\u4f7f\u7528\u3059\u308b\u969b\u306b\u3088\u304f\u767a\u751f\u3059\u308b\u63a5\u7d9a\u554f\u984c\u3068\u305d\u306e\u89e3\u6c7a\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. \u63a5\u7d9a\u30a8\u30e9\u30fc\u306e\u8a3a\u65ad\u30c4\u30fc\u30eb<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisConnectionDiagnostics {\n    private $host;\n    private $port;\n\n    public function __construct($host = '127.0.0.1', $port = 6379) {\n        $this-&gt;host = $host;\n        $this-&gt;port = $port;\n    }\n\n    public function runDiagnostics() {\n        $results = [];\n\n        \/\/ TCP\u30dd\u30fc\u30c8\u306e\u78ba\u8a8d\n        $results['port_check'] = $this-&gt;checkPort();\n\n        \/\/ Redis\u30d7\u30ed\u30bb\u30b9\u306e\u78ba\u8a8d\n        $results['process_check'] = $this-&gt;checkProcess();\n\n        \/\/ \u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u78ba\u8a8d\n        $results['firewall_check'] = $this-&gt;checkFirewall();\n\n        \/\/ Redis\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b\u78ba\u8a8d\n        $results['service_check'] = $this-&gt;checkService();\n\n        return $results;\n    }\n\n    private function checkPort() {\n        $connection = @fsockopen($this-&gt;host, $this-&gt;port, $errno, $errstr, 5);\n        if (!$connection) {\n            return [\n                'status' =&gt; 'error',\n                'message' =&gt; \"Port $this-&gt;port is not accessible: $errstr\",\n                'solution' =&gt; 'Check if Redis is running and the port is not blocked'\n            ];\n        }\n        fclose($connection);\n        return ['status' =&gt; 'ok', 'message' =&gt; 'Port is accessible'];\n    }\n\n    private function checkProcess() {\n        exec('tasklist | findstr redis', $output);\n        if (empty($output)) {\n            return [\n                'status' =&gt; 'error',\n                'message' =&gt; 'Redis process not found',\n                'solution' =&gt; 'Start Redis service or check if it\\'s installed properly'\n            ];\n        }\n        return ['status' =&gt; 'ok', 'message' =&gt; 'Redis process is running'];\n    }\n\n    private function checkFirewall() {\n        exec('netsh advfirewall firewall show rule name=\"Redis Server\"', $output);\n        if (empty($output)) {\n            return [\n                'status' =&gt; 'warning',\n                'message' =&gt; 'Redis firewall rule not found',\n                'solution' =&gt; 'Add firewall rule for Redis port'\n            ];\n        }\n        return ['status' =&gt; 'ok', 'message' =&gt; 'Firewall rule exists'];\n    }\n\n    private function checkService() {\n        exec('sc query Redis', $output);\n        $status = implode(\"\\n\", $output);\n        if (strpos($status, 'RUNNING') === false) {\n            return [\n                'status' =&gt; 'error',\n                'message' =&gt; 'Redis service is not running',\n                'solution' =&gt; 'Start Redis service using \"net start Redis\"'\n            ];\n        }\n        return ['status' =&gt; 'ok', 'message' =&gt; 'Redis service is running'];\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$diagnostics = new RedisConnectionDiagnostics();\n$results = $diagnostics-&gt;runDiagnostics();<\/pre>\n\n\n\n<p><strong>2. \u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u305d\u306e\u5bfe\u51e6\u6cd5<\/strong><\/p>\n\n\n<div id=\"id-5c4d77e5-34a4-4ac4-b4de-49eb1bef3448\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8<\/th><th>\u8003\u3048\u3089\u308c\u308b\u539f\u56e0<\/th><th>\u89e3\u6c7a\u65b9\u6cd5<\/th><\/tr><\/thead><tbody><tr><td>Connection refused<\/td><td>Redis\u30b5\u30fc\u30d3\u30b9\u304c\u505c\u6b62\u3057\u3066\u3044\u308b<\/td><td><code>net start Redis<\/code> \u3067\u30b5\u30fc\u30d3\u30b9\u3092\u958b\u59cb<\/td><\/tr><tr><td>Authentication required<\/td><td>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u304c\u5fc5\u8981<\/td><td><code>auth<\/code> \u30b3\u30de\u30f3\u30c9\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6307\u5b9a<\/td><\/tr><tr><td>ERR max number of clients reached<\/td><td>\u63a5\u7d9a\u6570\u306e\u4e0a\u9650\u306b\u9054\u3057\u305f<\/td><td><code>maxclients<\/code> \u306e\u8a2d\u5b9a\u5024\u3092\u5897\u3084\u3059<\/td><\/tr><tr><td>LOADING Redis is loading the dataset in memory<\/td><td>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u30ed\u30fc\u30c9\u4e2d<\/td><td>\u30ed\u30fc\u30c9\u5b8c\u4e86\u307e\u3067\u5f85\u6a5f<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>3. \u30a8\u30e9\u30fc\u30ed\u30b0\u306e\u5206\u6790\u30c4\u30fc\u30eb<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisLogAnalyzer {\n    private $logFile;\n    private $patterns = [\n        'connection_error' =&gt; '\/Connection refused|Connection timed out\/',\n        'auth_error' =&gt; '\/Authentication required|Authentication failed\/',\n        'memory_error' =&gt; '\/Out of memory|Used memory exceeds\/',\n        'syntax_error' =&gt; '\/ERR syntax error|ERR wrong number of arguments\/'\n    ];\n\n    public function __construct($logFile = 'redis.log') {\n        $this-&gt;logFile = $logFile;\n    }\n\n    public function analyzeLog() {\n        if (!file_exists($this-&gt;logFile)) {\n            throw new RuntimeException('Log file not found');\n        }\n\n        $logs = file($this-&gt;logFile);\n        $analysis = [\n            'errors' =&gt; [],\n            'warnings' =&gt; [],\n            'summary' =&gt; []\n        ];\n\n        foreach ($logs as $line) {\n            $this-&gt;categorizeLine($line, $analysis);\n        }\n\n        $this-&gt;generateSummary($analysis);\n        return $analysis;\n    }\n\n    private function categorizeLine($line, &amp;$analysis) {\n        foreach ($this-&gt;patterns as $type =&gt; $pattern) {\n            if (preg_match($pattern, $line)) {\n                $analysis['errors'][$type][] = $line;\n            }\n        }\n    }\n\n    private function generateSummary(&amp;$analysis) {\n        foreach ($analysis['errors'] as $type =&gt; $errors) {\n            $analysis['summary'][$type] = count($errors);\n        }\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-18\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4f4e\u4e0b\u6642\u306e\u5bfe\u51e6\u624b\u9806<\/h3>\n\n\n\n<p><strong>1. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8a3a\u65ad\u30c4\u30fc\u30eb<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisPerformanceDiagnostics {\n    private $redis;\n    private $thresholds = [\n        'memory_usage' =&gt; 0.8,  \/\/ 80%\n        'cpu_usage' =&gt; 0.7,     \/\/ 70%\n        'latency' =&gt; 100,       \/\/ 100ms\n    ];\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    public function checkPerformance() {\n        $metrics = [\n            'memory' =&gt; $this-&gt;checkMemoryUsage(),\n            'commands' =&gt; $this-&gt;checkCommandStats(),\n            'clients' =&gt; $this-&gt;checkClientConnections(),\n            'latency' =&gt; $this-&gt;checkLatency()\n        ];\n\n        return $this-&gt;analyzeMetrics($metrics);\n    }\n\n    private function checkMemoryUsage() {\n        $info = $this-&gt;redis-&gt;info('memory');\n        $usedMemory = $info['used_memory'];\n        $maxMemory = $info['maxmemory'];\n\n        return [\n            'used_percentage' =&gt; ($usedMemory \/ $maxMemory) * 100,\n            'fragmentation_ratio' =&gt; $info['mem_fragmentation_ratio']\n        ];\n    }\n\n    private function checkCommandStats() {\n        $info = $this-&gt;redis-&gt;info('commandstats');\n        $slowCommands = [];\n\n        foreach ($info as $command =&gt; $stats) {\n            if ($stats['avgms'] &gt; $this-&gt;thresholds['latency']) {\n                $slowCommands[$command] = $stats;\n            }\n        }\n\n        return $slowCommands;\n    }\n\n    private function checkClientConnections() {\n        $info = $this-&gt;redis-&gt;info('clients');\n        return [\n            'connected_clients' =&gt; $info['connected_clients'],\n            'blocked_clients' =&gt; $info['blocked_clients'],\n            'max_clients' =&gt; $info['maxclients']\n        ];\n    }\n\n    private function checkLatency() {\n        $start = microtime(true);\n        $this-&gt;redis-&gt;ping();\n        $end = microtime(true);\n\n        return ($end - $start) * 1000; \/\/ \u30df\u30ea\u79d2\u306b\u5909\u63db\n    }\n\n    private function analyzeMetrics($metrics) {\n        $recommendations = [];\n\n        \/\/ \u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u306e\u5206\u6790\n        if ($metrics['memory']['used_percentage'] &gt; $this-&gt;thresholds['memory_usage'] * 100) {\n            $recommendations[] = [\n                'issue' =&gt; 'High memory usage',\n                'solution' =&gt; 'Consider increasing maxmemory or implementing eviction policies'\n            ];\n        }\n\n        \/\/ \u65ad\u7247\u5316\u7387\u306e\u5206\u6790\n        if ($metrics['memory']['fragmentation_ratio'] &gt; 1.5) {\n            $recommendations[] = [\n                'issue' =&gt; 'High memory fragmentation',\n                'solution' =&gt; 'Consider running MEMORY PURGE or restarting Redis server'\n            ];\n        }\n\n        \/\/ \u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u306e\u5206\u6790\n        if (!empty($metrics['commands'])) {\n            $recommendations[] = [\n                'issue' =&gt; 'Slow commands detected',\n                'solution' =&gt; 'Review and optimize the identified slow commands'\n            ];\n        }\n\n        \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u63a5\u7d9a\u306e\u5206\u6790\n        if ($metrics['clients']['connected_clients'] &gt; $metrics['clients']['max_clients'] * 0.8) {\n            $recommendations[] = [\n                'issue' =&gt; 'High number of client connections',\n                'solution' =&gt; 'Implement connection pooling or increase maxclients'\n            ];\n        }\n\n        return $recommendations;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$diagnostics = new RedisPerformanceDiagnostics($redis);\n$recommendations = $diagnostics-&gt;checkPerformance();<\/pre>\n\n\n\n<p><strong>2. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c\u306e\u89e3\u6c7a\u30d5\u30ed\u30fc\u30c1\u30e3\u30fc\u30c8<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">graph TD\n    A[\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4f4e\u4e0b\u691c\u77e5] --&gt; B{\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u30c1\u30a7\u30c3\u30af}\n    B --&gt;|\u9ad8\u3044| C[\u30e1\u30e2\u30ea\u8a2d\u5b9a\u6700\u9069\u5316]\n    B --&gt;|\u6b63\u5e38| D{\u30ec\u30a4\u30c6\u30f3\u30b7\u30fc\u30c1\u30a7\u30c3\u30af}\n    D --&gt;|\u9ad8\u3044| E[\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a3a\u65ad]\n    D --&gt;|\u6b63\u5e38| F{CPU\u4f7f\u7528\u7387\u30c1\u30a7\u30c3\u30af}\n    F --&gt;|\u9ad8\u3044| G[\u30b3\u30de\u30f3\u30c9\u5206\u6790]\n    F --&gt;|\u6b63\u5e38| H{\u63a5\u7d9a\u6570\u30c1\u30a7\u30c3\u30af}\n    H --&gt;|\u591a\u3044| I[\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u30d7\u30fc\u30eb\u898b\u76f4\u3057]\n    C --&gt; J[\u554f\u984c\u89e3\u6c7a]\n    E --&gt; J\n    G --&gt; J\n    I --&gt; J<\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30ac\u30a4\u30c9\u306b\u3088\u308a\u3001\u4e00\u822c\u7684\u306a\u554f\u984c\u306b\u5bfe\u3059\u308b\u52b9\u7387\u7684\u306a\u89e3\u6c7a\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5b9f\u8df5\u7684\u306a\u904b\u7528\u7ba1\u7406\u306e\u30dd\u30a4\u30f3\u30c8\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-19\">\u5b9f\u8df5\u7684\u306a\u904b\u7528\u7ba1\u7406\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-20\">\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u5fa9\u5143\u306e\u81ea\u52d5\u5316<\/h3>\n\n\n\n<p>Windows\u74b0\u5883\u3067\u306eRedis\u30c7\u30fc\u30bf\u306e\u78ba\u5b9f\u306a\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u5fa9\u5143\u306e\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>1. \u81ea\u52d5\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u88c5<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisBackupManager {\n    private $redis;\n    private $backupDir;\n    private $maxBackups;\n\n    public function __construct(Redis $redis, $backupDir = 'C:\/Redis\/backups', $maxBackups = 7) {\n        $this-&gt;redis = $redis;\n        $this-&gt;backupDir = $backupDir;\n        $this-&gt;maxBackups = $maxBackups;\n\n        if (!is_dir($this-&gt;backupDir)) {\n            mkdir($this-&gt;backupDir, 0755, true);\n        }\n    }\n\n    public function createBackup() {\n        $timestamp = date('Y-m-d_H-i-s');\n        $backupFile = \"{$this-&gt;backupDir}\/redis_backup_{$timestamp}.rdb\";\n\n        try {\n            \/\/ \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\n            $this-&gt;redis-&gt;bgsave();\n\n            \/\/ \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u5f85\u6a5f\n            $this-&gt;waitForBackupCompletion();\n\n            \/\/ \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\n            copy('C:\/Redis\/dump.rdb', $backupFile);\n\n            \/\/ \u53e4\u3044\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u524a\u9664\n            $this-&gt;cleanOldBackups();\n\n            return [\n                'status' =&gt; 'success',\n                'file' =&gt; $backupFile,\n                'timestamp' =&gt; $timestamp\n            ];\n        } catch (Exception $e) {\n            return [\n                'status' =&gt; 'error',\n                'message' =&gt; $e-&gt;getMessage()\n            ];\n        }\n    }\n\n    private function waitForBackupCompletion() {\n        $timeout = 60; \/\/ 60\u79d2\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\n        $start = time();\n\n        while (true) {\n            $info = $this-&gt;redis-&gt;info('persistence');\n            if ($info['rdb_bgsave_in_progress'] == 0) {\n                break;\n            }\n\n            if (time() - $start &gt; $timeout) {\n                throw new RuntimeException('Backup timeout');\n            }\n\n            sleep(1);\n        }\n    }\n\n    private function cleanOldBackups() {\n        $files = glob(\"{$this-&gt;backupDir}\/redis_backup_*.rdb\");\n        if (count($files) &gt; $this-&gt;maxBackups) {\n            usort($files, function($a, $b) {\n                return filemtime($a) - filemtime($b);\n            });\n\n            $filesToDelete = array_slice($files, 0, count($files) - $this-&gt;maxBackups);\n            foreach ($filesToDelete as $file) {\n                unlink($file);\n            }\n        }\n    }\n\n    public function restoreBackup($backupFile) {\n        if (!file_exists($backupFile)) {\n            throw new RuntimeException('Backup file not found');\n        }\n\n        try {\n            \/\/ Redis\u30b5\u30fc\u30d3\u30b9\u306e\u505c\u6b62\n            exec('net stop Redis');\n\n            \/\/ \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u5fa9\u5143\n            copy($backupFile, 'C:\/Redis\/dump.rdb');\n\n            \/\/ Redis\u30b5\u30fc\u30d3\u30b9\u306e\u958b\u59cb\n            exec('net start Redis');\n\n            return ['status' =&gt; 'success', 'message' =&gt; 'Backup restored successfully'];\n        } catch (Exception $e) {\n            return ['status' =&gt; 'error', 'message' =&gt; $e-&gt;getMessage()];\n        }\n    }\n}\n\n\/\/ Windows \u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30fc\u7528\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u4f8b\nif (php_sapi_name() === 'cli') {\n    $redis = new Redis();\n    $redis-&gt;connect('127.0.0.1', 6379);\n\n    $backupManager = new RedisBackupManager($redis);\n    $result = $backupManager-&gt;createBackup();\n\n    echo json_encode($result, JSON_PRETTY_PRINT);\n}<\/pre>\n\n\n\n<p><strong>2. \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30bf\u30b9\u30af\u306e\u4f5c\u6210\n$action = New-ScheduledTaskAction `\n    -Execute \"C:\\php\\php.exe\" `\n    -Argument \"C:\\Redis\\scripts\\backup.php\"\n\n$trigger = New-ScheduledTaskTrigger `\n    -Daily `\n    -At \"00:00\"\n\nRegister-ScheduledTask `\n    -TaskName \"RedisBackup\" `\n    -Action $action `\n    -Trigger $trigger `\n    -RunLevel Highest<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-21\">\u76e3\u8996\u4f53\u5236\u306e\u69cb\u7bc9\u65b9\u6cd5<\/h3>\n\n\n\n<p><strong>1. \u76e3\u8996\u30b7\u30b9\u30c6\u30e0\u306e\u5b9f\u88c5<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisMonitor {\n    private $redis;\n    private $alertThresholds;\n    private $notifications;\n\n    public function __construct(Redis $redis, array $thresholds = []) {\n        $this-&gt;redis = $redis;\n        $this-&gt;alertThresholds = array_merge([\n            'memory_usage' =&gt; 80,        \/\/ 80%\n            'client_connections' =&gt; 80,   \/\/ 80%\n            'command_latency' =&gt; 100,    \/\/ 100ms\n            'keyspace_hits_ratio' =&gt; 0.8 \/\/ 80%\n        ], $thresholds);\n\n        $this-&gt;notifications = [];\n    }\n\n    public function monitor() {\n        $metrics = $this-&gt;collectMetrics();\n        $alerts = $this-&gt;analyzeMetrics($metrics);\n\n        if (!empty($alerts)) {\n            $this-&gt;sendAlerts($alerts);\n        }\n\n        $this-&gt;logMetrics($metrics);\n        return $metrics;\n    }\n\n    private function collectMetrics() {\n        $info = $this-&gt;redis-&gt;info();\n\n        \/\/ \u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u306e\u8a08\u7b97\n        $memoryUsage = ($info['used_memory'] \/ $info['maxmemory']) * 100;\n\n        \/\/ \u30ad\u30fc\u30d2\u30c3\u30c8\u7387\u306e\u8a08\u7b97\n        $keyspaceHits = $info['keyspace_hits'];\n        $keyspaceMisses = $info['keyspace_misses'];\n        $hitRatio = $keyspaceHits \/ ($keyspaceHits + $keyspaceMisses);\n\n        return [\n            'timestamp' =&gt; date('Y-m-d H:i:s'),\n            'memory_usage' =&gt; $memoryUsage,\n            'connected_clients' =&gt; $info['connected_clients'],\n            'total_commands_processed' =&gt; $info['total_commands_processed'],\n            'keyspace_hits_ratio' =&gt; $hitRatio,\n            'uptime_in_seconds' =&gt; $info['uptime_in_seconds']\n        ];\n    }\n\n    private function analyzeMetrics($metrics) {\n        $alerts = [];\n\n        if ($metrics['memory_usage'] &gt; $this-&gt;alertThresholds['memory_usage']) {\n            $alerts[] = [\n                'level' =&gt; 'warning',\n                'message' =&gt; \"High memory usage: {$metrics['memory_usage']}%\"\n            ];\n        }\n\n        \/\/ \u305d\u306e\u4ed6\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u5206\u6790...\n\n        return $alerts;\n    }\n\n    private function sendAlerts($alerts) {\n        foreach ($alerts as $alert) {\n            \/\/ \u30a2\u30e9\u30fc\u30c8\u901a\u77e5\u306e\u5b9f\u88c5\uff08\u30e1\u30fc\u30eb\u3001Slack\u7b49\uff09\n            $this-&gt;notifications[] = [\n                'timestamp' =&gt; date('Y-m-d H:i:s'),\n                'alert' =&gt; $alert\n            ];\n        }\n    }\n\n    private function logMetrics($metrics) {\n        $logFile = 'C:\/Redis\/logs\/metrics.log';\n        $logEntry = date('Y-m-d H:i:s') . ' ' . json_encode($metrics) . \"\\n\";\n        file_put_contents($logFile, $logEntry, FILE_APPEND);\n    }\n}\n\n\/\/ Prometheus\u30a8\u30af\u30b9\u30dd\u30fc\u30bf\u30fc\u306e\u5b9f\u88c5\u4f8b\nclass RedisPrometheusExporter {\n    private $redis;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    public function generateMetrics() {\n        $info = $this-&gt;redis-&gt;info();\n\n        $metrics = [\n            'redis_memory_used_bytes' =&gt; $info['used_memory'],\n            'redis_connected_clients' =&gt; $info['connected_clients'],\n            'redis_total_commands_processed' =&gt; $info['total_commands_processed'],\n            'redis_keyspace_hits' =&gt; $info['keyspace_hits'],\n            'redis_keyspace_misses' =&gt; $info['keyspace_misses']\n        ];\n\n        return $this-&gt;formatMetrics($metrics);\n    }\n\n    private function formatMetrics($metrics) {\n        $output = '';\n        foreach ($metrics as $name =&gt; $value) {\n            $output .= \"# TYPE {$name} gauge\\n\";\n            $output .= \"{$name} {$value}\\n\";\n        }\n        return $output;\n    }\n}<\/pre>\n\n\n\n<p><strong>2. \u76e3\u8996\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306e\u8a2d\u5b9a\u4f8b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisDashboard {\n    private $redis;\n    private $metrics = [];\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    public function generateDashboardData() {\n        $this-&gt;collectMetrics();\n\n        return [\n            'system_health' =&gt; $this-&gt;getSystemHealth(),\n            'performance_metrics' =&gt; $this-&gt;getPerformanceMetrics(),\n            'resource_usage' =&gt; $this-&gt;getResourceUsage(),\n            'alerts' =&gt; $this-&gt;getActiveAlerts()\n        ];\n    }\n\n    private function collectMetrics() {\n        $info = $this-&gt;redis-&gt;info();\n        $this-&gt;metrics = $info;\n    }\n\n    private function getSystemHealth() {\n        return [\n            'status' =&gt; $this-&gt;metrics['redis_version'] ? 'healthy' : 'error',\n            'uptime' =&gt; $this-&gt;formatUptime($this-&gt;metrics['uptime_in_seconds']),\n            'connected_clients' =&gt; $this-&gt;metrics['connected_clients'],\n            'last_save_time' =&gt; date('Y-m-d H:i:s', $this-&gt;metrics['rdb_last_save_time'])\n        ];\n    }\n\n    private function getPerformanceMetrics() {\n        return [\n            'commands_per_second' =&gt; $this-&gt;metrics['instantaneous_ops_per_sec'],\n            'hit_rate' =&gt; $this-&gt;calculateHitRate(),\n            'memory_fragmentation' =&gt; $this-&gt;metrics['mem_fragmentation_ratio'],\n            'evicted_keys' =&gt; $this-&gt;metrics['evicted_keys']\n        ];\n    }\n\n    private function calculateHitRate() {\n        $hits = $this-&gt;metrics['keyspace_hits'];\n        $misses = $this-&gt;metrics['keyspace_misses'];\n        return $hits \/ ($hits + $misses) * 100;\n    }\n\n    private function formatUptime($seconds) {\n        $days = floor($seconds \/ 86400);\n        $hours = floor(($seconds % 86400) \/ 3600);\n        $minutes = floor(($seconds % 3600) \/ 60);\n        return \"{$days}d {$hours}h {$minutes}m\";\n    }\n}<\/pre>\n\n\n\n<p><strong>3. \u76e3\u8996\u9805\u76ee\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/strong><\/p>\n\n\n<div id=\"id-84df1348-e898-4624-a7a6-3cb5f68e264c\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30ab\u30c6\u30b4\u30ea<\/th><th>\u76e3\u8996\u9805\u76ee<\/th><th>\u63a8\u5968\u95be\u5024<\/th><th>\u30a2\u30e9\u30fc\u30c8\u512a\u5148\u5ea6<\/th><\/tr><\/thead><tbody><tr><td>\u30e1\u30e2\u30ea<\/td><td>\u4f7f\u7528\u7387<\/td><td>80%<\/td><td>\u9ad8<\/td><\/tr><tr><td>CPU<\/td><td>\u4f7f\u7528\u7387<\/td><td>70%<\/td><td>\u4e2d<\/td><\/tr><tr><td>\u63a5\u7d9a<\/td><td>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u6570<\/td><td>maxclients \u306e 80%<\/td><td>\u4e2d<\/td><\/tr><tr><td>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/td><td>\u30ec\u30a4\u30c6\u30f3\u30b7<\/td><td>100ms<\/td><td>\u9ad8<\/td><\/tr><tr><td>\u30ad\u30fcspace<\/td><td>\u30d2\u30c3\u30c8\u7387<\/td><td>80%<\/td><td>\u4f4e<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u4ee5\u4e0a\u306e\u904b\u7528\u7ba1\u7406\u30dd\u30a4\u30f3\u30c8\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001Windows\u74b0\u5883\u3067\u306eRedis\u904b\u7528\u3092\u52b9\u7387\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":{"0":"post-3337","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-php","7":"nothumb"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3337"}],"version-history":[{"count":2,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3337\/revisions"}],"predecessor-version":[{"id":3339,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3337\/revisions\/3339"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}