{"id":23379,"date":"2026-03-23T11:54:28","date_gmt":"2026-03-23T02:54:28","guid":{"rendered":"https:\/\/www.ecomottblog.com\/?p=23379"},"modified":"2026-03-23T11:54:28","modified_gmt":"2026-03-23T02:54:28","slug":"%e3%80%90%e6%a4%9c%e8%a8%bc%e3%80%91linux%e3%81%aeulimit%e8%a8%ad%e5%ae%9a%e3%81%8c%e5%8f%8d%e6%98%a0%e3%81%95%e3%82%8c%e3%81%aa%e3%81%84-%e7%90%86%e7%94%b1%e3%82%92%e3%80%8c%e8%b5%b7%e5%8b%95","status":"publish","type":"post","link":"https:\/\/www.ecomottblog.com\/?p=23379","title":{"rendered":"\u3010\u691c\u8a3c\u3011Linux\u306eulimit\u8a2d\u5b9a\u304c\u53cd\u6620\u3055\u308c\u306a\u3044!? \u7406\u7531\u3092\u300c\u8d77\u52d5\u7d4c\u8def\u300d\u304b\u3089\u89e3\u304d\u660e\u304b\u3059"},"content":{"rendered":"<p>Linux\u30b5\u30fc\u30d0\u30fc\u306e\u904b\u7528\u3067\u300c\/etc\/security\/limits.conf \u3092\u66f8\u304d\u63db\u3048\u305f\u306e\u306b\u5b9f\u306f\u53cd\u6620\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u2026\u300d\u3068\u3044\u3046\u7d4c\u9a13\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f \u300c\u78ba\u304b\u306bulimit -n\u3067\u78ba\u8a8d\u3057\u3066\u3044\u305f\u306f\u305a\u306a\u306e\u306b\u3001\u306a\u305c\uff01\uff1f\u300d<br \/>\n\u3053\u306e\u3088\u3046\u306a\u72b6\u614b\u306f\u3001\u3059\u3050\u306b\u3067\u306f\u306a\u304f\u6642\u9593\u304c\u305f\u3063\u3066\u5fd8\u308c\u305f\u3053\u308d\u306b\u554f\u984c\u3068\u3057\u3066\u73fe\u308c\u307e\u3059\u3002\u3002<\/p>\n<p>\u4eca\u56de\u3001\u5b9f\u969b\u306b\u8a73\u7d30\u306a\u6bd4\u8f03\u691c\u8a3c\u3092\u901a\u3058\u3066\u300c\u306a\u305c limits.conf \u3060\u3051\u3067\u306f\u4e0d\u5341\u5206\u3060\u3063\u305f\u306e\u304b\u300d\u305d\u3057\u3066\u300c\u3069\u3046\u3059\u308c\u3070\u5168\u7d4c\u8def\u3067\u78ba\u5b9f\u306b\u8a2d\u5b9a\u3092\u53cd\u6620\u3067\u304d\u308b\u306e\u304b\u300d\u30923\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u89e3\u660e\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u3092\u6a5f\u306b\u3042\u3044\u307e\u3044\u306a\u7406\u89e3\u3092\u6574\u7406\u3057\u3066\u540c\u3058\u5931\u6557\u304c\u8d77\u304d\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n<!--more--><\/p>\n<h2><strong>\u691c\u8a3c\u306e\u6e96\u5099\uff1a\u4f7f\u7528\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7<\/strong><\/h2>\n<p>\u4eca\u56de\u306e\u691c\u8a3c\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u30fb\u7de8\u96c6\u3057\u3066\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002(root\u30e6\u30fc\u30b6\u30fc)<\/p>\n<blockquote><p><strong>\u30fb\/usr\/local\/bin\/sample_app.sh<\/strong>: \u73fe\u5728\u306e ulimit \u5024\u3092\u30ed\u30b0\u51fa\u529b\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<br \/>\n<strong>\u30fb\/etc\/security\/limits.conf<\/strong>: \u5236\u9650\u5024\u3092\u5b9a\u7fa9\u3059\u308b\u30d5\u30a1\u30a4\u30eb<br \/>\n<strong>\u30fb\/etc\/cron.d\/test_cron<\/strong>: system cron\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<br \/>\n<strong>\u30fbcrontab -e<\/strong>:\u30e6\u30fc\u30b6\u30fc\u7528cron\u306e\u8a2d\u5b9a<br \/>\n<strong>\u30fb\/etc\/systemd\/system\/service_manual_app.service<\/strong>: \u624b\u52d5\u3067\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\uff08systemctl start\uff09\u3092\u53e9\u3044\u3066\u691c\u8a3c\u3059\u308b\u305f\u3081\u306e\u30b5\u30fc\u30d3\u30b9\u30d5\u30a1\u30a4\u30eb<br \/>\n<strong>\u30fb\/etc\/systemd\/system\/service_crontab_app.service<\/strong>: \u30e6\u30fc\u30b6\u30fc\u7528cron(crontab)\u304b\u3089\u8d77\u52d5\u3055\u308c\u308b\u691c\u8a3c\u7528\u30b5\u30fc\u30d3\u30b9\u30d5\u30a1\u30a4\u30eb<br \/>\n<strong>\u30fb\/etc\/systemd\/system\/service_crond_app.service<\/strong>: \u30b7\u30b9\u30c6\u30e0\u7528cron(\/etc\/cron.d\/)\u304b\u3089\u8d77\u52d5\u3055\u308c\u308b\u691c\u8a3c\u7528\u30b5\u30fc\u30d3\u30b9\u30d5\u30a1\u30a4\u30eb<\/p><\/blockquote>\n<h3><strong>\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\uff0b\u30ed\u30b0\u51fa\u529b\u7528\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5185\u5bb9<\/strong><\/h3>\n<p>\u3059\u3079\u3066\u306e\u5b9f\u884c\u7d4c\u8def\u3067\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u547c\u3073\u51fa\u3057\u3066 ulimit \u5024\u3092\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"\"># \/usr\/local\/bin\/sample_app.sh\n\n# \u7b2c1\u5f15\u6570\u306b\u5b9f\u884c\u7d4c\u8def\u540d\u3092\u6e21\u3057\u3066\u5b9f\u884c\necho \"Trigger: $1 | PID: $$ | ulimit: $(ulimit -n)\" &gt;&gt; \/tmp\/sample_app.log\n<\/pre>\n<h3>\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\uff16\u3064\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u691c\u8a3c\u3057\u307e\u3059\u3002<\/h3>\n<blockquote><p>\uff1c\u624b\u52d5\uff1a\u76f4\u63a5\u5b9f\u884c\uff1e<br \/>\n\/usr\/local\/bin\/sample_app.sh<br \/>\n\uff1c\u624b\u52d5\uff1a\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\uff1e<br \/>\nsystemctl start service_manual_app<br \/>\n\uff1ccrontab\u8d77\u52d5\uff1a\u76f4\u63a5\u5b9f\u884c\uff1e<br \/>\n* * * * * \/usr\/local\/bin\/sample_app.sh CronTab<br \/>\n\uff1ccrontab\u8d77\u52d5\uff1a\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\uff1e<br \/>\n* * * * * \/usr\/bin\/systemctl start service_crontab_app.service<br \/>\n\uff1ccron.d\u8d77\u52d5\uff1a\u76f4\u63a5\u5b9f\u884c\uff1e<br \/>\n* * * * * root \/usr\/local\/bin\/sample_app.sh CronD<br \/>\n\uff1ccron.d\u8d77\u52d5\uff1a\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\uff1e<br \/>\n* * * * * root \/usr\/bin\/systemctl start service_crond_app.service<\/p><\/blockquote>\n<h2><strong>\u3010STEP 1\u3011\u300climits.conf\u300d\u3060\u3051\u3092\u8a2d\u5b9a\u3057\u305f\u5834\u5408\u306e\u6319\u52d5<\/strong><\/h2>\n<p>\u307e\u305a\u306f\u3001\u591a\u304f\u306e\u65b9\u304c\u6700\u521d\u306b\u884c\u3046\u300climits.conf \u306e\u4fee\u6b63\u300d\u306e\u307f\u3092\u5b9f\u65bd\u3057\u3001\u3069\u3053\u307e\u3067\u8a2d\u5b9a\u304c\u53cd\u6620\u3055\u308c\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<h3><strong>\u8a2d\u5b9a\u5185\u5bb9<\/strong><\/h3>\n<p>\/etc\/security\/limits.conf \u306b\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u8ffd\u8a18\u3002<\/p>\n<pre class=\"\"># \u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30d5\u30a1\u30a4\u30eb\u30aa\u30fc\u30d7\u30f3\u4e0a\u9650\u3092 65535 \u306b\u8a2d\u5b9a\n* soft nofile 65535\n* hard nofile 65535\n<\/pre>\n<h3><strong>\u691c\u8a3c\u7d50\u679c\uff08\u7b2c1\u30d5\u30a7\u30fc\u30ba\uff09<\/strong><\/h3>\n<p>\u305d\u308c\u305e\u308c\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u7d50\u679c\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<table style=\"height: 203px;\" width=\"995\">\n<tbody>\n<tr>\n<td><strong>\u5b9f\u884c\u7d4c\u8def\uff08\u30ed\u30b0\u51fa\u529b\u5185\u5bb9\uff09<\/strong><\/td>\n<td><strong>\u5b9f\u884c\u65b9\u6cd5\u306e\u8a73\u7d30<\/strong><\/td>\n<td><strong>ulimit \u7d50\u679c<\/strong><\/td>\n<td><strong>\u5224\u5b9a<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Manual<\/strong><\/td>\n<td>SSH\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001sample_app.sh\u3092\u624b\u52d5\u3067\u76f4\u63a5\u5b9f\u884c<\/td>\n<td><strong>65535<\/strong><\/td>\n<td>\u3007 \u53cd\u6620<\/td>\n<\/tr>\n<tr>\n<td><strong>CronTab<\/strong><\/td>\n<td>crontab\uff08\u30e6\u30fc\u30b6\u30fc\u7528cron\uff09\u304b\u3089\u76f4\u63a5\u5b9f\u884c<\/td>\n<td><strong>65535<\/strong><\/td>\n<td>\u3007 \u53cd\u6620<\/td>\n<\/tr>\n<tr>\n<td><strong>CronD<\/strong><\/td>\n<td>\/etc\/cron.d\/\uff08\u30b7\u30b9\u30c6\u30e0\u7528cron\uff09\u304b\u3089\u76f4\u63a5\u5b9f\u884c<\/td>\n<td><strong>1024<\/strong><\/td>\n<td>\u00d7&nbsp;<strong>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-Manual<\/strong><\/td>\n<td>\u624b\u52d5\u3067 systemctl start \u3092\u5b9f\u884c\u3057\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5<\/td>\n<td><strong>1024<\/strong><\/td>\n<td>\u00d7&nbsp;<strong>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-CronTab<\/strong><\/td>\n<td>crontab \u304b\u3089 systemctl start \u3092\u547c\u3073\u51fa\u3057<\/td>\n<td><strong>1024<\/strong><\/td>\n<td>\u00d7&nbsp;<strong>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-CronD<\/strong><\/td>\n<td>cron.d \u304b\u3089 systemctl start \u3092\u547c\u3073\u51fa\u3057<\/td>\n<td><strong>1024<\/strong><\/td>\n<td>\u00d7&nbsp;<strong>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u624b\u52d5\u5b9f\u884c\u3068crontab \u4ee5\u5916\u306f\u30b7\u30b9\u30c6\u30e0\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\uff081024\uff09\u306e\u307e\u307e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3><strong>\u3010\u5b9f\u6e2c\u30ed\u30b0\u3011<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23406\" src=\"https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l1.jpg\" alt=\"\" width=\"1006\" height=\"205\" srcset=\"https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l1.jpg 1006w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l1-300x61.jpg 300w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l1-768x157.jpg 768w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l1-304x62.jpg 304w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l1-282x57.jpg 282w\" sizes=\"(max-width: 1006px) 100vw, 1006px\" \/><\/p>\n<p>\u3064\u307e\u308a\u3001\u300ccron.d\u304b\u3089\u8d77\u52d5\u300d\u307e\u305f\u306f\u300c\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\u300d\u306e\u5834\u5408\u306f\u3001limits.conf\u306f\u53cd\u6620\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2><strong>\u306a\u305c\u3053\u3046\u306a\u308b\u306e\u304b\uff1f\uff1aPAM\uff08Pluggable Authentication Modules\uff09\u306e\u4ed5\u7d44\u307f<\/strong><\/h2>\n<p>\u3053\u306e\u5dee\u3092\u751f\u3093\u3067\u3044\u308b\u306e\u306f\u3001Linux\u306e\u8a8d\u8a3c\u3001\u30a2\u30ab\u30a6\u30f3\u30c8\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u5909\u66f4\u306a\u3069\u3092\u4e00\u5143\u7ba1\u7406\u3059\u308b\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308b <strong>PAM\uff08Pluggable Authentication Modules\uff09<\/strong> \u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>PAM\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30ed\u30b0\u30a4\u30f3\u3084\u30bb\u30c3\u30b7\u30e7\u30f3\u958b\u59cb\u6642\u306b\u3001\u8a8d\u8a3c\u3060\u3051\u3067\u306a\u304f\u300c\u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\uff08\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306e\u9069\u7528\u306a\u3069\uff09\u300d\u3092\u52d5\u7684\u306b\u884c\u3046\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\/etc\/security\/limits.conf \u306e\u8a2d\u5b9a\u5024\u306f\u3001PAM\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3072\u3068\u3064\u3067\u3042\u308b pam_limits.so \u304c\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3067\u30d7\u30ed\u30bb\u30b9\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u53cd\u6620\u3055\u308c\u308b\u7d4c\u8def:<\/strong> SSH\u30ed\u30b0\u30a4\u30f3\u3084 crontab\u306f\u3001\u5b9f\u884c\u6642\u306bPAM\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u30b9\u30bf\u30c3\u30af\uff08\/etc\/pam.d\/sshd \u3084 \/etc\/pam.d\/crond\uff09\u3092\u901a\u904e\u3059\u308b\u305f\u3081\u3001limits.conf \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3059\u3002<\/li>\n<li><strong>\u53cd\u6620\u3055\u308c\u306a\u3044\u7d4c\u8def:<\/strong> systemd\uff08\u30b5\u30fc\u30d3\u30b9\uff09\u3084 \/etc\/cron.d \u306f\u3001OS\u8d77\u52d5\u6642\u3084\u30b5\u30fc\u30d3\u30b9\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306e\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u76f4\u63a5\u30d5\u30a9\u30fc\u30af\u3055\u308c\u308b\u305f\u3081\u3001PAM\u306b\u3088\u308b\u30bb\u30c3\u30b7\u30e7\u30f3\u521d\u671f\u5316\u30d7\u30ed\u30bb\u30b9\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u7d50\u679c\u3001limits.conf \u306f\u53c2\u7167\u3055\u308c\u305a\u3001\u89aa\u30d7\u30ed\u30bb\u30b9\u306e\u5236\u9650\u5024\u304c\u305d\u306e\u307e\u307e\u5f15\u304d\u7d99\u304c\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><strong>\u3010STEP 2\u3011\u500b\u5225\u30b5\u30fc\u30d3\u30b9\u306e\u300cLimitNOFILE\u300d\u3092\u6709\u52b9\u5316\u3059\u308b<\/strong><\/h2>\n<p>\u6b21\u306b\u3001\u53cd\u6620\u3055\u308c\u306a\u304b\u3063\u305f\u300c\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\u300d\u3078\u306e\u5bfe\u7b56\u3068\u3057\u3066\u3001\u5404\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u306b\u76f4\u63a5\u5236\u9650\u5024\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u203bLimitNOFILE \u306f\u3001Linux\u306b\u304a\u3044\u3066\u300c1\u3064\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u540c\u6642\u306b\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5927\u6570\uff08\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\uff09\u300d\u3092\u5236\u9650\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u9805\u76ee\u3067\u3059\u3002 \u4e3b\u306b systemd \u306e\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\uff08.service \u30d5\u30a1\u30a4\u30eb\uff09\u5185\u3067\u3001\u7279\u5b9a\u306e\u30b5\u30fc\u30d3\u30b9\u3084\u30c7\u30fc\u30e2\u30f3\u306b\u5bfe\u3057\u3066\u5236\u9650\u3092\u304b\u3051\u308b\u969b\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3><strong>\u8a2d\u5b9a\u5185\u5bb9<\/strong><\/h3>\n<p>\u5404\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\uff08service_manual_app.service \u7b49\uff09\u306b LimitNOFILE \u3092\u8ffd\u8a18\u3002<\/p>\n<pre>[Unit]\nDescription=Sample App Service\n\n[Service]\nType=oneshot\nExecStart=\/bin\/bash \/usr\/local\/bin\/sample_app.sh Service-via-Manual\n\n# \u30b5\u30fc\u30d3\u30b9\u500b\u5225\u306b\u5236\u9650\u5024\u3092\u6307\u5b9a\nLimitNOFILE=1048576\n<\/pre>\n<h3><strong>\u691c\u8a3c\u7d50\u679c\uff08\u7b2c2\u30d5\u30a7\u30fc\u30ba\uff09<\/strong><\/h3>\n<p>\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u7d50\u679c\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<table style=\"height: 214px;\" width=\"825\">\n<tbody>\n<tr>\n<td><strong>\u5b9f\u884c\u7d4c\u8def\uff08\u30ed\u30b0\u51fa\u529b\u5185\u5bb9\uff09<\/strong><\/td>\n<td><strong>ulimit \u7d50\u679c<\/strong><\/td>\n<td><strong>\u63a1\u7528\u3055\u308c\u305f\u8a2d\u5b9a<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Manual<\/strong><\/td>\n<td><strong>65535<\/strong><\/td>\n<td>limits.conf<\/td>\n<\/tr>\n<tr>\n<td><strong>CronTab<\/strong><\/td>\n<td><strong>65535<\/strong><\/td>\n<td>limits.conf<\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-Manual<\/strong><\/td>\n<td><strong>1048576<\/strong><\/td>\n<td><strong>LimitNOFILE (\u53cd\u6620)<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-CronTab<\/strong><\/td>\n<td><strong>1048576<\/strong><\/td>\n<td><strong>LimitNOFILE (\u53cd\u6620)<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-CronD<\/strong><\/td>\n<td><strong>1048576<\/strong><\/td>\n<td><strong>LimitNOFILE (\u53cd\u6620)<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>CronD<\/strong><\/td>\n<td><strong>1024<\/strong><\/td>\n<td>\u00d7&nbsp;<strong>\u4f9d\u7136\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30b5\u30fc\u30d3\u30b9\u7d4c\u7531\u306e\u8d77\u52d5\u306f\u3059\u3079\u3066\u3001\u6307\u5b9a\u3057\u305f 1048576 \u3078\u3068\u53cd\u6620\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h3><strong>\u3010\u5b9f\u6e2c\u30ed\u30b0\u3011<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23408\" src=\"https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l2.jpg\" alt=\"\" width=\"1005\" height=\"202\" srcset=\"https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l2.jpg 1005w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l2-300x60.jpg 300w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l2-768x154.jpg 768w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l2-304x61.jpg 304w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l2-282x57.jpg 282w\" sizes=\"(max-width: 1005px) 100vw, 1005px\" \/><\/p>\n<p>\u3064\u307e\u308a\u3001\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\u306e\u5834\u5408\u306f\u3001\u5404\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306b LimitNOFILE \u3092\u8ffd\u8a18\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3><strong>\u5224\u660e\u3057\u305f\u3053\u3068<\/strong><\/h3>\n<p>systemctl \u3092\u4ecb\u3057\u3066\u8d77\u52d5\u3059\u308b\u3082\u306e\u306f\u3001\u547c\u3073\u51fa\u3057\u5143\u304c\u3069\u3053\u3067\u3042\u3063\u3066\u3082\u3001\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u5185\u306e LimitNOFILE \u304c\u7d76\u5bfe\u7684\u306a\u57fa\u6e96\u3068\u3057\u3066\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4f9d\u7136\u3068\u3057\u3066 \u300ccron.d \u304b\u3089\u76f4\u63a5\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u53e9\u304f\uff08CronD\uff09\u300d \u30d1\u30bf\u30fc\u30f3\u3060\u3051\u304c 1024 \u306e\u307e\u307e\u53d6\u308a\u6b8b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2><strong> \u3010STEP 3\u3011\u300ccron.d\u300d\u76f4\u63a5\u5b9f\u884c\u3092\u3069\u3046\u6551\u3046\u304b\uff1f<\/strong><\/h2>\n<p>\u6700\u5f8c\u306b\u3001\u6b8b\u3063\u3066\u3044\u308b&nbsp;cron.d \u76f4\u63a5\u5b9f\u884c\u3078\u306e\u5bfe\u7b56\u3067\u3059\u3002 \u3053\u308c\u306b\u306f\u300c\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b ulimit \u3092\u66f8\u304f\u300d\u65b9\u6cd5\u3068\u3001\u300c\u89aa\u30d7\u30ed\u30bb\u30b9\u3067\u3042\u308b crond \u81ea\u4f53\u306e\u5236\u9650\u3092\u5f15\u304d\u4e0a\u3052\u308b\uff08systemctl edit\uff09\u300d\u65b9\u6cd5\u306e2\u901a\u308a\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u3088\u308a\u76f4\u63a5\u7684\u306a <strong>\u300c\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3078\u306e\u8ffd\u8a18\u300d<\/strong> \u3067\u691c\u8a3c\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3><strong>\u8a2d\u5b9a\u5185\u5bb9<\/strong><\/h3>\n<p>\/etc\/cron.d\/test_cron \u306e\u8a18\u8ff0\u3092\u3001\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u76f4\u524d\u306b ulimit \u3092\u6307\u5b9a\u3059\u308b\u5f62\u306b\u5909\u66f4\u3002<\/p>\n<pre class=\"\"># \u4fee\u6b63\u5f8c\n* * * * * root ulimit -n 65535 &amp;&amp; \/usr\/local\/bin\/sample_app.sh CronD\n<\/pre>\n<h3><strong>\u691c\u8a3c\u7d50\u679c\uff08\u6700\u7d42\u30d5\u30a7\u30fc\u30ba\uff09<\/strong><\/h3>\n<p>\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u7d50\u679c\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<table style=\"height: 152px;\" width=\"746\">\n<tbody>\n<tr>\n<td><strong>\u5b9f\u884c\u7d4c\u8def\uff08\u30ed\u30b0\u51fa\u529b\u5185\u5bb9\uff09<\/strong><\/td>\n<td><strong>ulimit \u7d50\u679c<\/strong><\/td>\n<td><strong>\u5224\u5b9a<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>CronD<\/strong><\/td>\n<td><strong>65535<\/strong><\/td>\n<td>\u3007&nbsp;<strong>\u6539\u5584 (\u53cd\u6620)<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-CronD<\/strong><\/td>\n<td><strong>1048576<\/strong><\/td>\n<td>\u3007 \u53cd\u6620\u6e08\u307f<\/td>\n<\/tr>\n<tr>\n<td><strong>Service-via-CronTab<\/strong><\/td>\n<td><strong>1048576<\/strong><\/td>\n<td>\u3007 \u53cd\u6620\u6e08\u307f<\/td>\n<\/tr>\n<tr>\n<td><strong>CronTab<\/strong><\/td>\n<td><strong>65535<\/strong><\/td>\n<td>\u3007 \u53cd\u6620\u6e08\u307f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3088\u3046\u3084\u304f\u3001\u3059\u3079\u3066\u306e\u7d4c\u8def\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\uff081024\uff09\u304b\u3089\u306e\u8131\u5374\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3><strong>\u3010\u5b9f\u6e2c\u30ed\u30b0\u3011<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23411\" src=\"https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l3.jpg\" alt=\"\" width=\"1006\" height=\"201\" srcset=\"https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l3.jpg 1006w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l3-300x60.jpg 300w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l3-768x153.jpg 768w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l3-304x61.jpg 304w, https:\/\/www.ecomottblog.com\/wp-content\/uploads\/2026\/03\/l3-282x56.jpg 282w\" sizes=\"(max-width: 1006px) 100vw, 1006px\" \/><\/p>\n<h2><strong>\u307e\u3068\u3081\uff1a\u6700\u7d42\u7684\u306a\u300c\u53cd\u6620\u30d1\u30bf\u30fc\u30f3\u300d\u3092\u6574\u7406<\/strong><\/h2>\n<p>\u4eca\u56de\u306e\u691c\u8a3c\u3067\u660e\u3089\u304b\u306b\u306a\u3063\u305f\u6700\u7d42\u7684\u306a\u7d50\u679c\u3067\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u624b\u52d5\uff08\u76f4\u63a5\u5b9f\u884c\uff09\uff1a<\/strong>limits.conf\u304c\u53cd\u6620\u3055\u308c\u308b<\/li>\n<li><strong>\u624b\u52d5\uff08\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\uff09\uff1a<\/strong> limits.conf\u306f\u53cd\u6620\u3055\u308c\u306a\u3044\u3002LimitNOFILE\u3067\u306e\u6307\u5b9a\u304c\u5fc5\u8981<\/li>\n<li><strong>crontab\u8d77\u52d5\uff08\u76f4\u63a5\u5b9f\u884c\uff09\uff1a<\/strong>limits.conf\u304c\u53cd\u6620\u3055\u308c\u308b<\/li>\n<li><strong>crontab\u8d77\u52d5\uff08\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\uff09\uff1a<\/strong>limits.conf\u306f\u53cd\u6620\u3055\u308c\u306a\u3044\u3002LimitNOFILE\u3067\u306e\u6307\u5b9a\u304c\u5fc5\u8981<\/li>\n<li><strong>cron.d\u8d77\u52d5\uff08\u76f4\u63a5\u5b9f\u884c\uff09\uff1a<\/strong>limits.conf\u306f\u53cd\u6620\u3055\u308c\u306a\u3044\u3002ulimit\u30b3\u30de\u30f3\u30c9\u306e\u4f75\u7528\u3084crond \u81ea\u8eab\u306e\u5236\u9650\u5909\u66f4\u304c\u5fc5\u8981<\/li>\n<li><strong>cron.d\u8d77\u52d5\uff08\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\uff09\uff1a<\/strong>limits.conf\u306f\u53cd\u6620\u3055\u308c\u306a\u3044\u3002LimitNOFILE\u3067\u306e\u6307\u5b9a\u304c\u5fc5\u8981<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u203b\u88dc\u8db3\uff1acron\u306e@reboot\u6307\u5b9a\u3082\u3001\u3053\u306e\u300c\u8d77\u52d5\u7d4c\u8def\u300d\u306e\u4ed5\u7d44\u307f\u306b\u5f93\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u8a18\u8ff0\u7b87\u6240\u304c crontab -e \u304b \/etc\/cron.d\/ \u304b\u306b\u3088\u3063\u3066\u6319\u52d5\u304c\u6c7a\u307e\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u306e\u7d50\u679c\u3092\u8e0f\u307e\u3048\u3066\u3001\u4eca\u5f8c\u610f\u8b58\u3057\u3066\u304a\u304d\u305f\u3044\u30dd\u30a4\u30f3\u30c8<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u300climits.conf \u3092\u66f8\u3044\u305f\u304b\u3089\u5b89\u5fc3\u300d\u306f\u7981\u7269<\/strong><br \/>\n\u7279\u306b\u30b7\u30b9\u30c6\u30e0\u30b5\u30fc\u30d3\u30b9\u3084 cron.d \u306fPAM\u306b\u3088\u308b\u5236\u9650\u9069\u7528\u306e\u5bfe\u8c61\u5916\u3068\u306a\u308b\u30b1\u30fc\u30b9\u304c\u591a\u3044\u3068\u8a8d\u8b58\u3057\u3066\u304a\u304f\u3002<\/li>\n<li><strong>\u30b5\u30fc\u30d3\u30b9\u306b\u306f\u300cLimitNOFILE\u300d\u3092\u30bb\u30c3\u30c8\u3067\u8003\u3048\u308b<\/strong><br \/>\nsystemd \u3067\u7ba1\u7406\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306b\u5236\u9650\u3092\u304b\u3051\u308b\u5834\u5408\u306f\u3001\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u76f4\u63a5 LimitNOFILE \u3092\u8a18\u8f09\u3059\u308b\u3002<\/li>\n<li><strong>\u78ba\u8a8d\u306f\u300c\u672c\u756a\u3068\u540c\u3058\u8d77\u52d5\u7d4c\u8def\u300d\u3067<\/strong><br \/>\n\u30ed\u30b0\u30a4\u30f3\u5f8c\u306e ulimit -n \u306f\u3001\u3042\u304f\u307e\u3067\u300c\u78ba\u8a8d\u306b\u4f7f\u7528\u3057\u305f\u30b7\u30a7\u30eb\u74b0\u5883\u300d\u306b\u304a\u3051\u308b\u7d50\u679c\u3067\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5b9f\u969b\u306b\u8d77\u52d5\u3055\u308c\u308b\u7d4c\u8def\uff08cron\u3084systemd\u306a\u3069\uff09\u3067\u500b\u5225\u306b\u30ed\u30b0\u3092\u51fa\u529b\u3055\u305b\u3001\u8a2d\u5b9a\u304c\u610f\u56f3\u901a\u308a\u306b\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u5b9f\u306b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u8a2d\u5b9a\u6f0f\u308c\u3092\u9632\u3050\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>[ ] <strong>\u305d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f systemctl \u3067\u8d77\u52d5\u3055\u308c\u308b\u304b\uff1f<\/strong><br \/>\n\u2192 \u8d77\u52d5\u3055\u308c\u308b\u306a\u3089\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066 LimitNOFILE \u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/li>\n<li>[ ] <strong>cron\u306f cron.d \u306b\u66f8\u3044\u3066\u3044\u306a\u3044\u304b\uff1f<\/strong><br \/>\n\u2192 \u66f8\u3044\u3066\u3044\u308b\u306a\u3089 limits.conf \u306f\u53cd\u6620\u3055\u308c\u306a\u3044\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3002<\/li>\n<li>[ ] <strong>\u624b\u52d5\u78ba\u8a8d\u3060\u3051\u3067\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\u304b\uff1f<\/strong><br \/>\n\u2192 \u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u7d4c\u7531\u4ee5\u5916\u306e\u7d4c\u8def\uff08\u5b9f\u969b\u306e\u904b\u7528\u74b0\u5883\uff09\u3067\u5fc5\u305a\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u300c\u305d\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u3069\u306e\u7d4c\u8def\u3092\u901a\u3063\u3066\u8d77\u52d5\u3055\u308c\u308b\u304b\u300d\u3092\u898b\u6975\u3081\u3001\u8a2d\u5b9a\u5024\u3092\u300c\u3069\u3053\u306b\u66f8\u304f\u304b\u300d\u3092\u6b63\u3057\u304f\u6c7a\u3081\u308b\u3053\u3068\u304c\u3001\u30c8\u30e9\u30d6\u30eb\u3092\u672a\u7136\u306b\u9632\u3050\u9375\u306b\u306a\u308a\u307e\u3059\uff01<\/p>\n<h6>\u203b\u672c\u691c\u8a3c\u306f RHEL 9.7 \u74b0\u5883\u3067\u5b9f\u65bd\u3057\u305f\u3082\u306e\u3067\u3059\u3002Linux\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\uff08CentOS, Ubuntu, Debian\u7b49\uff09\u3084\u305d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3001\u3042\u308b\u3044\u306f\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306ePAM\u8a2d\u5b9a\u3001systemd\u306e\u4ed5\u69d8\u5909\u66f4\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30dd\u30ea\u30b7\u30fc\uff08SELinux\u7b49\uff09\u3068\u3044\u3063\u305f\u500b\u5225\u306e\u74b0\u5883\u8981\u56e0\u306b\u3088\u308a\u3001\u6319\u52d5\u3084\u7d50\u679c\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u5b9f\u969b\u306b\u8a2d\u5b9a\u3092\u884c\u3046\u969b\u306f\u3001\u3054\u81ea\u8eab\u306e\u74b0\u5883\u306b\u304a\u3044\u3066\u3001\u610f\u56f3\u3057\u305f\u901a\u308a\u306b\u5236\u9650\u5024\u304c\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u5fc5\u305a\u4e8b\u524d\u306b\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/h6>\n<p>&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n\u30a8\u30b3\u30e2\u30c3\u30c8\u3067\u306f\u3001\u3068\u3082\u306b\u672a\u6765\u306e\u5e38\u8b58\u3092\u5275\u308b\u4ef2\u9593\u3092\u52df\u96c6\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nIoT\u306b\u5c11\u3057\u3067\u3082\u8208\u5473\u304c\u3042\u308b\u65b9\u306f\u305c\u3072\u4e0b\u8a18\u306e\u63a1\u7528\u30da\u30fc\u30b8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff01<br \/>\n&nbsp;<\/p>\n<div style=\"margin-bottom: 32px; text-align: center;\"><a style=\"border: solid 1px #1ABB9A; padding: 16px 72px;\" href=\"https:\/\/www.ecomott.co.jp\/recruit\/\" target=\"_blank\" rel=\"noopener\">\u52df\u96c6\u8981\u9805<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u30b5\u30fc\u30d0\u30fc\u306e\u904b\u7528\u3067\u300c\/etc\/security\/limits.conf \u3092\u66f8\u304d\u63db\u3048\u305f\u306e\u306b\u5b9f\u306f\u53cd\u6620\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u2026\u300d\u3068\u3044\u3046\u7d4c\u9a13\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f \u300c\u78ba\u304b\u306bulimit -n\u3067\u78ba\u8a8d\u3057\u3066\u3044\u305f\u306f\u305a\u306a\u306e\u306b\u3001\u306a\u305c\uff01\uff1f\u300d \u3053\u306e [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":23430,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[214],"_links":{"self":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/23379"}],"collection":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23379"}],"version-history":[{"count":49,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/23379\/revisions"}],"predecessor-version":[{"id":23444,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/23379\/revisions\/23444"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/media\/23430"}],"wp:attachment":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}