{"id":1368,"date":"2014-12-31T21:47:08","date_gmt":"2014-12-31T12:47:08","guid":{"rendered":"http:\/\/tech.akat.info\/?p=1368"},"modified":"2014-12-31T21:47:08","modified_gmt":"2014-12-31T12:47:08","slug":"understanding-rsyslog","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=1368","title":{"rendered":"Understanding rsyslog"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p>http:\/\/www.rsyslog.com\/doc\/queues.html<br \/>\nhttp:\/\/www.rsyslog.com\/doc\/dev_queue.html<br \/>\n\u3092\u3056\u3063\u304f\u308a\u8a33\u3057\u3066\u307f\u305f<\/p>\n<h1>http:\/\/www.rsyslog.com\/doc\/queues.html<\/h1>\n<p>2\u3064\u306eactives\u304c\u63a5\u7d9a\u3092\u5fc5\u8981\u3068\u3059\u308b\u305f\u3081\u3001rsyslogd\u3067\u306fqueue\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u30fb<br \/>\n\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u306f\u5185\u90e8\u306e\u52d5\u304d\u3092\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n<p>\u73fe\u5728\u3001\u30ad\u30e5\u30fc\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u3068actions\u306b\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\nrsyslog\u5185\u90e8\u306b[main message queue]\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u3002<br \/>\n\u5165\u529b\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u305d\u308c\u305e\u308c\u3053\u3053\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5c4a\u3051\u308b\u3002<br \/>\n[main message queue]\u306frsyslog.conf\u3067\u8a2d\u5b9a\u3055\u308c\u305f\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u3082\u3068\u306b<br \/>\n\u30e1\u30bb\u30fc\u30b8\u3092\u632f\u308a\u5206\u3051[action queues]\u3078\u9001\u308b\u3002[action queues]\u3078\u9001\u3089\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306f[main message queue]\u304b\u3089\u524a\u9664\u3055\u308c\u308b<\/p>\n<p>\u3055\u307e\u3056\u307e\u306a[action queues]\u304c\u3042\u308a\u3001\u52d5\u4f5c\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fdirect\u30e2\u30fc\u30c9\u3067\u52d5\u4f5c\u3059\u308b(non-queueing)<br \/>\n[action queues]\u306f\u69d8\u3005\u306a\u8a2d\u5b9a\u3092\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002\u5c06\u6765\u7684\u306b\u306f\u5225\u306e\u5834\u6240\u3067\u30ad\u30e5\u30fc\u3092\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\u306b\u306a\u308b\u306f\u305a\u3002<\/p>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u306f&#8221;MainMsg&#8221; or &#8220;Action&#8221;\u3068\u3044\u3063\u305f\u8a2d\u5b9a\u306e\u4ed5\u65b9\u3092\u5b9f\u65bd\u3002\u4f8b\u3048\u3070\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u6642\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n$MainMsgQueueSaveOnShutdown on<\/p>\n<p>\u540c\u3058\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u3082\u306e\u306f\u4e00\u756a\u6700\u5f8c\u306e\u3082\u306e\u304c\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<br \/>\n\u8a2d\u5b9a\u3092\u3059\u3079\u3066\u8aad\u307f\u8fbc\u3093\u3067\u304b\u3089\u3001[main message queue]\u306f\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n\u30bb\u30ec\u30af\u30bf\u304c\u6307\u5b9a\u3055\u308c\u308b\u3054\u3068\u306b\u30ad\u30e5\u30fc\u304c\u4f5c\u6210\u3055\u308c\u308b\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u3059\u3079\u3066\u306e\u8a2d\u5b9a\u304c\u53cd\u6620\u3055\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u3001\u4f8b\u3048\u3070output module \u306fmulti-threading\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u3002<\/p>\n<h2>Queue Modes<\/h2>\n<p>Rsyslog\u306b\u306f\u3055\u307e\u3056\u307e\u306aqueue\u30e2\u30fc\u30c9\u304c\u3042\u308b\u3002\u9069\u5207\u306a\u30e2\u30fc\u30c9\u3092\u9078\u629e\u3059\u308b\u3079\u3057\u3002\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u7684\u306b\u306fQueueType\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<h2>Direct Queues<\/h2>\n<p>non-queue\u3002\u30ad\u30e5\u30fc\u3082\u30d0\u30c3\u30d5\u30a1\u30fc\u3082\u5229\u7528\u3057\u306a\u3044\u3002\u751f\u7523\u8005\u304b\u3089\u6d88\u8cbb\u8005\u3078\u76f4\u63a5\u6e21\u3059\u3002\u30e1\u30ea\u30c3\u30c8\u3082\u5927\u304d\u3044\u3002<\/p>\n<h2>Disk Queues<\/h2>\n<p>Disk queues use disk drives for buffering.<br \/>\n\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u305f\u3081\u306b\u30c7\u30a3\u30b9\u30af\u3092\u5229\u7528\u3059\u308b\u3002\u3044\u3064\u3082\u30c7\u30a3\u30b9\u30af\u3092\u5229\u7528\u3057\u3001\u30d0\u30c3\u30d5\u30a1\u30e1\u30e2\u30ea\u306f\u4f7f\u7528\u3057\u306a\u3044\u3002<br \/>\n\u30ad\u30e5\u30fc\u306f\u4fe1\u983c\u6027\u304c\u3068\u3066\u3082\u9ad8\u3044\u304c\u3001\u9045\u3044\u30e2\u30fc\u30c9\u3068\u306a\u308b\u3002\u7d76\u5bfe\u306b\u5931\u3063\u3066\u306f\u306a\u3089\u306a\u3044\u30c7\u30fc\u30bf\u306e\u5834\u5408\u306f\u6709\u52b9\u3067\u3042\u308a\u3001\u305d\u308c\u4ee5\u5916\u306f\u63a8\u5968\u3057\u306a\u3044\u3002<\/p>\n<h2>In-Memory Queues<\/h2>\n<p>\u30ad\u30e5\u30fc\u30c7\u30fc\u30bf\u306f\u30e1\u30e2\u30ea\u4e0a\u306b\u4fdd\u6301\u3055\u308c\u308b\u3002\u3064\u307e\u308a\u9ad8\u901f\u3002\u305d\u3057\u3066\u3082\u3061\u308d\u3093\u3001\u30b7\u30b9\u30c6\u30e0\u3084OS\u304c\u505c\u6b62\u3057\u305f\u5834\u5408\u306f\u30ed\u30b0\u306f\u6d88\u5931\u3059\u308b\u3002<br \/>\n\u30ed\u30b0\u304c\u5927\u5207\u306a\u30e2\u30ce\u3067\u3042\u308b\u5834\u5408\u3001UPS\u306a\u3069\u306e\u8a2d\u7f6e\u304c\u5fc5\u8981\u3002<\/p>\n<p>\u6ce8\u610f\u3059\u3079\u304d\u306f\u3001\u30ed\u30b0\u30b5\u30fc\u30d0\u304c\u30c0\u30a6\u30f3\u3057\u305f\u6642\u3001\u30e1\u30e2\u30ea\u4e0a\u306b\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u304c\u306e\u308b\u304c<br \/>\n\u30c7\u30fc\u30bf\u3092\u30e1\u30e2\u30ea\u304b\u3089\u79fb\u52d5\u3055\u305b\u308b\u5fc5\u8981\u306f\u306a\u3044\u3002(\u9577\u671f\u9593\u30e1\u30e2\u30ea\u306b\u4fdd\u6301\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\uff1f\u610f\u5473\u304c\u308f\u304b\u3089\u3093\u3002\u3002)<\/p>\n<p>in-memory\u306b\u306f\u3001LinkedList\u3068FixedArray\u30e2\u30fc\u30c9\u304c\u3042\u308b\u3002<br \/>\n\u30e6\u30fc\u30b6\u30fc\u7684\u306b\u306f\u540c\u3058\u52d5\u304d\u3067\u3042\u308b\u304c\u3001\u5185\u90e8\u7684\u306b\u306f\u9055\u3063\u305f\u52d5\u304d\u3092\u3059\u308b<\/p>\n<p>FixedArray<br \/>\n\u3042\u3089\u304b\u3058\u3081\u9818\u57df\u3092\u4e88\u7d04\u3057\u3066\u304a\u304f\u3002\u4e88\u7d04\u3055\u308c\u305f\u9818\u57df\u306f\u3001\u307b\u3068\u3093\u3069\u304c\u30c7\u30fc\u30bf\u3067\u3001\u6b8b\u308a\u304c\u30dd\u30a4\u30f3\u30bf\u914d\u5217\u3002\u30ad\u30e5\u30fc\u304c\u7a7a\u3060\u3063\u305f\u3068\u3057\u3066\u3082\u30dd\u30a4\u30f3\u30bf\u914d\u5217\u306e\u305f\u3081\u306b\u30e1\u30e2\u30ea\u3092\u6d88\u8cbb\u3059\u308b\u3002\u52d5\u7684\u306a\u52d5\u4f5c\u3084housekeeping\u69cb\u9020\u304c\u5fc5\u8981\u3067\u306a\u3044\u3068\u304d\u306f\u3001\u3082\u3063\u3068\u3082CPU\u4f7f\u7528\u7387\u304c\u4f4e\u304f\u6700\u826f\u306e\u52d5\u4f5c\u3092\u3059\u308b\u3002<br \/>\n\u30ad\u30e5\u30fc\u306e\u8981\u7d20\u304c\u4f4e\u304f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u91cd\u8996\u3059\u308b\u5834\u5408\u306f\u3053\u306e\u30e2\u30fc\u30c9\u304c\u6700\u9069\u3002<br \/>\n\u30ad\u30e5\u30fc\u306b\u5165\u308c\u3089\u308c\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u6570\u306f10,000\u304c\u9650\u754c\u3067\u3059\u3002<\/p>\n<p>LinkedList<br \/>\n\u5168\u304f\u9006\u3002housekeeping\u69cb\u9020\u3067\u3001\u52d5\u7684\u306b\u30e1\u30e2\u30ea\u3092\u8a31\u53ef\u3059\u308b\u3002(\u540d\u524d\u306e\u901a\u308a)<br \/>\n\u591a\u5c11\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3092\u8981\u6c42\u3059\u308b\u304c\u3001\u305d\u308c\u304c\u5fc5\u8981\u306a\u6642\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u3002<br \/>\n\u3088\u308a\u591a\u304f\u306e\u8981\u7d20\u3092\u9806\u756a\u3067\u5f85\u3064\u5fc5\u8981\u304c\u3042\u308b\u6642\u306b\u3001\u3088\u304f\u52d5\u4f5c\u3059\u308b\u3002<br \/>\n\u305f\u3060\u3057\u3001\u6642\u3005\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u7834\u640d\u3059\u308b\u3002\u4f8b\u3048\u3070\u3001\u30e1\u30e2\u30ea\u3092200,000\u30e1\u30c3\u30bb\u30fc\u30b8\u307e\u3067\u3068\u5236\u9650\u3057\u3066\u3044\u305f\u5834\u5408\u3002<br \/>\n\u305f\u3060\u3057\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u3001FixedArray\u30ad\u30e5\u30fc\u306f\u3082\u3063\u3068\u591a\u304f\u306e\u9759\u7684\u30e1\u30e2\u30ea\u3092\u5fc5\u8981\u3068\u3059\u308b\u3002<\/p>\n<p>\u8ff7\u3063\u305f\u3068\u304d\u306fLinkedList\u306e\u9078\u629e\u3092\u63a8\u5968\u3059\u308b\u3002<\/p>\n<p>FixedArray\u3068\u6bd4\u8f03\u3057\u305f\u3068\u304d\u3001\u51e6\u7406\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3068\u3001\u305d\u308c\u3088\u308a\u3082\u30e1\u30e2\u30ea\u306e\u4f7f\u7528\u7387\u304c\u6c17\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u307b\u3068\u3093\u3069\u304c\u4f7f\u7528\u3057\u306a\u3044\u30dd\u30a4\u30f3\u30bf\u3068\u306a\u308b\u6642\u306f\u52d5\u7684\u30e1\u30e2\u30ea\u3088\u308a\u3082\u9045\u304f\u306a\u308b\u3002<\/p>\n<p>Disk-Assisted Memory Queues<br \/>\nin-memory queues\u3067\u3042\u308b\u3068\u304d\u306b\u3001QueueFileName\u3092\u6307\u5b9a\u3057\u305f\u6642\u306b\u81ea\u52d5\u7684\u306b&#8221;disk-assisted&#8221; (DA).\u30e2\u30fc\u30c9\u3068\u306a\u308b<br \/>\n\u30c7\u30fc\u30bf\u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30c7\u30a3\u30b9\u30af\u306b\u8a18\u8f09\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<p>\u3053\u306e\u30e2\u30fc\u30c9\u306f\u3001\u30e1\u30e2\u30ea\u30ad\u30e5\u30fc\uff1aprimary queue\u3068\u30c7\u30a3\u30b9\u30af\u30ad\u30e5\u30fc\uff1aDA queue\u304c\u540c\u6642\u306b\u52d5\u304f\u3088\u3046\u306b\u306a\u308b\u3002<br \/>\nDA queue\u306fprimary queue\u304c\u6e80\u30bf\u30f3\u3082\u3057\u304f\u306f\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u6642\u306b\u5229\u7528\u3055\u308c\u308b\u3002<br \/>\nDisk-Assisted queue\u306f\u7d14\u7c8b\u306a\u30ad\u30e5\u30fc\u3068\u30c7\u30a3\u30b9\u30af\u30ad\u30e5\u30fc\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u3082\u306e\u3002\u57fa\u672c\u7684\u306b\u30e1\u30e2\u30ea\u3060\u3051\u3067\u52d5\u4f5c\u3057\u3001<br \/>\n\u30c7\u30a3\u30b9\u30af\u306b\u89e6\u308c\u308b\u3053\u3068\u306f\u306a\u3044\u3002<\/p>\n<p>\u7121\u5236\u9650\u306e\u91cf\u3092\u30d0\u30c3\u30d5\u30a1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002(\u5b9f\u969b\u306b\u81ea\u7531\u306a\u30c7\u30a3\u30b9\u30af\u30b9\u30da\u30fc\u30b9\u306b\u3088\u3063\u3066\u5236\u9650\u3055\u308c\u308b)<br \/>\nrsyslogd\u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u9650\u308a\u306f\u30ed\u30b0\u3092\u4fdd\u5b88\u3059\u308b\u3002<\/p>\n<p>DA queue\u3067\u306f\u3001\u30c7\u30a3\u30b9\u30af\u7279\u6709\u3068\u30e1\u30e2\u30ea\u7279\u6709\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3067\u304d\u308b\u3002<br \/>\n\u3053\u3053\u307e\u3067\u805e\u304f\u3068\u3001DA queue\u306f\u5b8c\u74a7\u304b\u3068\u3002<\/p>\n<p>DA queues\u306f\u9577\u671f\u9593\u306e\u904b\u7528\u3084\u3001\u9ad8\u3044\u4fe1\u983c\u6027\u304c\u3042\u308b\u3002\u4f8b\u3048\u3070\u3001tcp\u306b\u3066\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\nDA queues\u306b\u3064\u3044\u3066\u3001\u30e1\u30e2\u30ea\u30ad\u30e5\u30fc\u304c\u3044\u3063\u3071\u3044\u306b\u306a\u3063\u305f\u3089\u3059\u3079\u3066\u3092disk\u306b\u66f8\u304d\u8fbc\u3080\u3079\u304d\u3067\u306f\u306a\u3044\u3002<br \/>\n\u305d\u306e\u305f\u3081\u306b\u3088\u308a\u8ce2\u3044\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u3057\u3066\u3001&#8221;high watermark&#8221;\u3068&#8221;low watermark&#8221;\u304c\u3042\u308b\u3002<br \/>\n\u3053\u308c\u3089\u306f\u30ad\u30e5\u30fc\u30a2\u30a4\u30c6\u30e0\u306e\u91cf\u3092\u8868\u3059\u3002<\/p>\n<p>&#8220;high watermark&#8221;\u306b\u9054\u3059\u308b\u3068\u3001disk\u3092\u5229\u7528\u3059\u308b\u3002&#8221;low watermark&#8221;\u306b\u9054\u3059\u308b\u3068\u3001disk\u306e\u5229\u7528\u3092\u3084\u3081\u3001disk\u306f\u7a7a\u306b\u306a\u3063\u3066\u3044\u304d\u3001<br \/>\n\u6700\u7d42\u7684\u306bin-memory\u30e2\u30fc\u30c9\u306e\u307f\u3067\u52d5\u4f5c\u3059\u308b\u3002&#8221;low watermark&#8221;\u4ed8\u8fd1\u306e\u5834\u5408\u306f\u3001\u30e1\u30e2\u30ea\u3078\u8a18\u8f09\u3059\u308b\u3002\u3082\u3057&#8221;high watermark&#8221;\u306b\u9054\u3057\u3066\u3044\u306a\u3051\u308c\u3070disk\u3078\u306e\u8a18\u8f09\u306f\u884c\u308f\u306a\u3044\u3002<br \/>\n\u3053\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u4e0d\u5fc5\u8981\u306a\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f\u3092\u9632\u3050\u3060\u3051\u3067\u306a\u304f\u3001\u8ffd\u52a0\u30d0\u30c3\u30d5\u30a1(\u7dca\u6025\u7528\u306e\u30d0\u30c3\u30d5\u30a1)\u3092\u6b8b\u3059\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308b\u3002<br \/>\n&#8220;high watermark&#8221;\u306a\u3069\u3001\u3057\u3063\u304b\u308a\u8a2d\u8a08\u3057\u306a\u3044\u3068\u30c7\u30a3\u30b9\u30af\u30a2\u30af\u30bb\u30b9\u304c\u591a\u304f\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>\u30a6\u30a9\u30fc\u30bf\u30fc\u30fb\u30de\u30fc\u30af\u306f&#8221;$<object>QueueHighWatermark\u306b\u3088\u3063\u3066\u30bb\u30c3\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059<\/p>\n<h2>Limiting the Queue Size<\/h2>\n<p>\u30c7\u30a3\u30b9\u30af\u30ad\u30e5\u30fc\u3092\u542b\u3080\u3059\u3079\u3066\u306e\u30ad\u30e5\u30fc\u306b\u5236\u9650\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br \/>\n&#8220;$<\u30aa\u30d6\u30b8\u30a7\u30af\u30c8>QueueSize&#8221;\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u8a2d\u5b9a\u53ef\u80fd<br \/>\n\u3053\u308c\u306f\u3001\u30ad\u30e5\u30fc\u306e\u6570\u3092\u5236\u9650\u3057\u3001\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3067\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3002\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u306f\u8a2d\u5b9a\u3067\u304d\u306a\u3044\u3002<br \/>\n\u30b7\u30b9\u30ed\u30b0\u3067\u306f\u5e73\u5747512byte\u3092\u5fc5\u8981\u3068\u3059\u308b\u3002<\/p>\n<p>disk\u306b\u3064\u3044\u3066\u306f\u5236\u9650\u304c\u306a\u3044\u3002\u305f\u3060\u3057\u3001\u4f7f\u3044\u679c\u305f\u3059\u3053\u3068\u306e\u306a\u3044\u3088\u3046\u306b$<\u30aa\u30d6\u30b8\u30a7\u30af\u30c8>QueueMaxDiskSpace\u306b\u3088\u3063\u3066\u5236\u9650\u3067\u304d\u308b\u3002<br \/>\n\u5236\u9650\u306b\u3064\u3044\u3066\u30011KB\u672a\u6e80\u306e\u8aa4\u5dee\u306f\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u53b3\u5bc6\u306b\u7ba1\u7406\u3057\u305f\u3044\u5834\u5408\u306f\u30011G\u306e\u4ee3\u308f\u308a\u306b999,999K\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>Worker Thread Pools<\/h2>\n<p>\u305d\u308c\u305e\u308c\u306e\u30ad\u30e5\u30fc\u306f\u30b9\u30ec\u30c3\u30c9worker\u3068\u3068\u3082\u306b\u52d5\u4f5c\u3059\u308b\u3002<br \/>\n\u30c7\u30fc\u30bf\u304c\u30ad\u30e5\u30fc\u306b\u5165\u3063\u305f\u3089\u305d\u308c\u305e\u308c\u306e\u30b9\u30ec\u30c3\u30c9worker\u304c\u50cd\u304f\u3002<br \/>\n\u4f8b\u3048\u3070main message queue\u306e\u30b9\u30ec\u30c3\u30c9\u306e\u50cd\u304d\u306f\u3001\u5165\u3063\u3066\u304d\u305f\u30c7\u30fc\u30bf\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u3057\u9069\u5207\u306a\u30ad\u30e5\u30fc\u3078\u3044\u308c\u308b\u3002<\/p>\n<p>\u307b\u3068\u3093\u3069\u52d5\u3044\u3066\u3044\u306a\u3044\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001worker\u306f\u52d5\u304b\u306a\u3044\u3002<br \/>\n\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u30ad\u30e5\u30fc\u306b\u5165\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b\u52d5\u4f5c\u3059\u308b\u3002worker\u304c\u7279\u5b9a\u306e\u6570\u4ee5\u4e0a\u52d5\u4f5c\u3059\u308b\u5834\u5408\u3001$<object>QueueWorkerThreadMinimumMessages\u306b\u3088\u3063\u3066\u3001\u305d\u308c\u3092\u5236\u9650\u3067\u304d\u308b\u3002<br \/>\n100\u307b\u3069\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u3042\u308c\u30701worker\u3067\u5bfe\u5fdc\u53ef\u80fd\u3002\u305d\u308c\u4ee5\u4e0a\u3067\u3042\u308b\u5834\u5408\u3001\u3082\u30461worker\u81ea\u52d5\u7684\u306b\u958b\u59cb\u3055\u308c\u308b\u3002<\/p>\n<p>\u591a\u304f\u306eworker\u304c\u8d77\u52d5\u3057\u3066\u3082\u610f\u5473\u304c\u7121\u3044\u305f\u3081\u3001&#8221;$<object>QueueWorkerThreads&#8221;\u306b\u3088\u3063\u3066\u5236\u9650\u3067\u304d\u308b\u3002\u3053\u3053\u306b4\u3068\u3059\u308b\u3068\u3001\u3069\u3093\u306a\u306b\u30c7\u30fc\u30bf\u304c\u591a\u304f\u3066\u30824worker\u4ee5\u4e0a\u306f\u52d5\u4f5c\u3057\u306a\u3044\u3002<\/p>\n<p>&#8220;$<object>QueueWorkerTimeoutThreadShutdown&#8221;\u306b\u3088\u3063\u3066\u3001worker\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u3002-1\u3068\u3059\u308b\u3068\u3001worker\u306f\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u306a\u3044\u3002<\/p>\n<h2>Discarding Messages<\/h2>\n<p>&#8220;discard watermark&#8221;\u306b\u30ad\u30e5\u30fc\u304c\u9054\u3057\u305f\u6642\u3001\u305d\u308c\u307b\u3069\u91cd\u8981\u3067\u306a\u3044\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u7834\u68c4\u53ef\u80fd\u3002\u3053\u306e\u52d5\u4f5c\u306b\u3088\u3063\u3066\u3001\u91cd\u8981\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7834\u68c4\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3002<br \/>\n\u3044\u3064\u3044\u304b\u306a\u308b\u3068\u304d\u3082\u3001&#8221;discard watermark&#8221;\u3092\u8d85\u3048\u305f\u3089\u3001\u60c5\u5831\u30ec\u30d9\u30eb\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u524a\u9664\u3055\u308c\u308b\u3002<\/p>\n<p>\u3053\u306e\u5024\u306f&#8221;$<\u30aa\u30d6\u30b8\u30a7\u30af\u30c8>QueueDiscardMark&#8221;\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3055\u308c\u308b<br \/>\n\u5ec3\u68c4\u3055\u308c\u308b\u5024\u306f&#8221;$<\u30aa\u30d6\u30b8\u30a7\u30af\u30c8>QueueDiscardSeverity&#8221;\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3055\u308c\u308b\u3002\u3053\u3053\u306fRFC3164\u306b\u3066\u5b9a\u7fa9\u3055\u308c\u305f\u6570\u5024\u3092\u5165\u529b\u3059\u308b\u3002<\/p>\n<p>DiscardSeverity\u306e\u304a\u3059\u3059\u3081\u306f8\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u30828\u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<h2>Filled-Up Queues<\/h2>\n<p>\u3082\u3057\u3001\u30e1\u30e2\u30ea\u3082disk\u3082full\u306b\u306a\u3063\u305f\u5834\u5408\u3001\u30c7\u30fc\u30bf\u767b\u9332\u8005\u3092\u6291\u3048\u308b\u3002\u4f8b\u3048\u3070\u3001TCP\u901a\u4fe1\u3084\u30bd\u30b1\u30c3\u30c8\u304b\u3089\u901a\u4fe1\u3055\u308c\u3066\u3044\u308c\u3070\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u51fa\u91cf\u3092\u8abf\u6574\u3059\u308b\u3002\u3053\u308c\u3092throtteling\u30e2\u30fc\u30c9\u3068\u3044\u3046\u3002<\/p>\n<p>\u8abf\u6574\u3057\u3066\u3044\u308b\u9593\u3001disk\u3078\u306e\u66f8\u304d\u8fbc\u307f\u306f\u7d9a\u3051\u3089\u308c\u308b\u3002\u305d\u3057\u3066\u3001\u91cd\u8981\u5ea6\u306e\u4f4e\u3044\u30ad\u30e5\u30fc\u306f\u5ec3\u68c4\u3055\u308c\u308b\u3002\u3064\u307e\u308a\u8abf\u6574\u306b\u3088\u3063\u3066\u554f\u984c\u306f\u89e3\u6c7a\u3055\u308c\u308b<br \/>\n\u305f\u3060\u3057throtteling\u30e2\u30fc\u30c9\u306fUDP\u3068\u540c\u69d8\u306b\u4fe1\u983c\u6027\u304c\u3068\u3066\u3082\u4f4e\u3044\u30e2\u30fc\u30c9\u3002<br \/>\n\u9577\u6642\u9593\u306ethrotteling\u30e2\u30fc\u30c9\u306f\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306b\u652f\u969c\u3092\u304d\u305f\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081&#8221;$<object>QueueTimeoutEnqueue&#8221;\u306b\u3066\u3001\u3053\u306e\u6642\u9593\u7d4c\u904e\u3057\u305f\u3089\u3001\u3059\u3079\u3066\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5ec3\u68c4\u3059\u308b\u3002<br \/>\nthrotteling\u30e2\u30fc\u30c9\u3092\u505c\u6b62\u3055\u305b\u305f\u3044\u3068\u304d\u306f\u30010\u306b\u30bb\u30c3\u30c8\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>Rate limiting<\/h2>\n<p>Rate limiting\u306frsyslogd\u304c\u3088\u308a\u65e9\u304f\u51e6\u7406\u3059\u308b\u3053\u3068\u3092\u59a8\u3052\u308b\u3002<br \/>\n\u73fe\u5728\u3001Rate limiting\u304c\u4f7f\u7528\u51fa\u6765\u308b\u3053\u3068\u306f\u5236\u9650\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\n&#8220;$<object>QueueDequeueSlowdown&#8221;\u3092\u5229\u7528\u3059\u308c\u3070\u30ad\u30e5\u30fc\u306e\u51e6\u7406\u3092\u9045\u304f\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002<\/p>\n<h2>Processing Timeframes<\/h2>\n<p>\u30ad\u30e5\u30fc\u306f\u3042\u308b\u6642\u9593\u5e2f\u3060\u3051\u3001dequeue\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30bb\u30c3\u30c8\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002<br \/>\noff-peak\u6642\u306b\u306e\u307f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8ee2\u9001\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u308a\u3059\u308b\u3002<br \/>\n\u2192\u4f7f\u308f\u306a\u3044\u305f\u3081\u7701\u7565\u3002<\/p>\n<h2>Performance<\/h2>\n<p>\u30ad\u30e5\u30fc\u95a2\u9023\u306e\u30ed\u30c3\u30af\u306f\u5927\u304d\u304f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3002\u3069\u308c\u304f\u3089\u3044\u5927\u304d\u3044\u304b\u3001\u3069\u306e\u304f\u3089\u3044\u306e\u983b\u5ea6\u3067\u8d77\u3053\u308b\u304b\u306f\u8a2d\u5b9a\u306b\u3088\u308b\u3002<br \/>\n\u3057\u304b\u3057\u3001\u30ad\u30e5\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u3068\u304d\u306b\u30d0\u30c3\u30c1\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002\u4e00\u56de\u306e\u30d0\u30c3\u30c1\u3067\u3059\u3079\u3066\u306e\u30ad\u30e5\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3067\u304d\u308b\u3002<br \/>\n&#8220;<object>DequeueBatchSize <number>&#8220;\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n<p>\u30d0\u30c3\u30c1\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5287\u7684\u306b\u6539\u5584\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002<\/p>\n<h2>Terminating Queues<\/h2>\n<p>\u30d7\u30ed\u30bb\u30b9\u306e\u7d42\u4e86\u306f\u8907\u96d1\u3002\u8d77\u52d5\u4e2d\u306e\u30ad\u30e5\u30fc\u306e\u505c\u6b62\u306f\u3082\u3063\u3068\u3082\u8907\u96d1\u306a\u64cd\u4f5c\u3002<br \/>\n\u30ad\u30e5\u30fc\u306e\u4e2d\u306b\u30c7\u30fc\u30bf\u304c\u3042\u308b\u3068\u3088\u308a\u8907\u96d1\u3002&#8221;$<object>QueueTimeoutShutdown&#8221;\u306e\u6642\u9593\u3060\u3051\u30ad\u30e5\u30fc\u51e6\u7406\u306b\u4e0e\u3048\u3089\u308c\u308b\u3002<br \/>\n\u3053\u306e\u6642\u9593\u304c\u7d42\u308f\u3063\u3066\u3082\u30ad\u30e5\u30fc\u306b\u3042\u308b\u30c7\u30fc\u30bf\u306f\u5f37\u5236\u7d42\u4e86\u3055\u305b\u3089\u308c\u308b\u3002<br \/>\n&#8220;$<object>QueueTimeoutActionCompletion&#8221;\u304c\u672c\u8cea\u7684\u306a\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3068\u306a\u308b\u3002<\/p>\n<p>&#8220;$<\u30aa\u30d6\u30b8\u30a7\u30af\u30c8>QueueSaveOnShutdown&#8221;\u3092\u63a8\u5968\u3059\u308b\u3002\u5927\u304d\u306a\u30ad\u30e5\u30fc\u306b\u3064\u3044\u3066\u306f\u3053\u306e\u64cd\u4f5c\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u3053\u3068\u306b\u6ce8\u610f\u3002<\/p>\n<h1>http:\/\/www.rsyslog.com\/doc\/dev_queue.html<\/h1>\n<h2>The rsyslog queue object<\/h2>\n<p>2008-01-17\u306e\u60c5\u5831\u30fb\u672a\u5b8c\u6210\u30fb\u5bfe\u8c61\u306f\u958b\u767a\u8005orRsyslog\u3092\u3082\u3063\u3068\u6df1\u304f\u77e5\u308a\u305f\u3044\u4eba<br \/>\n\u305f\u3060\u3057\u53e4\u3044\u60c5\u5831\u3067\u3042\u308b\u305f\u3081\u3042\u307e\u308a\u4fe1\u983c\u3057\u306a\u3044\u3053\u3068<\/p>\n<h2>Disk-Assisted Mode<\/h2>\n<p>memory type\u306e\u30ad\u30e5\u30fc\u306fdisk-assisted (DA)\u30e2\u30fc\u30c9\u3092\u5229\u7528\u3067\u304d\u308b\u3002DA\u30e2\u30fc\u30c9\u306f\u30ad\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306eprefix\u3055\u3048\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308c\u3070\u5229\u7528\u53ef\u80fd\u3002<br \/>\n\u3053\u308c\u306fDA-enabled\u30e2\u30fc\u30c9\u3068\u3044\u3046\u3002high water mark\u306b\u306a\u308b\u307e\u3067\u306f\u30e1\u30e2\u30ea\u30e2\u30fc\u30c9\u3067\u52d5\u4f5c\u3002\u9054\u3059\u308b\u3068\u3001disk\u306e\u52a9\u3051\u3092\u53d7\u3051\u308b\u3002<br \/>\n\u305d\u306e\u305f\u3081\u306bDA\u30ad\u30e5\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3002\u3053\u306e\u3068\u304d\u306b2\u3064\u306e\u30ad\u30e5\u30fc\u304c\u5b58\u5728<br \/>\nprimary queue\uff1a\u6d88\u8cbb\u8005\u304b\u3089\u3001DA\u30ad\u30e5\u30fc\u6df7\u5408\u306e\u6d88\u8cbb\u8005\u3078\u306a\u308b\u304c\u3001\u672c\u8cea\u7684\u306b\u306fDA\u30ad\u30e5\u30fc\u306e\u30d0\u30c3\u30d5\u30a1\u3002(low water mark\u306b\u9054\u3059\u308b\u307e\u3067\u3001\u3053\u306e\u72b6\u614b)<br \/>\nDA-queue\uff1aprimary\u306e\u6d88\u8cbb\u8005\u3078<br \/>\nDA\u30ad\u30e5\u30fc\u304c\u7a7a\u306b\u306a\u3063\u305f\u5834\u5408\u306f\u3001\u901a\u5e38\u306e\u30e1\u30e2\u30ea\u30e2\u30fc\u30c9\u3078\u623b\u308b\u3002<\/p>\n<p>1\u3064\u306e\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\uff1a<br \/>\nprimary queue\u304c\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u3001\u30ad\u30e5\u30fc\u5185\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u671f\u9593\u5185\u306b\u3059\u3079\u3066\u51e6\u7406\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u3001DA\u30ad\u30e5\u30fc\u304c\u8d77\u52d5\u3057<br \/>\n\u305d\u308c\u3092\u4fdd\u5b58\u3057\u3001\u6b21\u56de\u5bfe\u5fdc\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002\u3053\u308c\u3092&#8221;enqueue-only&#8221;\u3068\u3044\u3046\u3002\u3053\u306e\u9593\u306f\u51e6\u7406\u3055\u308c\u306a\u3044\u3002<\/p>\n<p>\u958b\u59cb\u3068\u7d42\u4e86\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u3044\u3064\u304b\u308f\u304b\u3089\u306a\u3044\u305f\u3081\u30012\u3064\u306e\u30ad\u30e5\u30fc\u306e\u540c\u671f\u3068\u8d77\u52d5\u3068\u7d42\u4e86\u306f\u5c11\u3005\u8907\u96d1\u3002\u3002<\/p>\n<h2>DA Run Mode Initialization<\/h2>\n<p>1.queueEnqObj()\u306e\u9593\u306b\u3001high water mark\u306b\u306a\u3063\u305f\u3068\u304d<br \/>\n2.\u30ad\u30e5\u30fc\u8d77\u52d5\u6642\u306b\u30c7\u30a3\u30b9\u30af\u306b\u30c7\u30fc\u30bf\u304c\u3042\u308b\u5834\u5408<br \/>\n3.\u30e1\u30e2\u30ea\u306b\u30c7\u30fc\u30bf\u3092\u6b8b\u3057\u305f\u307e\u307e\u3001\u30ad\u30e5\u30fc\u304c\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u305f\u5834\u5408<\/p>\n<p>1.\u306b\u3064\u3044\u3066\u3001worker pool\u306f\u8d70\u3063\u3066\u3044\u308b\u3002DA\u30e2\u30fc\u30c9\u306b\u5909\u5316\u3059\u308b\u3068\u304d\u3001\u3059\u3079\u3066\u306eworker\u306f\u7d42\u4e86\u30b3\u30de\u30f3\u30c9\u3092\u9001\u4fe1\u3055\u308c\u308b\u3002<br \/>\nDA worker\u306f\u521d\u671f\u5316\u3055\u308c\u3001\u3057\u3070\u3089\u304f\u65e2\u5b58worker\u3068\u52d5\u4f5c\u3059\u308b\u304b\u3082\u3002\u65e2\u5b58worker\u306f\u51e6\u7406\u304c\u7d42\u308f\u308c\u3070\u7d42\u4e86\u3057\u3001DA\u6d88\u8cbb\u8005\u3092\u7d42\u4e86\u3057\u306a\u3044\u3002<\/p>\n<p>2.\u306fworker pool\u306f\u8d77\u52d5\u3057\u3066\u304a\u3089\u305a\u3001\u958b\u59cb\u3057\u3066\u3044\u306a\u3044\u3002\u305d\u306e\u969b\u306bDAworker\u306f\u958b\u59cb\u3055\u308c\u308b\u3002<\/p>\n<p>3.\u306fworker pool\u306f\u3059\u3067\u306b\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u3066\u3044\u308b\u3002enqueue-only\u30e2\u30fc\u30c9\u3068\u3057\u3066\u52d5\u4f5c\u3059\u308b\u3002<\/p>\n<p>\u3059\u3079\u3066\u306e\u5834\u5408\u3001DAworker\u306f\u30b9\u30bf\u30fc\u30c8\u3057\u3001DA\u30e2\u30fc\u30c9\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u521d\u671f\u5316\u3059\u308b\u3002\u3082\u3063\u3068\u3082\u5927\u5207\u306a\u306e\u306f\u30ad\u30e5\u30fc\u306e\u69cb\u9020\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 http:\/\/www.rsyslog.com\/doc\/queues.html http:\/\/www.rsyslog.com\/doc\/dev_queue.html \u3092\u3056\u3063\u304f\u308a\u8a33\u3057\u3066\u307f\u305f http:\/\/www.rsys [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[54],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1368"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1368"}],"version-history":[{"count":1,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1368\/revisions"}],"predecessor-version":[{"id":1369,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1368\/revisions\/1369"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}