Discourseのトラフィック過多はリアルなのかDDOSなのか?十分なトラフィックと高性能サーバーにもかかわらずCPU使用率が100%

全8 vCPUの使用率が100%になっています。

site の全8 vCPUの使用率が100%になっています。

ユーザーは頻繁に以下のメッセージを受信しています。

極度の負荷により、一時的にログアウトしたユーザーが閲覧する状態になっています。

Dropletの仕様は以下の通りです:

CPU最適化 / 16 GB / 8 vCPU , Intel Dedicated Digital Ocean Droplet

トラフィック:

Google Analyticsでのリアルタイムのオンラインユーザー数は、執筆時点で約 70〜150 です。

CPUおよびRAM使用率の htop スナップショットは以下の通りです。

Digital Oceanからの過去14日間の使用率グラフ:

App.yamlは以下のようになっています。

db_shared_buffers: “4096MB”
db_work_mem: “400MB”
UNICORN_WORKERS: 16
#- “templates/web.ratelimited.template.yml” #429(リクエストが多すぎる)エラーを回避するために削除 Remove the ip limits

ご覧の通り、実際のトラフィックが非常に少ないにもかかわらず、通常の利用者に429 nginx「リクエストが多すぎる」エラーが発生していたため、レート制限テンプレートをコメントアウトしました。

CFファイアウォールページは以下のようになっています。

ランチャーログ(./launcher logs app)は以下のようになっています。

Prometheusメトリクスは以下のようになっています。

# HELP discourse_collector_working Is the master process collector able to collect metrics
# TYPE discourse_collector_working gauge
discourse_collector_working 1


# HELP discourse_collector_rss total memory used by collector process
# TYPE discourse_collector_rss gauge
discourse_collector_rss 46530560


# HELP discourse_collector_metrics_total Total metrics processed by exporter web.
# TYPE discourse_collector_metrics_total counter
discourse_collector_metrics_total 215465


# HELP discourse_collector_sessions_total Total send_metric sessions processed by exporter web.
# TYPE discourse_collector_sessions_total counter
discourse_collector_sessions_total 7499


# HELP discourse_collector_bad_metrics_total Total mis-handled metrics by collector.
# TYPE discourse_collector_bad_metrics_total counter
discourse_collector_bad_metrics_total 0

# HELP discourse_page_views Page views reported by admin dashboard
# TYPE discourse_page_views counter
discourse_page_views{db="default",type="crawler",device="crawler"} 128620
discourse_page_views{db="default",type="anon",device="mobile"} 2840
discourse_page_views{db="default",type="anon",device="desktop"} 4094
discourse_page_views{db="default",type="logged_in",device="mobile"} 55
discourse_page_views{db="default",type="logged_in",device="desktop"} 64

# HELP discourse_http_requests Total HTTP requests from web app
# TYPE discourse_http_requests counter
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="200"} 166429
discourse_http_requests{db="default",api="web",verb="POST",type="background",status="429"} 19628
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="404"} 3945
discourse_http_requests{db="default",api="web",verb="HEAD",type="regular",status="200"} 154
discourse_http_requests{db="default",api="web",verb="POST",type="regular",status="200"} 2232
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="301"} 152
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="304"} 2295
discourse_http_requests{db="default",api="admin",verb="POST",type="regular",status="200"} 97
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="409"} 141
discourse_http_requests{db="default",api="web",verb="POST",type="background",status="200"} 7540
discourse_http_requests{db="default",api="web",verb="POST",type="background",status="-1"} 1985
discourse_http_requests{db="default",api="admin",verb="POST",type="regular",status="422"} 3
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="500"} 1
discourse_http_requests{db="default",api="web",verb="POST",type="regular",status="302"} 3
discourse_http_requests{db="default",api="web",verb="PUT",type="regular",status="200"} 7
discourse_http_requests{db="default",api="web",verb="GET",type="regular",status="302"} 2

# HELP discourse_http_duration_seconds Time spent in HTTP reqs in seconds
# TYPE discourse_http_duration_seconds summary
discourse_http_duration_seconds{controller="other",action="other",quantile="0.99"} 0.942478418815881
discourse_http_duration_seconds{controller="other",action="other",quantile="0.9"} 0.05924026109278202
discourse_http_duration_seconds{controller="other",action="other",quantile="0.5"} 0.000657188706099987
discourse_http_duration_seconds{controller="other",action="other",quantile="0.1"} 0.0004582637920975685
discourse_http_duration_seconds{controller="other",action="other",quantile="0.01"} 0.0004117507487535477
discourse_http_duration_seconds_sum{controller="other",action="other"} 3942.3923240867443
discourse_http_duration_seconds_count{controller="other",action="other"} 58870
discourse_http_duration_seconds{controller="topics",action="show",quantile="0.99"} 4.58280345518142
discourse_http_duration_seconds{controller="topics",action="show",quantile="0.9"} 2.827586194965988
discourse_http_duration_seconds{controller="topics",action="show",quantile="0.5"} 0.01292009698227048
discourse_http_duration_seconds{controller="topics",action="show",quantile="0.1"} 0.002048521768301725
discourse_http_duration_seconds{controller="topics",action="show",quantile="0.01"} 0.001819557975977659
discourse_http_duration_seconds_sum{controller="topics",action="show"} 128537.17967935232
discourse_http_duration_seconds_count{controller="topics",action="show"} 143926
discourse_http_duration_seconds{controller="list",action="latest",quantile="0.99"} 5.726923605892807
discourse_http_duration_seconds{controller="list",action="latest",quantile="0.9"} 5.168957637157291
discourse_http_duration_seconds{controller="list",action="latest",quantile="0.5"} 0.009740645997226238
discourse_http_duration_seconds{controller="list",action="latest",quantile="0.1"} 0.003163302782922983
discourse_http_duration_seconds{controller="list",action="latest",quantile="0.01"} 0.002744518686085939
discourse_http_duration_seconds_sum{controller="list",action="latest"} 3052.3646773528308
discourse_http_duration_seconds_count{controller="list",action="latest"} 1676
discourse_http_duration_seconds{controller="users",action="show",quantile="0.99"} 0.1768659572117031
discourse_http_duration_seconds{controller="users",action="show",quantile="0.9"} 0.1768659572117031
discourse_http_duration_seconds{controller="users",action="show",quantile="0.5"} 0.1768659572117031
discourse_http_duration_seconds{controller="users",action="show",quantile="0.1"} 0.1768659572117031
discourse_http_duration_seconds{controller="users",action="show",quantile="0.01"} 0.1768659572117031
discourse_http_duration_seconds_sum{controller="users",action="show"} 22.969309298321605
discourse_http_duration_seconds_count{controller="users",action="show"} 142

# HELP discourse_http_redis_duration_seconds Time spent in HTTP reqs in redis seconds
# TYPE discourse_http_redis_duration_seconds summary
discourse_http_redis_duration_seconds{controller="other",action="other",quantile="0.99"} 0.02405449468642473
discourse_http_redis_duration_seconds{controller="other",action="other",quantile="0.9"} 0.0092271463945508
discourse_http_redis_duration_seconds{controller="other",action="other",quantile="0.5"} 0.0
discourse_http_redis_duration_seconds{controller="other",action="other",quantile="0.1"} 0.0
discourse_http_redis_duration_seconds{controller="other",action="other",quantile="0.01"} 0.0
discourse_http_redis_duration_seconds_sum{controller="other",action="other"} 177.52055060770363
discourse_http_redis_duration_seconds_count{controller="other",action="other"} 58870
discourse_http_redis_duration_seconds{controller="topics",action="show",quantile="0.99"} 0.064909300301224
discourse_http_redis_duration_seconds{controller="topics",action="show",quantile="0.9"} 0.03797017782926559
discourse_http_redis_duration_seconds{controller="topics",action="show",quantile="0.5"} 0.007125054951757193
discourse_http_redis_duration_seconds{controller="topics",action="show",quantile="0.1"} 0.0005201729945838451
discourse_http_redis_duration_seconds{controller="topics",action="show",quantile="0.01"} 0.0004380182363092899
discourse_http_redis_duration_seconds_sum{controller="topics",action="show"} 1814.5181179852225
discourse_http_redis_duration_seconds_count{controller="topics",action="show"} 143924
discourse_http_redis_duration_seconds{controller="list",action="latest",quantile="0.99"} 0.03446856886148453
discourse_http_redis_duration_seconds{controller="list",action="latest",quantile="0.9"} 0.02759678149595857
discourse_http_redis_duration_seconds{controller="list",action="latest",quantile="0.5"} 0.004360581748187542
discourse_http_redis_duration_seconds{controller="list",action="latest",quantile="0.1"} 0.001454399898648262
discourse_http_redis_duration_seconds{controller="list",action="latest",quantile="0.01"} 0.00108026061207056
discourse_http_redis_duration_seconds_sum{controller="list",action="latest"} 20.32011368824169
discourse_http_redis_duration_seconds_count{controller="list",action="latest"} 1676
discourse_http_redis_duration_seconds{controller="users",action="show",quantile="0.99"} 0.01075387001037598
discourse_http_redis_duration_seconds{controller="users",action="show",quantile="0.9"} 0.01075387001037598
discourse_http_redis_duration_seconds{controller="users",action="show",quantile="0.5"} 0.01075387001037598
discourse_http_redis_duration_seconds{controller="users",action="show",quantile="0.1"} 0.01075387001037598
discourse_http_redis_duration_seconds{controller="users",action="show",quantile="0.01"} 0.01075387001037598
discourse_http_redis_duration_seconds_sum{controller="users",action="show"} 1.3520850692875683
discourse_http_redis_duration_seconds_count{controller="users",action="show"} 142

# HELP discourse_http_sql_duration_seconds Time spent in HTTP reqs in SQL in seconds
# TYPE discourse_http_sql_duration_seconds summary
discourse_http_sql_duration_seconds{controller="other",action="other",quantile="0.99"} 0.1874205535277724
discourse_http_sql_duration_seconds{controller="other",action="other",quantile="0.9"} 0.009177460800856352
discourse_http_sql_duration_seconds{controller="other",action="other",quantile="0.5"} 0.0
discourse_http_sql_duration_seconds{controller="other",action="other",quantile="0.1"} 0.0
discourse_http_sql_duration_seconds{controller="other",action="other",quantile="0.01"} 0.0
discourse_http_sql_duration_seconds_sum{controller="other",action="other"} 375.05954352673143
discourse_http_sql_duration_seconds_count{controller="other",action="other"} 58870
discourse_http_sql_duration_seconds{controller="topics",action="show",quantile="0.99"} 0.4393073697574437
discourse_http_sql_duration_seconds{controller="topics",action="show",quantile="0.9"} 0.2883010846562684
discourse_http_sql_duration_seconds{controller="topics",action="show",quantile="0.5"} 0.0
discourse_http_sql_duration_seconds{controller="topics",action="show",quantile="0.1"} 0.0
discourse_http_sql_duration_seconds{controller="topics",action="show",quantile="0.01"} 0.0
discourse_http_sql_duration_seconds_sum{controller="topics",action="show"} 13847.843351929914
discourse_http_sql_duration_seconds_count{controller="topics",action="show"} 143926
discourse_http_sql_duration_seconds{controller="list",action="latest",quantile="0.99"} 0.6733640311285853
discourse_http_sql_duration_seconds{controller="list",action="latest",quantile="0.9"} 0.5781291825696826
discourse_http_sql_duration_seconds{controller="list",action="latest",quantile="0.5"} 0.0
discourse_http_sql_duration_seconds{controller="list",action="latest",quantile="0.1"} 0.0
discourse_http_sql_duration_seconds{controller="list",action="latest",quantile="0.01"} 0.0
discourse_http_sql_duration_seconds_sum{controller="list",action="latest"} 324.1082574711181
discourse_http_sql_duration_seconds_count{controller="list",action="latest"} 1676
discourse_http_sql_duration_seconds{controller="users",action="show",quantile="0.99"} 0.07832226948812604
discourse_http_sql_duration_seconds{controller="users",action="show",quantile="0.9"} 0.07832226948812604
discourse_http_sql_duration_seconds{controller="users",action="show",quantile="0.5"} 0.07832226948812604
discourse_http_sql_duration_seconds{controller="users",action="show",quantile="0.1"} 0.07832226948812604
discourse_http_sql_duration_seconds{controller="users",action="show",quantile="0.01"} 0.07832226948812604
discourse_http_sql_duration_seconds_sum{controller="users",action="show"} 9.40852727741003
discourse_http_sql_duration_seconds_count{controller="users",action="show"} 142

# HELP discourse_http_net_duration_seconds Time spent in external network requests
# TYPE discourse_http_net_duration_seconds summary
discourse_http_net_duration_seconds{controller="other",action="other",quantile="0.99"} 0.0
discourse_http_net_duration_seconds{controller="other",action="other",quantile="0.9"} 0.0
discourse_http_net_duration_seconds{controller="other",action="other",quantile="0.5"} 0.0
discourse_http_net_duration_seconds{controller="other",action="other",quantile="0.1"} 0.0
discourse_http_net_duration_seconds{controller="other",action="other",quantile="0.01"} 0.0
discourse_http_net_duration_seconds_sum{controller="other",action="other"} 349.2784005794674
discourse_http_net_duration_seconds_count{controller="other",action="other"} 58870
discourse_http_net_duration_seconds{controller="topics",action="show",quantile="0.99"} 0.0
discourse_http_net_duration_seconds{controller="topics",action="show",quantile="0.9"} 0.0
discourse_http_net_duration_seconds{controller="topics",action="show",quantile="0.5"} 0.0
discourse_http_net_duration_seconds{controller="topics",action="show",quantile="0.1"} 0.0
discourse_http_net_duration_seconds{controller="topics",action="show",quantile="0.01"} 0.0
discourse_http_net_duration_seconds_sum{controller="topics",action="show"} 0.0
discourse_http_net_duration_seconds_count{controller="topics",action="show"} 143926
discourse_http_net_duration_seconds{controller="list",action="latest",quantile="0.99"} 0.0
discourse_http_net_duration_seconds{controller="list",action="latest",quantile="0.9"} 0.0
discourse_http_net_duration_seconds{controller="list",action="latest",quantile="0.5"} 0.0
discourse_http_net_duration_seconds{controller="list",action="latest",quantile="0.1"} 0.0
discourse_http_net_duration_seconds{controller="list",action="latest",quantile="0.01"} 0.0
discourse_http_net_duration_seconds_sum{controller="list",action="latest"} 0.0
discourse_http_net_duration_seconds_count{controller="list",action="latest"} 1676
discourse_http_net_duration_seconds{controller="users",action="show",quantile="0.99"} 0.0
discourse_http_net_duration_seconds{controller="users",action="show",quantile="0.9"} 0.0
discourse_http_net_duration_seconds{controller="users",action="show",quantile="0.5"} 0.0
discourse_http_net_duration_seconds{controller="users",action="show",quantile="0.1"} 0.0
discourse_http_net_duration_seconds{controller="users",action="show",quantile="0.01"} 0.0
discourse_http_net_duration_seconds_sum{controller="users",action="show"} 0.0
discourse_http_net_duration_seconds_count{controller="users",action="show"} 142

# HELP discourse_http_queue_duration_seconds Time spent queueing requests between NGINX and Ruby
# TYPE discourse_http_queue_duration_seconds summary
discourse_http_queue_duration_seconds{controller="other",action="other",quantile="0.99"} 7.055693626403809
discourse_http_queue_duration_seconds{controller="other",action="other",quantile="0.9"} 5.77228569984436
discourse_http_queue_duration_seconds{controller="other",action="other",quantile="0.5"} 3.628639221191406
discourse_http_queue_duration_seconds{controller="other",action="other",quantile="0.1"} 1.691039323806763
discourse_http_queue_duration_seconds{controller="other",action="other",quantile="0.01"} 0.1517226696014404
discourse_http_queue_duration_seconds_sum{controller="other",action="other"} 128979.19509196281
discourse_http_queue_duration_seconds_count{controller="other",action="other"} 58870
discourse_http_queue_duration_seconds{controller="topics",action="show",quantile="0.99"} 6.773485660552979
discourse_http_queue_duration_seconds{controller="topics",action="show",quantile="0.9"} 5.540528535842896
discourse_http_queue_duration_seconds{controller="topics",action="show",quantile="0.5"} 3.386407375335693
discourse_http_queue_duration_seconds{controller="topics",action="show",quantile="0.1"} 1.529008388519287
discourse_http_queue_duration_seconds{controller="topics",action="show",quantile="0.01"} 0.3203737735748291
discourse_http_queue_duration_seconds_sum{controller="topics",action="show"} 358491.9590744972
discourse_http_queue_duration_seconds_count{controller="topics",action="show"} 143926
discourse_http_queue_duration_seconds{controller="list",action="latest",quantile="0.99"} 7.470051765441895
discourse_http_queue_duration_seconds{controller="list",action="latest",quantile="0.9"} 5.970950841903687
discourse_http_queue_duration_seconds{controller="list",action="latest",quantile="0.5"} 3.233286619186401
discourse_http_queue_duration_seconds{controller="list",action="latest",quantile="0.1"} 1.421695709228516
discourse_http_queue_duration_seconds{controller="list",action="latest",quantile="0.01"} 0.4568729400634766
discourse_http_queue_duration_seconds_sum{controller="list",action="latest"} 5290.475468635559
discourse_http_queue_duration_seconds_count{controller="list",action="latest"} 1676
discourse_http_queue_duration_seconds{controller="users",action="show",quantile="0.99"} 5.078022718429565
discourse_http_queue_duration_seconds{controller="users",action="show",quantile="0.9"} 5.078022718429565
discourse_http_queue_duration_seconds{controller="users",action="show",quantile="0.5"} 5.078022718429565
discourse_http_queue_duration_seconds{controller="users",action="show",quantile="0.1"} 5.078022718429565
discourse_http_queue_duration_seconds{controller="users",action="show",quantile="0.01"} 5.078022718429565
discourse_http_queue_duration_seconds_sum{controller="users",action="show"} 381.56648421287537
discourse_http_queue_duration_seconds_count{controller="users",action="show"} 142

# HELP discourse_http_forced_anon_count Total count of logged in requests forced into anonymous mode
# TYPE discourse_http_forced_anon_count counter
discourse_http_forced_anon_count{db="default",api="web",verb="GET",type="regular",status="200"} 38907
discourse_http_forced_anon_count{db="default",api="web",verb="GET",type="regular",status="404"} 1236

# HELP discourse_http_sql_calls_per_request How many SQL statements ran per request
# TYPE discourse_http_sql_calls_per_request gauge
discourse_http_sql_calls_per_request{controller="users",action="show",logged_in="false"} 30
discourse_http_sql_calls_per_request{controller="list",action="latest",logged_in="true"} 271
discourse_http_sql_calls_per_request{controller="topics",action="show",logged_in="true"} 164
discourse_http_sql_calls_per_request{controller="users",action="show",logged_in="true"} 98
discourse_http_sql_calls_per_request{controller="list",action="latest",logged_in="false"} 223
discourse_http_sql_calls_per_request{controller="other",action="other",logged_in="false"} 6
discourse_http_sql_calls_per_request{controller="topics",action="show",logged_in="false"} 136

# HELP discourse_http_anon_cache_store How many a payload is stored in redis for anonymous cache
# TYPE discourse_http_anon_cache_store counter
discourse_http_anon_cache_store{controller="topics",action="show"} 21358
discourse_http_anon_cache_store{controller="other",action="other"} 260
discourse_http_anon_cache_store{controller="list",action="latest"} 286

# HELP discourse_http_anon_cache_hit How many a payload from redis is used for anonymous cache
# TYPE discourse_http_anon_cache_hit counter
discourse_http_anon_cache_hit{controller="other",action="other"} 7507
discourse_http_anon_cache_hit{controller="topics",action="show"} 82761
discourse_http_anon_cache_hit{controller="list",action="latest"} 929

# HELP discourse_heap_free_slots Free ruby heap slots
# TYPE discourse_heap_free_slots gauge
discourse_heap_free_slots{type="sidekiq",pid="131"} 12166
discourse_heap_free_slots{type="web",pid="163"} 119712
discourse_heap_free_slots{type="web",pid="183"} 69322
discourse_heap_free_slots{type="web",pid="454"} 31247
discourse_heap_free_slots{type="web",pid="201"} 162260
discourse_heap_free_slots{type="web",pid="503"} 83322
discourse_heap_free_slots{type="web",pid="308"} 72679
discourse_heap_free_slots{type="web",pid="328"} 79991
discourse_heap_free_slots{type="web",pid="396"} 204322
discourse_heap_free_slots{type="web",pid="219"} 221194
discourse_heap_free_slots{type="web",pid="374"} 122163
discourse_heap_free_slots{type="web",pid="270"} 43722
discourse_heap_free_slots{type="web",pid="418"} 155036
discourse_heap_free_slots{type="web",pid="434"} 158153
discourse_heap_free_slots{type="web",pid="479"} 116781
discourse_heap_free_slots{type="web",pid="350"} 167763
discourse_heap_free_slots{type="web",pid="287"} 95786

# HELP discourse_heap_live_slots Used ruby heap slots
# TYPE discourse_heap_live_slots gauge
discourse_heap_live_slots{type="sidekiq",pid="131"} 883728
discourse_heap_live_slots{type="web",pid="163"} 816121
discourse_heap_live_slots{type="web",pid="183"} 866514
discourse_heap_live_slots{type="web",pid="454"} 904588
discourse_heap_live_slots{type="web",pid="201"} 773576
discourse_heap_live_slots{type="web",pid="503"} 852518
discourse_heap_live_slots{type="web",pid="308"} 903104
discourse_heap_live_slots{type="web",pid="328"} 855035
discourse_heap_live_slots{type="web",pid="396"} 731505
discourse_heap_live_slots{type="web",pid="219"} 714638
discourse_heap_live_slots{type="web",pid="374"} 810818
discourse_heap_live_slots{type="web",pid="270"} 892104
discourse_heap_live_slots{type="web",pid="418"} 780793
discourse_heap_live_slots{type="web",pid="434"} 777678
discourse_heap_live_slots{type="web",pid="479"} 819045
discourse_heap_live_slots{type="web",pid="350"} 768077
discourse_heap_live_slots{type="web",pid="287"} 840051

# HELP discourse_v8_heap_size Total JavaScript V8 heap size (bytes)
# TYPE discourse_v8_heap_size gauge
discourse_v8_heap_size{type="sidekiq",pid="131"} 16392192
discourse_v8_heap_size{type="web",pid="163"} 15900672
discourse_v8_heap_size{type="web",pid="183"} 16424960
discourse_v8_heap_size{type="web",pid="454"} 17702912
discourse_v8_heap_size{type="web",pid="201"} 16433152
discourse_v8_heap_size{type="web",pid="503"} 17440768
discourse_v8_heap_size{type="web",pid="308"} 17178624
discourse_v8_heap_size{type="web",pid="328"} 16424960
discourse_v8_heap_size{type="web",pid="396"} 16162816
discourse_v8_heap_size{type="web",pid="219"} 16171008
discourse_v8_heap_size{type="web",pid="374"} 16171008
discourse_v8_heap_size{type="web",pid="270"} 17219584
discourse_v8_heap_size{type="web",pid="418"} 16957440
discourse_v8_heap_size{type="web",pid="434"} 15908864
discourse_v8_heap_size{type="web",pid="479"} 16654336
discourse_v8_heap_size{type="web",pid="350"} 16949248
discourse_v8_heap_size{type="web",pid="287"} 16654336

# HELP discourse_v8_used_heap_size Total used JavaScript V8 heap size (bytes)
# TYPE discourse_v8_used_heap_size gauge
discourse_v8_used_heap_size{type="sidekiq",pid="131"} 12932148
discourse_v8_used_heap_size{type="web",pid="163"} 12252448
discourse_v8_used_heap_size{type="web",pid="183"} 12526820
discourse_v8_used_heap_size{type="web",pid="454"} 12993364
discourse_v8_used_heap_size{type="web",pid="201"} 12462852
discourse_v8_used_heap_size{type="web",pid="503"} 12626676
discourse_v8_used_heap_size{type="web",pid="308"} 12702604
discourse_v8_used_heap_size{type="web",pid="328"} 12126824
discourse_v8_used_heap_size{type="web",pid="396"} 12269764
discourse_v8_used_heap_size{type="web",pid="219"} 12293912
discourse_v8_used_heap_size{type="web",pid="374"} 12210560
discourse_v8_used_heap_size{type="web",pid="270"} 12628080
discourse_v8_used_heap_size{type="web",pid="418"} 12538324
discourse_v8_used_heap_size{type="web",pid="434"} 12179620
discourse_v8_used_heap_size{type="web",pid="479"} 12715960
discourse_v8_used_heap_size{type="web",pid="350"} 12362024
discourse_v8_used_heap_size{type="web",pid="287"} 12654196

# HELP discourse_v8_physical_size Physical size consumed by V8 heaps
# TYPE discourse_v8_physical_size gauge
discourse_v8_physical_size{type="sidekiq",pid="131"} 14118508
discourse_v8_physical_size{type="web",pid="163"} 13315992
discourse_v8_physical_size{type="web",pid="183"} 13639620
discourse_v8_physical_size{type="web",pid="454"} 14201860
discourse_v8_physical_size{type="web",pid="201"} 13543736
discourse_v8_physical_size{type="web",pid="503"} 13779544
discourse_v8_physical_size{type="web",pid="308"} 13836520
discourse_v8_physical_size{type="web",pid="328"} 13250748
discourse_v8_physical_size{type="web",pid="396"} 13379408
discourse_v8_physical_size{type="web",pid="219"} 13401800
discourse_v8_physical_size{type="web",pid="374"} 13285780
discourse_v8_physical_size{type="web",pid="270"} 13776112
discourse_v8_physical_size{type="web",pid="418"} 13634224
discourse_v8_physical_size{type="web",pid="434"} 13221264
discourse_v8_physical_size{type="web",pid="479"} 13876884
discourse_v8_physical_size{type="web",pid="350"} 13471300
discourse_v8_physical_size{type="web",pid="287"} 13738052

# HELP discourse_v8_heap_count Number of V8 contexts running
# TYPE discourse_v8_heap_count gauge
discourse_v8_heap_count{type="sidekiq",pid="131"} 2
discourse_v8_heap_count{type="web",pid="163"} 2
discourse_v8_heap_count{type="web",pid="183"} 2
discourse_v8_heap_count{type="web",pid="454"} 2
discourse_v8_heap_count{type="web",pid="201"} 2
discourse_v8_heap_count{type="web",pid="503"} 2
discourse_v8_heap_count{type="web",pid="308"} 2
discourse_v8_heap_count{type="web",pid="328"} 2
discourse_v8_heap_count{type="web",pid="396"} 2
discourse_v8_heap_count{type="web",pid="219"} 2
discourse_v8_heap_count{type="web",pid="374"} 2
discourse_v8_heap_count{type="web",pid="270"} 2
discourse_v8_heap_count{type="web",pid="418"} 2
discourse_v8_heap_count{type="web",pid="434"} 2
discourse_v8_heap_count{type="web",pid="479"} 2
discourse_v8_heap_count{type="web",pid="350"} 2
discourse_v8_heap_count{type="web",pid="287"} 2

# HELP discourse_rss Total RSS used by process
# TYPE discourse_rss gauge
discourse_rss{type="sidekiq",pid="131"} 412172288
discourse_rss{type="web",pid="163"} 481796096
discourse_rss{type="web",pid="183"} 485736448
discourse_rss{type="web",pid="454"} 432590848
discourse_rss{type="web",pid="201"} 408793088
discourse_rss{type="web",pid="503"} 400375808
discourse_rss{type="web",pid="308"} 444911616
discourse_rss{type="web",pid="328"} 418308096
discourse_rss{type="web",pid="396"} 413487104
discourse_rss{type="web",pid="219"} 400482304
discourse_rss{type="web",pid="374"} 440221696
discourse_rss{type="web",pid="270"} 501215232
discourse_rss{type="web",pid="418"} 479678464
discourse_rss{type="web",pid="434"} 431116288
discourse_rss{type="web",pid="479"} 428220416
discourse_rss{type="web",pid="350"} 430444544
discourse_rss{type="web",pid="287"} 428658688

# HELP discourse_thread_count Total number of active threads per process
# TYPE discourse_thread_count gauge
discourse_thread_count{type="sidekiq",pid="131"} 22
discourse_thread_count{type="web",pid="163"} 8
discourse_thread_count{type="web",pid="183"} 8
discourse_thread_count{type="web",pid="454"} 8
discourse_thread_count{type="web",pid="201"} 8
discourse_thread_count{type="web",pid="503"} 8
discourse_thread_count{type="web",pid="308"} 8
discourse_thread_count{type="web",pid="328"} 8
discourse_thread_count{type="web",pid="396"} 8
discourse_thread_count{type="web",pid="219"} 8
discourse_thread_count{type="web",pid="374"} 8
discourse_thread_count{type="web",pid="270"} 8
discourse_thread_count{type="web",pid="418"} 8
discourse_thread_count{type="web",pid="434"} 8
discourse_thread_count{type="web",pid="479"} 8
discourse_thread_count{type="web",pid="350"} 8
discourse_thread_count{type="web",pid="287"} 8

# HELP discourse_deferred_jobs_queued Number of jobs queued in the deferred job queue
# TYPE discourse_deferred_jobs_queued gauge
discourse_deferred_jobs_queued{type="sidekiq",pid="131"} 0
discourse_deferred_jobs_queued{type="web",pid="163"} 0
discourse_deferred_jobs_queued{type="web",pid="183"} 0
discourse_deferred_jobs_queued{type="web",pid="454"} 0
discourse_deferred_jobs_queued{type="web",pid="201"} 0
discourse_deferred_jobs_queued{type="web",pid="503"} 0
discourse_deferred_jobs_queued{type="web",pid="308"} 0
discourse_deferred_jobs_queued{type="web",pid="328"} 0
discourse_deferred_jobs_queued{type="web",pid="396"} 0
discourse_deferred_jobs_queued{type="web",pid="219"} 0
discourse_deferred_jobs_queued{type="web",pid="374"} 0
discourse_deferred_jobs_queued{type="web",pid="270"} 0
discourse_deferred_jobs_queued{type="web",pid="418"} 0
discourse_deferred_jobs_queued{type="web",pid="434"} 0
discourse_deferred_jobs_queued{type="web",pid="479"} 0
discourse_deferred_jobs_queued{type="web",pid="350"} 0
discourse_deferred_jobs_queued{type="web",pid="287"} 0

# HELP discourse_active_record_connections_count ActiveRecordの接続プール内の接続の総数
# TYPE discourse_active_record_connections_count gauge
discourse_active_record_connections_count{type="sidekiq",pid="131",status="busy"} 2
discourse_active_record_connections_count{type="sidekiq",pid="131",status="dead"} 0
discourse_active_record_connections_count{type="sidekiq",pid="131",status="idle"} 4
discourse_active_record_connections_count{type="sidekiq",pid="131",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="163",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="163",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="163",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="163",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="183",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="183",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="183",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="183",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="454",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="454",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="454",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="454",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="201",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="201",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="201",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="201",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="503",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="503",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="503",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="503",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="308",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="308",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="308",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="308",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="328",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="328",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="328",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="328",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="396",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="396",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="396",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="396",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="219",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="219",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="219",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="219",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="374",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="374",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="374",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="374",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="270",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="270",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="270",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="270",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="418",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="418",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="418",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="418",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="434",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="434",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="434",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="434",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="479",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="479",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="479",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="479",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="350",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="350",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="350",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="350",status="waiting"} 0
discourse_active_record_connections_count{type="web",pid="287",status="busy"} 1
discourse_active_record_connections_count{type="web",pid="287",status="dead"} 0
discourse_active_record_connections_count{type="web",pid="287",status="idle"} 1
discourse_active_record_connections_count{type="web",pid="287",status="waiting"} 0

# HELP discourse_active_record_failover_count フェイルオーバー状態にあるActiveRecordデータベースの数
# TYPE discourse_active_record_failover_count gauge
discourse_active_record_failover_count{type="sidekiq",pid="131"} 0
discourse_active_record_failover_count{type="web",pid="163"} 0
discourse_active_record_failover_count{type="web",pid="183"} 0
discourse_active_record_failover_count{type="web",pid="454"} 0
discourse_active_record_failover_count{type="web",pid="201"} 0
discourse_active_record_failover_count{type="web",pid="503"} 0
discourse_active_record_failover_count{type="web",pid="308"} 0
discourse_active_record_failover_count{type="web",pid="328"} 0
discourse_active_record_failover_count{type="web",pid="396"} 0
discourse_active_record_failover_count{type="web",pid="219"} 0
discourse_active_record_failover_count{type="web",pid="374"} 0
discourse_active_record_failover_count{type="web",pid="270"} 0
discourse_active_record_failover_count{type="web",pid="418"} 0
discourse_active_record_failover_count{type="web",pid="434"} 0
discourse_active_record_failover_count{type="web",pid="479"} 0
discourse_active_record_failover_count{type="web",pid="350"} 0
discourse_active_record_failover_count{type="web",pid="287"} 0

# HELP discourse_redis_failover_count フェイルオーバー状態にあるRedisサーバーの数
# TYPE discourse_redis_failover_count gauge
discourse_redis_failover_count{type="sidekiq",pid="131"} 0
discourse_redis_failover_count{type="web",pid="163"} 0
discourse_redis_failover_count{type="web",pid="183"} 0
discourse_redis_failover_count{type="web",pid="454"} 0
discourse_redis_failover_count{type="web",pid="201"} 0
discourse_redis_failover_count{type="web",pid="503"} 0
discourse_redis_failover_count{type="web",pid="308"} 0
discourse_redis_failover_count{type="web",pid="328"} 0
discourse_redis_failover_count{type="web",pid="396"} 0
discourse_redis_failover_count{type="web",pid="219"} 0
discourse_redis_failover_count{type="web",pid="374"} 0
discourse_redis_failover_count{type="web",pid="270"} 0
discourse_redis_failover_count{type="web",pid="418"} 0
discourse_redis_failover_count{type="web",pid="434"} 0
discourse_redis_failover_count{type="web",pid="479"} 0
discourse_redis_failover_count{type="web",pid="350"} 0
discourse_redis_failover_count{type="web",pid="287"} 0

# HELP discourse_major_gc_count プロセスごとのメジャーGC操作数
# TYPE discourse_major_gc_count counter
discourse_major_gc_count{type="sidekiq",pid="131"} 39
discourse_major_gc_count{type="web",pid="163"} 902
discourse_major_gc_count{type="web",pid="183"} 848
discourse_major_gc_count{type="web",pid="454"} 881
discourse_major_gc_count{type="web",pid="201"} 896
discourse_major_gc_count{type="web",pid="503"} 849
discourse_major_gc_count{type="web",pid="308"} 878
discourse_major_gc_count{type="web",pid="328"} 888
discourse_major_gc_count{type="web",pid="396"} 882
discourse_major_gc_count{type="web",pid="219"} 897
discourse_major_gc_count{type="web",pid="374"} 919
discourse_major_gc_count{type="web",pid="270"} 883
discourse_major_gc_count{type="web",pid="418"} 921
discourse_major_gc_count{type="web",pid="434"} 853
discourse_major_gc_count{type="web",pid="479"} 923
discourse_major_gc_count{type="web",pid="350"} 909
discourse_major_gc_count{type="web",pid="287"} 823

# HELP discourse_minor_gc_count プロセスごとのマイナーGC操作数
# TYPE discourse_minor_gc_count counter
discourse_minor_gc_count{type="sidekiq",pid="131"} 251
discourse_minor_gc_count{type="web",pid="163"} 8220
discourse_minor_gc_count{type="web",pid="183"} 8171
discourse_minor_gc_count{type="web",pid="454"} 8435
discourse_minor_gc_count{type="web",pid="201"} 8249
discourse_minor_gc_count{type="web",pid="503"} 8252
discourse_minor_gc_count{type="web",pid="308"} 8356
discourse_minor_gc_count{type="web",pid="328"} 8276
discourse_minor_gc_count{type="web",pid="396"} 8377
discourse_minor_gc_count{type="web",pid="219"} 8311
discourse_minor_gc_count{type="web",pid="374"} 8521
discourse_minor_gc_count{type="web",pid="270"} 8256
discourse_minor_gc_count{type="web",pid="418"} 8503
discourse_minor_gc_count{type="web",pid="434"} 8332
discourse_minor_gc_count{type="web",pid="479"} 8577
discourse_minor_gc_count{type="web",pid="350"} 8480
discourse_minor_gc_count{type="web",pid="287"} 8241

# HELP discourse_total_allocated_objects プロセスごとの割り当てられたオブジェクトの総数
# TYPE discourse_total_allocated_objects counter
discourse_total_allocated_objects{type="sidekiq",pid="131"} 30060560
discourse_total_allocated_objects{type="web",pid="163"} 985232557
discourse_total_allocated_objects{type="web",pid="183"} 983805640
discourse_total_allocated_objects{type="web",pid="454"} 1008867616
discourse_total_allocated_objects{type="web",pid="201"} 988967755
discourse_total_allocated_objects{type="web",pid="503"} 998885290
discourse_total_allocated_objects{type="web",pid="308"} 1004069224
discourse_total_allocated_objects{type="web",pid="328"} 996554004
discourse_total_allocated_objects{type="web",pid="396"} 1013631939
discourse_total_allocated_objects{type="web",pid="219"} 999330059
discourse_total_allocated_objects{type="web",pid="374"} 1016924963
discourse_total_allocated_objects{type="web",pid="270"} 989042711
discourse_total_allocated_objects{type="web",pid="418"} 1024175277
discourse_total_allocated_objects{type="web",pid="434"} 1004407864
discourse_total_allocated_objects{type="web",pid="479"} 1025782126
discourse_total_allocated_objects{type="web",pid="350"} 1013371770
discourse_total_allocated_objects{type="web",pid="287"} 1003799360

# HELP discourse_scheduled_job_duration_seconds スケジュール済みジョブに費やされた総時間
# TYPE discourse_scheduled_job_duration_seconds counter
discourse_scheduled_job_duration_seconds{job_name="Jobs::PendingUsersReminder"} 0.644000000000000011e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::WhosOnlineGoingOffline"} 0.5267999999999998071e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::PresenceChannelAutoLeave"} 0.6388000000000000119e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::ProcessBadgeBacklog"} 0.25297000000000000432e2
discourse_scheduled_job_duration_seconds{job_name="Jobs::TopicTimerEnqueuer"} 0.5947000000000000053e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::Heartbeat"} 0.1635000000000000038e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::ProcessShelvedNotifications"} 0.1221000000000000029e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::EnqueueOnceoffs"} 0.4557000000000000043e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::BookmarkReminderNotifications"} 0.1019000000000000007e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::CleanUpUploads"} 0.138000000000000002e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::PollMailbox"} 0.851000000000000004e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::TopRefreshToday"} 13.684000000000001
discourse_scheduled_job_duration_seconds{job_name="Jobs::DestroyOldDeletionStubs"} 0.272400000000000003e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::ActivationReminderEmails"} 0.096
discourse_scheduled_job_duration_seconds{job_name="Jobs::UnsilenceUsers"} 0.8790000000000002
discourse_scheduled_job_duration_seconds{job_name="Jobs::PeriodicalUpdates"} 0.1145550000000000045e3
discourse_scheduled_job_duration_seconds{job_name="Jobs::MigrateUploadScheme"} 0.388000000000000004e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::AboutStats"} 2.139
discourse_scheduled_job_duration_seconds{job_name="Jobs::CheckOutOfDateThemes"} 1.68
discourse_scheduled_job_duration_seconds{job_name="Jobs::EnqueueDigestEmails"} 0.156000000000000008e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::DirectoryRefreshDaily"} 0.43910000000000002e1
discourse_scheduled_job_duration_seconds{job_name="Jobs::DashboardStats"} 0.153000000000000009e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::PendingReviewablesReminder"} 0.060000000000000005
discourse_scheduled_job_duration_seconds{job_name="Jobs::CreateMissingAvatars"} 0.200000000000000005e0
discourse_scheduled_job_duration_seconds{job_name="Jobs::UpdateAnimatedUploads"} 0.133
discourse_scheduled_job_duration_seconds{job_name="Jobs::EnqueueSuspectUsers"} 0.12100000000000001
discourse_scheduled_job_duration_seconds{job_name="Jobs::UpdateSitemaps"} 3.831
discourse_scheduled_job_duration_seconds{job_name="Jobs::PendingQueuedPostsReminder"} 2.649
discourse_scheduled_job_duration_seconds{job_name="Jobs::ReindexSearch"} 1.431
discourse_scheduled_job_duration_seconds{job_name="Jobs::DisableBootstrapMode"} 0.038
discourse_scheduled_job_duration_seconds{job_name="Jobs::CleanUpUnusedStagedUsers"} 0.065

# HELP discourse_scheduled_job_count 実行されたスケジュール済みジョブの総数
# TYPE discourse_scheduled_job_count counter
discourse_scheduled_job_count{job_name="Jobs::PendingUsersReminder"} 38
discourse_scheduled_job_count{job_name="Jobs::WhosOnlineGoingOffline"} 187
discourse_scheduled_job_count{job_name="Jobs::PresenceChannelAutoLeave"} 187
discourse_scheduled_job_count{job_name="Jobs::ProcessBadgeBacklog"} 188
discourse_scheduled_job_count{job_name="Jobs::TopicTimerEnqueuer"} 187
discourse_scheduled_job_count{job_name="Jobs::Heartbeat"} 63
discourse_scheduled_job_count{job_name="Jobs::ProcessShelvedNotifications"} 38
discourse_scheduled_job_count{job_name="Jobs::EnqueueOnceoffs"} 19
discourse_scheduled_job_count{job_name="Jobs::BookmarkReminderNotifications"} 38
discourse_scheduled_job_count{job_name="Jobs::CleanUpUploads"} 4
discourse_scheduled_job_count{job_name="Jobs::PollMailbox"} 38
discourse_scheduled_job_count{job_name="Jobs::TopRefreshToday"} 4
discourse_scheduled_job_count{job_name="Jobs::DestroyOldDeletionStubs"} 7
discourse_scheduled_job_count{job_name="Jobs::ActivationReminderEmails"} 2
discourse_scheduled_job_count{job_name="Jobs::UnsilenceUsers"} 13
discourse_scheduled_job_count{job_name="Jobs::PeriodicalUpdates"} 13
discourse_scheduled_job_count{job_name="Jobs::MigrateUploadScheme"} 19
discourse_scheduled_job_count{job_name="Jobs::AboutStats"} 6
discourse_scheduled_job_count{job_name="Jobs::CheckOutOfDateThemes"} 1
discourse_scheduled_job_count{job_name="Jobs::EnqueueDigestEmails"} 7
discourse_scheduled_job_count{job_name="Jobs::DirectoryRefreshDaily"} 3
discourse_scheduled_job_count{job_name="Jobs::DashboardStats"} 6
discourse_scheduled_job_count{job_name="Jobs::PendingReviewablesReminder"} 3
discourse_scheduled_job_count{job_name="Jobs::CreateMissingAvatars"} 3
discourse_scheduled_job_count{job_name="Jobs::UpdateAnimatedUploads"} 3
discourse_scheduled_job_count{job_name="Jobs::EnqueueSuspectUsers"} 2
discourse_scheduled_job_count{job_name="Jobs::UpdateSitemaps"} 3
discourse_scheduled_job_count{job_name="Jobs::PendingQueuedPostsReminder"} 3
discourse_scheduled_job_count{job_name="Jobs::ReindexSearch"} 1
discourse_scheduled_job_count{job_name="Jobs::DisableBootstrapMode"} 1
discourse_scheduled_job_count{job_name="Jobs::CleanUpUnusedStagedUsers"} 1

# HELP discourse_sidekiq_job_duration_seconds Sidekiqジョブに費やされた総時間
# TYPE discourse_sidekiq_job_duration_seconds counter
discourse_sidekiq_job_duration_seconds{job_name="Jobs::RunHeartbeat"} 0.226169511675834654e0
discourse_sidekiq_job_duration_seconds{job_name="Jobs::NotifyMailingListSubscribers"} 0.8942126949783414593e1
discourse_sidekiq_job_duration_seconds{job_name="Jobs::PullHotlinkedImages"} 0.8282361692283302553e1
discourse_sidekiq_job_duration_seconds{job_name="Jobs::FeatureTopicUsers"} 0.1046757272724062204e2
discourse_sidekiq_job_duration_seconds{job_name="Jobs::BotInput"} 0.114331910074222833095e3
discourse_sidekiq_job_duration_seconds{job_name="Jobs::PostUpdateTopicTrackingState"} 0.17196641702670603947e2
discourse_sidekiq_job_duration_seconds{job_name="Jobs::CrawlTopicLink"} 0.1373126078015193336375e3
discourse_sidekiq_job_duration_seconds{job_name="Jobs::PostAlert"} 0.22092239051265641677e3
discourse_sidekiq_job_duration_seconds{job_name="Jobs::ProcessPost"} 0.30518020779779181136e3

# HELP discourse_sidekiq_job_count 実行されたSidekiqジョブの総数
# TYPE discourse_sidekiq_job_count counter
discourse_sidekiq_job_count{job_name="Jobs::RunHeartbeat"} 63
discourse_sidekiq_job_count{job_name="Jobs::NotifyMailingListSubscribers"} 94
discourse_sidekiq_job_count{job_name="Jobs::PullHotlinkedImages"} 100
discourse_sidekiq_job_count{job_name="Jobs::FeatureTopicUsers"} 101
discourse_sidekiq_job_count{job_name="Jobs::BotInput"} 217
discourse_sidekiq_job_count{job_name="Jobs::PostUpdateTopicTrackingState"} 101
discourse_sidekiq_job_count{job_name="Jobs::CrawlTopicLink"} 414
discourse_sidekiq_job_count{job_name="Jobs::PostAlert"} 106
discourse_sidekiq_job_count{job_name="Jobs::ProcessPost"} 106

# HELP discourse_postgres_readonly_mode PostgreSQLのフェイルオーバーによりサイトが読み取り専用モードかどうかを示します
# TYPE discourse_postgres_readonly_mode gauge
discourse_postgres_readonly_mode 0

# HELP discourse_redis_master_available マスターRedisへのアクティブな接続があるかどうか
# TYPE discourse_redis_master_available gauge
discourse_redis_master_available 1

# HELP discourse_redis_slave_available Redisスレーブへのアクティブな接続があるかどうか
# TYPE discourse_redis_slave_available gauge
discourse_redis_slave_available 0

# HELP discourse_postgres_master_available マスターPostgreSQLへのアクティブな接続があるかどうか
# TYPE discourse_postgres_master_available gauge
discourse_postgres_master_available 1

# HELP discourse_postgres_replica_available リプリカPostgreSQLへのアクティブな接続があるかどうか
# TYPE discourse_postgres_replica_available gauge


# HELP discourse_active_app_reqs 進行中のアクティブなWebリクエストの数
# TYPE discourse_active_app_reqs gauge
discourse_active_app_reqs 16

# HELP discourse_queued_app_reqs キューに積まれたWebリクエストの数
# TYPE discourse_queued_app_reqs gauge
discourse_queued_app_reqs 95

# HELP discourse_sidekiq_jobs_enqueued Sidekiqワーカープロセスにキューに積まれたジョブの数
# TYPE discourse_sidekiq_jobs_enqueued gauge
discourse_sidekiq_jobs_enqueued{queue="default"} 0
discourse_sidekiq_jobs_enqueued{queue="low"} 0
discourse_sidekiq_jobs_enqueued{queue="critical"} 0
discourse_sidekiq_jobs_enqueued{queue="ultra_low"} 0

# HELP discourse_sidekiq_processes Sidekiqジョブプロセスの数
# TYPE discourse_sidekiq_processes gauge
discourse_sidekiq_processes 1

# HELP discourse_sidekiq_paused Sidekiqが一時停止中かどうか
# TYPE discourse_sidekiq_paused gauge


# HELP discourse_sidekiq_workers アクティブなSidekiqワーカーの総数
# TYPE discourse_sidekiq_workers gauge
discourse_sidekiq_workers 5

# HELP discourse_sidekiq_jobs_stuck 120分以上実行されているSidekiqジョブの数
# TYPE discourse_sidekiq_jobs_stuck gauge


# HELP discourse_scheduled_jobs_stuck 予想される実行時間を超えて実行されているスケジュール済みジョブの数
# TYPE discourse_scheduled_jobs_stuck gauge


# HELP discourse_missing_s3_uploads S3に存在しないアップロードの数
# TYPE discourse_missing_s3_uploads gauge


# HELP discourse_version_info `revision`(現在のコアコミットハッシュ)および`version`(Discourse::VERSION::STRING)でラベル付けされています
# TYPE discourse_version_info gauge
discourse_version_info{revision="e3164671698aeef94cf2e142903a30e4688e9dfe",version="2.8.0.beta6"} 1

# HELP discourse_readonly_sites Discourse::READONLY_KEYSからの関連キーごとにグループ化された、現在読み取り専用モードにあるサイトの数
# TYPE discourse_readonly_sites gauge
discourse_readonly_sites{key="readonly_mode"} 0
discourse_readonly_sites{key="readonly_mode:postgres"} 0
discourse_readonly_sites{key="readonly_mode:user"} 0
discourse_readonly_sites{key="readonly_mode:postgres_force"} 0

質問:

  1. これはフォーラムへのDDoSまたはブルートフォース攻撃、あるいはボットによるトラフィックでしょうか?
    それとも本物のトラフィックで、ドロプレットの仕様をアップグレードする必要があるのでしょうか?その場合、何をどのくらいアップグレードすべきですか?

  2. 私たちは何をすべきですか?現在、サイトの読み込みが非常に遅く、トピック間のナビゲーション時の読み込み遷移に5秒以上かかります。

  3. どのトラフィックやリソースがこのほどなトラフィックを使用しているのか、またそれが本物の人間のトラフィックなのか、サイトをダウンさせようとするボットなのかをどうやって見分けますか?

  4. ドロプレットの仕様をアップグレードすることを決めた場合、app.yamlでどのような変更を行うべきですか?

  5. ユーザープロフィールの管理者ページでは、各ユーザーの一意のIPアドレスが表示されており、CFがリアルIPを取得していることを意味しますが、app.ymlからratelimitedテンプレートをアンコメントすると、なぜ429(リクエストが多すぎます)エラーが発生するのでしょうか?

  6. CFのDDoS設定をどのように構成すべきですか?

  7. 同じ現在のドロプレット仕様を使用して高トラフィックを処理するために、サーバー/Discourseをマルチスレッドまたは並列で動作するように構成する方法はありますか?可能であれば、マルチコア/CPUドロプレットを効果的かつ最適に利用するためのDiscourseでのマルチスレッド/並列スケーリングをどのように構成すればよいですか?

私たちはCloudflareを使用しており、CFの「攻撃下」モードをオンにするとCPU使用率は低下しますが、新しいユーザーがサイトを使用するたびにキャプチャを解くことを煩わせることはできません。現在、CFのボット対策モードはONで、CFのセキュリティレベルは高です。

再構築を試みましたが、再構築が完了すると正常に戻りますが、数分後にはCPU使用率が再び100%に戻ってしまいます。

どうか誰か助けてください。

さて、サイトの利便性か安定した稼働か、どちらを重視するかを決める必要があります。
DDoS 攻撃中は、サイトの運用において何らかの妥協を余儀なくされるのが常です。
https://ddos-guard.net を試してみるのも一案です。

自分のサイトが実際に DDoS 攻撃を受けているのか、それとも単なる本物のトラフィック増加なのか、どうやって確認すればよいのでしょうか?

まずは真の問題を特定し、その後で適切な解決策へと進む必要があります。

試してみてください:
netstat -ntu|awk '{print $5}'|cut -d: -f1 -s|sort|uniq -c|sort -nk1 -r
そして、オンラインユーザー数と比較してください。

@valsha
上記のコマンドを実行したところ、Google アナリティクス上のユーザー数は 73 人でしたが、上記コマンドの出力は以下のように 596 行表示されました。これは何を意味するのでしょうか?

3178 127.0.0.1
   3105 172.17.0.2
    434 172.64.200.21
     27 172.64.201.21
      8 162.158.89.144
      7 162.158.94.247
      7 162.158.92.123
      7 162.158.90.37
      7 162.158.90.253
      7 162.158.89.140
      7 162.158.88.163
      6 162.158.94.163
      6 162.158.90.239
      6 162.158.89.34
      6 162.158.89.246
      6 162.158.89.106
      6 162.158.89.100
      6 162.158.88.61
      6 162.158.88.119
      5 162.158.88.7
      4 172.69.71.157
      4 172.68.142.200
      3 172.70.142.205
      3 172.70.126.91
      3 172.70.126.7
      3 172.70.110.233
      3 172.70.110.197
      3 172.69.71.67
      3 172.69.35.204
      3 172.69.22.107
      3 172.69.22.101
      3 172.68.189.142
      3 172.68.143.57
      3 172.68.143.231
      3 172.68.133.21
      3 172.68.133.165
      3 172.68.132.34
      3 172.68.132.120
      3 162.158.63.241
      3 162.158.255.183
      3 108.162.245.79
      3 108.162.221.137
      3 108.162.219.187
      2 173.245.52.212
      2 172.70.83.8
      2 172.70.82.187
      2 172.70.82.115
      2 172.70.61.179
      2 172.70.61.135
      2 172.70.54.63
      2 172.70.178.199
      2 172.70.178.103
      2 172.70.130.59
      2 172.70.130.165
      2 172.70.126.9
      2 172.70.126.81
      2 172.70.114.73
      2 172.70.114.123
      2 172.70.110.125
      2 172.69.71.89
      2 172.69.71.87
      2 172.69.71.204
      2 172.69.69.182
      2 172.69.69.170
      2 172.69.68.229
      2 172.69.68.144
      2 172.69.55.161
      2 172.69.34.119
      2 172.69.22.173
      2 172.69.22.125
      2 172.68.143.21
      2 172.68.141.187
      2 172.68.141.175
      2 172.68.133.13
      2 162.158.74.198
      2 108.162.250.192
      2 108.162.246.22
      2 108.162.221.67
      2 108.162.221.207
      2 108.162.219.19
      2 108.162.219.165
      2 108.162.219.115
      2 108.162.215.107
      2 108.162.212.20
      2 108.162.210.199
      1 198.41.238.97
      1 198.41.231.66
      1 188.141.50.15
      1 173.245.52.222
      1 173.245.52.210
      1 173.245.52.204
      1 173.245.52.168
      1 173.245.52.166
      1 172.70.98.9
      1 172.70.98.141
      1 172.70.98.131
      1 172.70.82.99
      1 172.70.82.95
      1 172.70.82.85
      1 172.70.82.57
      1 172.70.82.29
      1 172.70.82.27
      1 172.70.82.249
      1 172.70.82.233
      1 172.70.82.229
      1 172.70.82.221
      1 172.70.82.213
      1 172.70.82.211
      1 172.70.82.203
      1 172.70.82.173
      1 172.70.82.159
      1 172.70.82.153
      1 172.70.82.151
      1 172.70.82.137
      1 172.70.82.135
      1 172.70.82.107
      1 172.70.61.193
      1 172.70.61.189
      1 172.70.61.185
      1 172.70.61.177
      1 172.70.61.173
      1 172.70.61.171
      1 172.70.61.169
      1 172.70.61.161
      1 172.70.61.157
      1 172.70.61.153
      1 172.70.61.151
      1 172.70.61.149
      1 172.70.61.139
      1 172.70.61.133
      1 172.70.57.187
      1 172.70.57.181
      1 172.70.54.97
      1 172.70.54.71
      1 172.70.54.55
      1 172.70.54.53
      1 172.70.54.45
      1 172.70.54.43
      1 172.70.54.139
      1 172.70.54.109
      1 172.70.54.105
      1 172.70.188.53
      1 172.70.188.159
      1 172.70.178.51
      1 172.70.178.237
      1 172.70.178.141
      1 172.70.143.58
      1 172.70.143.36
      1 172.70.142.55
      1 172.70.142.239
      1 172.70.142.235
      1 172.70.142.215
      1 172.70.142.129
      1 172.70.142.119
      1 172.70.134.17
      1 172.70.130.95
      1 172.70.130.19
      1 172.70.127.38
      1 172.70.127.34
      1 172.70.126.79
      1 172.70.126.3
      1 172.70.126.251
      1 172.70.126.25
      1 172.70.126.243
      1 172.70.126.23
      1 172.70.126.227
      1 172.70.126.225
      1 172.70.126.203
      1 172.70.126.201
      1 172.70.126.197
      1 172.70.126.179
      1 172.70.126.153
      1 172.70.126.143
      1 172.70.126.139
      1 172.70.126.131
      1 172.70.126.111
      1 172.70.122.217
      1 172.70.114.99
      1 172.70.114.175
      1 172.70.114.119
      1 172.70.110.85
      1 172.70.110.77
      1 172.70.110.49
      1 172.70.110.249
      1 172.70.110.221
      1 172.70.110.215
      1 172.70.110.211
      1 172.70.110.201
      1 172.70.110.185
      1 172.70.110.173
      1 172.70.110.167
      1 172.70.110.129
      1 172.69.71.97
      1 172.69.71.95
      1 172.69.71.93
      1 172.69.71.91
      1 172.69.71.85
      1 172.69.71.83
      1 172.69.71.81
      1 172.69.71.75
      1 172.69.71.73
      1 172.69.71.71
      1 172.69.71.69
      1 172.69.71.65
      1 172.69.71.63
      1 172.69.71.6
      1 172.69.71.57
      1 172.69.71.55
      1 172.69.71.53
      1 172.69.71.51
      1 172.69.71.49
      1 172.69.71.47
      1 172.69.71.45
      1 172.69.71.42
      1 172.69.71.32
      1 172.69.71.30
      1 172.69.71.202
      1 172.69.71.200
      1 172.69.71.199
      1 172.69.71.197
      1 172.69.71.195
      1 172.69.71.193
      1 172.69.71.191
      1 172.69.71.189
      1 172.69.71.187
      1 172.69.71.185
      1 172.69.71.183
      1 172.69.71.181
      1 172.69.71.179
      1 172.69.71.177
      1 172.69.71.175
      1 172.69.71.173
      1 172.69.71.171
      1 172.69.71.167
      1 172.69.71.165
      1 172.69.71.163
      1 172.69.71.161
      1 172.69.71.155
      1 172.69.71.153
      1 172.69.71.149
      1 172.69.71.147
      1 172.69.71.143
      1 172.69.71.141
      1 172.69.71.139
      1 172.69.71.137
      1 172.69.71.135
      1 172.69.71.133
      1 172.69.71.131
      1 172.69.71.129
      1 172.69.71.127
      1 172.69.71.125
      1 172.69.71.123
      1 172.69.71.121
      1 172.69.71.117
      1 172.69.71.115
      1 172.69.71.113
      1 172.69.71.111
      1 172.69.71.109
      1 172.69.71.106
      1 172.69.71.10
      1 172.69.69.225
      1 172.69.69.223
      1 172.69.69.221
      1 172.69.69.205
      1 172.69.69.203
      1 172.69.69.180
      1 172.69.69.176
      1 172.69.69.174
      1 172.69.69.172
      1 172.69.69.164
      1 172.69.69.162
      1 172.69.69.160
      1 172.69.69.141
      1 172.69.69.134
      1 172.69.69.128
      1 172.69.69.126
      1 172.69.69.124
      1 172.69.69.122
      1 172.69.69.120
      1 172.69.69.118
      1 172.69.69.114
      1 172.69.69.112
      1 172.69.68.90
      1 172.69.68.72
      1 172.69.68.66
      1 172.69.68.6
      1 172.69.68.54
      1 172.69.68.48
      1 172.69.68.43
      1 172.69.68.4
      1 172.69.68.39
      1 172.69.68.37
      1 172.69.68.35
      1 172.69.68.33
      1 172.69.68.31
      1 172.69.68.29
      1 172.69.68.27
      1 172.69.68.241
      1 172.69.68.239
      1 172.69.68.233
      1 172.69.68.231
      1 172.69.68.227
      1 172.69.68.225
      1 172.69.68.223
      1 172.69.68.221
      1 172.69.68.219
      1 172.69.68.217
      1 172.69.68.215
      1 172.69.68.213
      1 172.69.68.211
      1 172.69.68.208
      1 172.69.68.206
      1 172.69.68.204
      1 172.69.68.202
      1 172.69.68.200
      1 172.69.68.20
      1 172.69.68.198
      1 172.69.68.196
      1 172.69.68.194
      1 172.69.68.192
      1 172.69.68.190
      1 172.69.68.188
      1 172.69.68.186
      1 172.69.68.184
      1 172.69.68.182
      1 172.69.68.174
      1 172.69.68.172
      1 172.69.68.170
      1 172.69.68.17
      1 172.69.68.168
      1 172.69.68.162
      1 172.69.68.158
      1 172.69.68.156
      1 172.69.68.154
      1 172.69.68.150
      1 172.69.68.15
      1 172.69.68.148
      1 172.69.68.138
      1 172.69.68.120
      1 172.69.68.114
      1 172.69.68.108
      1 172.69.55.95
      1 172.69.35.224
      1 172.69.35.184
      1 172.69.35.16
      1 172.69.34.97
      1 172.69.34.77
      1 172.69.34.217
      1 172.69.34.149
      1 172.69.23.78
      1 172.69.23.6
      1 172.69.22.89
      1 172.69.22.47
      1 172.69.22.23
      1 172.69.22.149
      1 172.69.166.211
      1 172.69.156.151
      1 172.69.142.61
      1 172.68.245.4
      1 172.68.244.225
      1 172.68.242.227
      1 172.68.24.61
      1 172.68.24.189
      1 172.68.24.185
      1 172.68.189.44
      1 172.68.189.238
      1 172.68.143.237
      1 172.68.143.141
      1 172.68.143.111
      1 172.68.142.152
      1 172.68.141.217
      1 172.68.141.181
      1 172.68.141.145
      1 172.68.141.103
      1 172.68.133.85
      1 172.68.133.7
      1 172.68.133.5
      1 172.68.133.189
      1 172.68.133.147
      1 172.68.133.107
      1 172.68.132.82
      1 172.68.132.224
      1 172.68.132.22
      1 172.68.132.216
      1 172.68.132.192
      1 172.68.132.182
      1 172.68.132.174
      1 172.68.132.118
      1 172.68.132.10
      1 172.68.118.79
      1 172.68.118.41
      1 172.68.11.90
      1 172.68.11.8
      1 172.68.11.200
      1 172.68.10.243
      1 172.68.10.15
      1 172.68.10.143
      1 172.67.148.71
      1 162.158.90.17
      1 162.158.89.28
      1 162.158.88.95
      1 162.158.88.79
      1 162.158.88.133
      1 162.158.75.43
      1 162.158.75.189
      1 162.158.75.173
      1 162.158.75.163
      1 162.158.74.96
      1 162.158.74.236
      1 162.158.74.218
      1 162.158.74.196
      1 162.158.74.152
      1 162.158.74.140
      1 162.158.74.138
      1 162.158.74.130
      1 162.158.63.7
      1 162.158.63.65
      1 162.158.63.115
      1 162.158.62.94
      1 162.158.62.40
      1 162.158.62.32
      1 162.158.62.248
      1 162.158.62.138
      1 162.158.62.122
      1 162.158.62.118
      1 162.158.62.110
      1 162.158.50.4
      1 162.158.50.26
      1 162.158.255.35
      1 162.158.255.229
      1 162.158.255.215
      1 162.158.2.219
      1 162.158.2.207
      1 162.158.187.94
      1 162.158.183.170
      1 162.158.166.56
      1 162.158.165.27
      1 162.158.165.183
      1 162.158.165.169
      1 162.158.159.123
      1 162.158.158.152
      1 162.158.158.122
      1 162.158.155.65
      1 162.158.155.53
      1 162.158.154.136
      1 162.158.122.83
      1 162.158.119.152
      1 162.158.107.92
      1 162.158.107.50
      1 162.158.107.46
      1 162.158.107.18
      1 162.158.106.83
      1 162.158.106.225
      1 162.158.106.189
      1 162.158.106.173
      1 162.158.106.165
      1 162.158.106.155
      1 141.101.99.234
      1 141.101.99.230
      1 141.101.98.195
      1 141.101.98.149
      1 141.101.97.104
      1 141.101.96.31
      1 141.101.69.248
      1 141.101.107.85
      1 141.101.107.75
      1 141.101.107.57
      1 141.101.107.49
      1 141.101.107.179
      1 141.101.107.143
      1 141.101.105.79
      1 141.101.104.174
      1 141.101.104.114
      1 108.162.250.254
      1 108.162.250.228
      1 108.162.250.132
      1 108.162.250.124
      1 108.162.249.43
      1 108.162.249.37
      1 108.162.246.62
      1 108.162.246.6
      1 108.162.246.4
      1 108.162.246.36
      1 108.162.246.188
      1 108.162.246.160
      1 108.162.246.134
      1 108.162.245.81
      1 108.162.245.55
      1 108.162.245.25
      1 108.162.245.243
      1 108.162.245.225
      1 108.162.245.21
      1 108.162.245.199
      1 108.162.245.167
      1 108.162.245.143
      1 108.162.245.135
      1 108.162.245.117
      1 108.162.245.11
      1 108.162.245.101
      1 108.162.241.63
      1 108.162.241.145
      1 108.162.241.123
      1 108.162.241.111
      1 108.162.229.43
      1 108.162.221.99
      1 108.162.221.97
      1 108.162.221.91
      1 108.162.221.89
      1 108.162.221.87
      1 108.162.221.85
      1 108.162.221.83
      1 108.162.221.81
      1 108.162.221.79
      1 108.162.221.77
      1 108.162.221.75
      1 108.162.221.73
      1 108.162.221.71
      1 108.162.221.69
      1 108.162.221.65
      1 108.162.221.53
      1 108.162.221.249
      1 108.162.221.247
      1 108.162.221.243
      1 108.162.221.241
      1 108.162.221.239
      1 108.162.221.237
      1 108.162.221.235
      1 108.162.221.233
      1 108.162.221.231
      1 108.162.221.229
      1 108.162.221.227
      1 108.162.221.223
      1 108.162.221.221
      1 108.162.221.217
      1 108.162.221.215
      1 108.162.221.213
      1 108.162.221.209
      1 108.162.221.205
      1 108.162.221.201
      1 108.162.221.199
      1 108.162.221.195
      1 108.162.221.193
      1 108.162.221.191
      1 108.162.221.187
      1 108.162.221.185
      1 108.162.221.181
      1 108.162.221.179
      1 108.162.221.177
      1 108.162.221.173
      1 108.162.221.171
      1 108.162.221.167
      1 108.162.221.165
      1 108.162.221.163
      1 108.162.221.161
      1 108.162.221.159
      1 108.162.221.157
      1 108.162.221.155
      1 108.162.221.153
      1 108.162.221.151
      1 108.162.221.149
      1 108.162.221.147
      1 108.162.221.145
      1 108.162.221.143
      1 108.162.221.141
      1 108.162.221.139
      1 108.162.221.129
      1 108.162.221.127
      1 108.162.221.125
      1 108.162.221.123
      1 108.162.221.121
      1 108.162.221.119
      1 108.162.221.113
      1 108.162.221.111
      1 108.162.221.109
      1 108.162.221.107
      1 108.162.221.105
      1 108.162.221.101
      1 108.162.219.97
      1 108.162.219.81
      1 108.162.219.57
      1 108.162.219.45
      1 108.162.219.43
      1 108.162.219.15
      1 108.162.219.145
      1 108.162.216.75
      1 108.162.216.229
      1 108.162.215.87
      1 108.162.215.55
      1 108.162.215.185
      1 108.162.215.159
      1 108.162.212.36
      1 108.162.212.200
      1 108.162.212.198
      1 108.162.210.207
      1 108.162.210.197
      1 108.162.210.175

API呼び出しを行っているテーマコンポーネントやプラグインはありますか?

それらはすべて CloudFlare の IP アドレス範囲のようです。app.yml で CloudFlare の設定は正しく行いましたか?

`app.yml` の templates セクションの末尾に `cloudflare.template.yml` を追加してください。

cloudflare.template.yml に設定がなかったため、この制限が削除されたのだと思います。
すべてのユーザーが 1 つの IP アドレスを共有しており、これらの制限が彼らに適用されていました。
以下の手順を試してみてください:

  1. cloudflare.template.yml をインストールする
  2. web.ratelimited.template.yml をインストールする

CloudFlare が正しく設定されていても、netstat では CF の IP アドレスが表示されるため、これは必ずしも cloudflare.template.yml の設定が正しくないことを示すものではありません。

この設定の目的は、Cloudflare のアドレスではなく実際の IP アドレスを確認することでしょうか?

cloudflare.template.yml

はい、ただしこれは nginx が Discourse の Unicorn サービスに情報を送信し、リクエストをログに記録する時点での話です。ネットワークレベルでは、依然として実際の Cloudflare の IP アドレスが表示されます。

これは、誰かから手紙が届く状況に例えてみましょう。封筒を見ると、それはベティおばあちゃんからのものとわかります。netstat は封筒の中身を見るのではなく、ドアの前に誰が来ているかを確認するものです。つまり、あなたが見るのはおばあちゃんではなく、すべての手紙を運んでくる郵便配達員なのです。

@RGJ ご助言ありがとうございます。

現在、Discourse のユーザープロフィールページで、管理 GUI からユーザーの実際の IP アドレスを取得できるようになりました。

これは、外部の NGINX 設定で以下の行のコメントアウトを解除することで実現しました。

proxy_ssl_server_name       on;
        proxy_ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;
        proxy_pass       http://localhost:2045;
        proxy_redirect  http://localhost:2045/ https://howtodiscuss.com;
       # proxy_set_header X-Real-IP $remote_addr;
       # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       # proxy_set_header Host $http_host;
       # proxy_set_header X-NginX-Proxy true;

        proxy_redirect off;

        # Socket.IO Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

しかし、netstat で確認すると、まだ Cloudflare の IP アドレスが表示されています。

私たちの元の課題は、Google アナリティクスでのリアルタイムのオンライントラフィックが平均約 150 人であるにもかかわらず、なぜ CPU 使用率が 100% に達しているのかという点です。また、多くの Unicorn ワーカーが CPU を消費しています。最初の投稿で app.yaml の設定とサーバー仕様を共有済みですが、上記でご確認いただけます。

サーバーをより多くの CPU を持つものにリサイズすべきでしょうか、それとも app.yaml、Discourse、またはサーバーサイドでサイトのパフォーマンスを向上させ、CPU 使用率を低下させるための変更・設定・最適化はありますか?

現在、app.yaml のレート制限テンプレートのコメントアウトを解除すべきでしょうか?前回コメントアウトを解除した際は、サーバー側ですべてのユーザーが Cloudflare の IP として認識されていたため、通常のユーザーが「429 Too Many Requests」エラーに直面しました。しかし、現在は実際のユーザーの IP が取得できていると考えており、レート制限テンプレートを解除しても安全ではないでしょうか?

netstat ではまだ Cloudflare の IP が表示されているにもかかわらず、Discourse およびサーバーが実際にユーザーの本当の IP アドレスを取得していることを確認する方法はありますか?

Discourse フォーラムをダウンさせる DDoS 攻撃が行われている可能性はありますか?もしそうなら、どうすれば防げるでしょうか?

もし 100% の CPU 使用率が、本当に純粋なトラフィックの増加によるものなら、現在どのようなサーバー仕様にリサイズすべきでしょうか?

Linux や Discourse レベルで、マルチスレッド化や並列 CPU 使用率の最適化設定を行うことで、100% の CPU 使用率の問題を解決し、ユーザーへの サイト の読み込みを高速化することは可能でしょうか?使用していないプラグインのほとんどは既に無効化しています。

私が説明しようとした通り、netstat は異なるレベルで動作します。あなたのフォーラムが Cloudflare の背後にある場合、netstat が実際の IP アドレスを表示するような nginx 設定は存在しません。

編集:「not」を「now」に変更されたのですね。これであなたの投稿の意図がはるかに明確になりました。

チューニングに関する他のトピックもあります。

レート制限テンプレートの提出は問題ないはずです。

高速なCPUとSSDが重要です。

データベースのサイズはどのくらいですか?データベースの設定を変更しましたか?

フォーラムとS3アセットにCDNは導入されていますか?CloudflareはCDNではありません。

@pfaffman

私たちに役立つトピックをいくつか提案してもらえますか?

レート制限テンプレートを有効にしましたが、すべてのユーザーが 429 エラーに遭遇しました。

その後、Cloudflare テンプレートを無効にしましたが、ローカル IP からは Discourse にアクセスできなくなりました。Discourse で IP をホワイトリストに登録する方法を教えてください。

16 GB / 8 vCPU、SSD 搭載、Intel 専用 Digital Ocean Droplet

table_name                           | row_estimate | table_size | index_size | total_size
-----------------------------------------------------------------------------------
topic_views                          | 7638895      | 339 MB     | 704 MB     | 1044 MB
post_search_data                     | 95984        | 493 MB     | 117 MB     | 610 MB
posts                                | 115690       | 512 MB     | 32 MB      | 544 MB
post_revisions                       | 18876        | 368 MB     | 1512 kB    | 370 MB
top_topics                           | 74384        | 70 MB      | 209 MB     | 279 MB
incoming_links                       | 1194305      | 72 MB      | 75 MB      | 147 MB
topic_links                          | 248176       | 46 MB      | 54 MB      | 101 MB
stylesheet_cache                     | 1819         | 94 MB      | 352 kB     | 95 MB
user_histories                       | 38564        | 83 MB      | 6376 kB    | 90 MB
topics                               | 88662        | 49 MB      | 37 MB      | 85 MB
notifications                        | 144259       | 39 MB      | 26 MB      | 65 MB
topic_search_data                    | 77107        | 47 MB      | 16 MB      | 63 MB
user_profile_views                   | 298745       | 30 MB      | 27 MB      | 57 MB
scheduler_stats                      | 247499       | 38 MB      | 6736 kB    | 44 MB
topic_users                          | 199664       | 28 MB      | 14 MB      | 42 MB
user_actions                         | 113450       | 15 MB      | 23 MB      | 38 MB
topic_tags                           | 293483       | 20 MB      | 13 MB      | 33 MB
search_logs                          | 172445       | 24 MB      | 8752 kB    | 33 MB
post_timings                         | 179627       | 15 MB      | 8568 kB    | 24 MB
post_stats                           | 105481       | 13 MB      | 5104 kB    | 18 MB
reviewables                          | 4737         | 15 MB      | 1184 kB    | 17 MB
optimized_images                     | 50814        | 12 MB      | 4704 kB    | 16 MB
user_auth_token_logs                 | 42998        | 12 MB      | 1904 kB    | 14 MB
incoming_referers                    | 26867        | 4520 kB    | 4592 kB    | 9112 kB
directory_items                      | 33456        | 2928 kB    | 5488 kB    | 8416 kB
draft_sequences                      | 38948        | 5144 kB    | 2448 kB    | 7592 kB
user_associated_accounts             | 2237         | 6728 kB    | 448 kB     | 7176 kB
user_custom_fields                   | 27921        | 2768 kB    | 3568 kB    | 6336 kB
reviewable_histories                 | 8538         | 5784 kB    | 528 kB     | 6312 kB
user_visits                          | 27147        | 1552 kB    | 2656 kB    | 4208 kB
uploads                              | 5623         | 1560 kB    | 2128 kB    | 3688 kB
users                                | 5633         | 1720 kB    | 1744 kB    | 3464 kB
topic_link_clicks                    | 16494        | 2088 kB    | 768 kB     | 2856 kB
email_logs                           | 5057         | 1128 kB    | 1568 kB    | 2696 kB
web_crawler_requests                 | 5533         | 848 kB     | 1632 kB    | 2480 kB
topic_allowed_users                  | 14487        | 976 kB     | 1128 kB    | 2104 kB
category_tag_stats                   | 11176        | 736 kB     | 1192 kB    | 1928 kB
drafts                               | 219          | 1712 kB    | 32 kB      | 1744 kB
category_users                       | 10579        | 544 kB     | 1120 kB    | 1664 kB
user_badges                          | 7852         | 768 kB     | 888 kB     | 1656 kB
email_tokens                         | 6175         | 800 kB     | 832 kB     | 1632 kB
tag_search_data                      | 6860         | 736 kB     | 808 kB     | 1544 kB
group_users                          | 9277         | 808 kB     | 696 kB     | 1504 kB
user_profiles                        | 5629         | 968 kB     | 472 kB     | 1440 kB
user_search_data                     | 5633         | 712 kB     | 704 kB     | 1416 kB
user_emails                          | 5117         | 504 kB     | 760 kB     | 1264 kB
tags                                 | 7121         | 592 kB     | 640 kB     | 1232 kB
plugin_store_rows                    | 4103         | 864 kB     | 360 kB     | 1224 kB
user_stats                           | 5631         | 1064 kB    | 144 kB     | 1208 kB
unsubscribe_keys                     | 2190         | 528 kB     | 520 kB     | 1048 kB
reviewable_scores                    | 4540         | 704 kB     | 320 kB     | 1024 kB
user_options                         | 5469         | 880 kB     | 144 kB     | 1024 kB
user_avatars                         | 5346         | 392 kB     | 456 kB     | 848 kB
incoming_domains                     | 4985         | 408 kB     | 432 kB     | 840 kB
post_uploads                         | 3194         | 264 kB     | 568 kB     | 832 kB
post_custom_fields                   | 2804         | 376 kB     | 432 kB     | 808 kB
topic_thumbnails                     | 3014         | 248 kB     | 536 kB     | 784 kB
user_uploads                         | 5549         | 328 kB     | 432 kB     | 760 kB
user_auth_tokens                     | 1382         | 416 kB     | 336 kB     | 752 kB
topic_custom_fields                  | 1058         | 352 kB     | 240 kB     | 592 kB
application_requests                 | 5401         | 280 kB     | 272 kB     | 552 kB
topic_allowed_groups                 | 3116         | 176 kB     | 264 kB     | 440 kB
quoted_posts                         | 2142         | 168 kB     | 240 kB     | 408 kB
theme_fields                         | 23           | 328 kB     | 32 kB      | 360 kB
post_actions                         | 1057         | 112 kB     | 224 kB     | 336 kB
watched_words                        | 1946         | 168 kB     | 144 kB     | 312 kB
javascript_caches                    | 11           | 248 kB     | 64 kB      | 312 kB
schema_migration_details             | 1218         | 200 kB     | 104 kB     | 304 kB
dismissed_topic_users                | 463          | 104 kB     | 160 kB     | 264 kB
discourse_voting_topic_vote_count    | 1407         | 120 kB     | 96 kB      | 216 kB
category_featured_topics             | 409          | 64 kB      | 120 kB     | 184 kB
categories                           | 73           | 72 kB      | 112 kB     | 184 kB
post_replies                         | 916          | 88 kB      | 80 kB      | 168 kB
group_histories                      | 498          | 56 kB      | 112 kB     | 168 kB
site_settings                        | 255          | 112 kB     | 48 kB      | 160 kB
bookmarks                            | 179          | 24 kB      | 112 kB     | 136 kB
user_security_keys                   | 3            | 16 kB      | 112 kB     | 128 kB
skipped_email_logs                   | 296          | 48 kB      | 80 kB      | 128 kB
category_custom_fields               | 513          | 56 kB      | 72 kB      | 128 kB
groups                               | 10           | 80 kB      | 48 kB      | 128 kB
schema_migrations                    | 1217         | 64 kB      | 56 kB      | 120 kB
assignments                          | 98           | 56 kB      | 48 kB      | 104 kB
user_archived_messages               | 637          | 40 kB      | 64 kB      | 104 kB
given_daily_likes                    | 569          | 32 kB      | 64 kB      | 96 kB
invites                              | 21           | 16 kB      | 80 kB      | 96 kB
do_not_disturb_timings               | 0            | 8192 bytes | 80 kB      | 88 kB
sitemaps                             | 9            | 48 kB      | 32 kB      | 80 kB
badges                               | 52           | 32 kB      | 48 kB      | 80 kB
user_api_keys                        | 1            | 16 kB      | 64 kB      | 80 kB
incoming_emails                      | 0            | 8192 bytes | 64 kB      | 72 kB
user_second_factors                  | 21           | 16 kB      | 48 kB      | 64 kB
email_change_requests                | 2            | 16 kB      | 48 kB      | 64 kB
screened_ip_addresses                | 5            | 16 kB      | 48 kB      | 64 kB
api_keys                             | 4            | 16 kB      | 48 kB      | 64 kB
backup_metadata                      | 6            | 48 kB      | 16 kB      | 64 kB
child_themes                         | 4            | 8192 bytes | 48 kB      | 56 kB
tag_users                            | 59           | 8192 bytes | 48 kB      | 56 kB
invited_users                        | 4            | 8192 bytes | 48 kB      | 56 kB
group_mentions                       | 6            | 8192 bytes | 48 kB      | 56 kB
tag_group_permissions                | 1            | 8192 bytes | 48 kB      | 56 kB
category_search_data                 | 73           | 16 kB      | 40 kB      | 56 kB
anonymous_users                      | 102          | 8192 bytes | 48 kB      | 56 kB
topic_invites                        | 6            | 8192 bytes | 48 kB      | 56 kB
user_notification_schedules          | 8            | 8192 bytes | 48 kB      | 56 kB
directory_columns                    | 8            | 16 kB      | 32 kB      | 48 kB
themes                               | 6            | 16 kB      | 32 kB      | 48 kB
external_upload_stubs                | 0            | 8192 bytes | 40 kB      | 48 kB
api_key_scopes                       | 6            | 16 kB      | 32 kB      | 48 kB
badge_types                          | 3            | 16 kB      | 32 kB      | 48 kB
color_scheme_colors                  | 20           | 16 kB      | 32 kB      | 48 kB
onceoff_logs                         | 40           | 16 kB      | 32 kB      | 48 kB
permalinks                           | 24           | 16 kB      | 32 kB      | 48 kB
theme_modifier_sets                  | 6            | 16 kB      | 32 kB      | 48 kB
topic_timers                         | 3            | 8192 bytes | 40 kB      | 48 kB
user_api_key_scopes                  | 2            | 16 kB      | 32 kB      | 48 kB
group_category_notification_defaults | 1            | 8192 bytes | 32 kB      | 40 kB
group_requests                       | 0            | 8192 bytes | 32 kB      | 40 kB
category_groups                      | 4            | 8192 bytes | 32 kB      | 40 kB
tag_group_memberships                | 7            | 8192 bytes | 32 kB      | 40 kB
invited_groups                       | 1            | 8192 bytes | 32 kB      | 40 kB
topic_groups                         | 47           | 8192 bytes | 32 kB      | 40 kB
discourse_voting_votes               | 4            | 8192 bytes | 32 kB      | 40 kB
theme_translation_overrides          | 0            | 8192 bytes | 24 kB      | 32 kB
oauth2_user_infos                    | 0            | 8192 bytes | 24 kB      | 32 kB
screened_urls                        | 0            | 8192 bytes | 24 kB      | 32 kB
screened_emails                      | 0            | 8192 bytes | 24 kB      | 32 kB
remote_themes                        | 3            | 16 kB      | 16 kB      | 32 kB
tag_groups                           | 1            | 16 kB      | 16 kB      | 32 kB
push_subscriptions                   | 13           | 16 kB      | 16 kB      | 32 kB
published_pages                      | 0            | 8192 bytes | 24 kB      | 32 kB
theme_settings                       | 9            | 16 kB      | 16 kB      | 32 kB
imap_sync_logs                       | 0            | 8192 bytes | 24 kB      | 32 kB
poll_options                         | 0            | 8192 bytes | 24 kB      | 32 kB
embeddable_hosts                     | 0            | 16 kB      | 16 kB      | 32 kB
color_schemes                        | 2            | 16 kB      | 16 kB      | 32 kB
user_exports                         | 1            | 16 kB      | 16 kB      | 32 kB
user_field_options                   | 4            | 16 kB      | 16 kB      | 32 kB
user_fields                          | 7            | 16 kB      | 16 kB      | 32 kB
badge_groupings                      | 5            | 16 kB      | 16 kB      | 32 kB
backup_draft_posts                   | 0            | 8192 bytes | 24 kB      | 32 kB
ar_internal_metadata                 | 1            | 16 kB      | 16 kB      | 32 kB
polls                                | 0            | 8192 bytes | 24 kB      | 32 kB
poll_votes                           | 0            | 0 bytes    | 32 kB      | 32 kB
web_hook_event_types                 | 13           | 16 kB      | 16 kB      | 32 kB
single_sign_on_records               | 0            | 8192 bytes | 24 kB      | 32 kB
group_custom_fields                  | 0            | 8192 bytes | 16 kB      | 24 kB
allowed_pm_users                     | 0            | 0 bytes    | 24 kB      | 24 kB
user_warnings                        | 0            | 0 bytes    | 24 kB      | 24 kB
user_ip_address_histories            | 0            | 8192 bytes | 16 kB      | 24 kB
user_open_ids                        | 0            | 8192 bytes | 16 kB      | 24 kB
muted_users                          | 0            | 0 bytes    | 24 kB      | 24 kB
topic_embeds                         | 0            | 8192 bytes | 16 kB      | 24 kB
post_action_types                    | 7            | 8192 bytes | 16 kB      | 24 kB
message_bus                          | 0            | 8192 bytes | 16 kB      | 24 kB
linked_topics                        | 0            | 0 bytes    | 24 kB      | 24 kB
post_details                         | 0            | 8192 bytes | 16 kB      | 24 kB
ignored_users                        | 0            | 0 bytes    | 24 kB      | 24 kB
web_hook_events                      | 0            | 8192 bytes | 16 kB      | 24 kB
translation_overrides                | 0            | 8192 bytes | 16 kB      | 24 kB
backup_draft_topics                  | 0            | 0 bytes    | 24 kB      | 24 kB
post_reply_keys                      | 0            | 0 bytes    | 24 kB      | 24 kB
custom_emojis                        | 0            | 8192 bytes | 16 kB      | 24 kB
category_tags                        | 0            | 0 bytes    | 24 kB      | 24 kB
shared_drafts                        | 0            | 0 bytes    | 24 kB      | 24 kB
category_tag_groups                  | 0            | 0 bytes    | 16 kB      | 16 kB
group_archived_messages              | 0            | 0 bytes    | 16 kB      | 16 kB
discourse_voting_category_settings   | 0            | 0 bytes    | 16 kB      | 16 kB
developers                           | 0            | 0 bytes    | 16 kB      | 16 kB
web_hooks                            | 0            | 8192 bytes | 8192 bytes | 16 kB
shelved_notifications                | 0            | 0 bytes    | 16 kB      | 16 kB
group_tag_notification_defaults      | 0            | 0 bytes    | 16 kB      | 16 kB
reviewable_claimed_topics            | 0            | 0 bytes    | 16 kB      | 16 kB
groups_web_hooks                     | 0            | 0 bytes    | 8192 bytes | 8192 bytes
tags_web_hooks                       | 0            | 0 bytes    | 8192 bytes | 8192 bytes
categories_web_hooks                 | 0            | 0 bytes    | 8192 bytes | 8192 bytes
web_hook_event_types_hooks           | 0            | 0 bytes    | 8192 bytes | 8192 bytes
badge_posts                          | 0            | 0 bytes    | 0 bytes    | 0 bytes

app.yml でいくつかの設定を変更しました。
db_shared_buffers: “4096MB”
db_work_mem: “400MB”
UNICORN_WORKERS: 16

## これはオールインワン、スタンドアロンの Discourse Docker コンテナテンプレートです
##
## このファイルに変更を加えた後は、必ず再構築を行ってください
## /var/discourse/launcher rebuild app
##
## 編集時には非常に注意してください!
## YAML ファイルは、空白やアライメントの誤りに極めて敏感です!
## 必要に応じて http://www.yamllint.com/ でこのファイルを検証してください

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  # - "templates/sshd.template.yml"
  #- "templates/web.ratelimited.template.yml" # 429 エラー(要求が多すぎる)を回避するために削除しました https://meta.discourse.org/t/remove-the-ip-limits/185829
  - "templates/cloudflare.template.yml"
## Lets Encrypt (https) を追加したい場合は、以下の 2 行のコメントを外してください
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"

## このコンテナが公開する TCP/IP ポートはどれですか?
## Discourse を Apache や nginx などの他の Web サーバーとポートを共有したい場合は、
## https://meta.discourse.org/t/17247 を参照してください
expose:
  - "1010:80" # http
#  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  ## db_shared_buffers を総メモリの最大 25% に設定します。
  ## 検出された RAM に基づいてブートストラップによって自動的に設定されますが、上書きすることもできます
  db_shared_buffers: "4096MB"

  ## ソートパフォーマンスを向上させることができますが、接続ごとのメモリ使用量が増加します
  db_work_mem: "400MB"

  ## このコンテナで使用する Git リビジョンはどれですか?(デフォルト:tests-passed)
  #version: tests-passed

env:
  LANG: en_US.UTF-8
  # DISCOURSE_DEFAULT_LOCALE: en

  ## 同時にサポートされる Web リクエストの数は?メモリと CPU コア数に依存します。
  ## 検出された CPU に基づいてブートストラップによって自動的に設定されますが、上書きすることもできます
  UNICORN_WORKERS: 16

  ## TODO: この Discourse インスタンスが応答するドメイン名
  ## 必須です。Discourse は IP アドレス単独では動作しません。
  DISCOURSE_HOSTNAME: "howtodiscuss.com"

  ## 上記で指定したホスト名と同じ (-h オプション) でコンテナを起動したい場合は、コメントを外してください
  #DOCKER_USE_HOSTNAME: true

  ## TODO: 初期サインアップ時に管理者および開発者として設定されるメールのリスト(カンマ区切り)
  ## 例:'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: "smtp_username"

  ## TODO: 新しいアカウントの検証と通知送信に使用する SMTP メールサーバー
  # SMTP アドレス、ユーザー名、パスワードは必須です
  # 警告:SMTP パスワードに '#' 文字が含まれていると問題が発生する可能性があります!
  DISCOURSE_SMTP_ADDRESS: smtp.example.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: admin@example.com
  DISCOURSE_SMTP_PASSWORD: p@$$word
  #DISCOURSE_SMTP_DOMAIN: discourse.example.com    # (一部のプロバイダーで必須)
  #DISCOURSE_NOTIFICATION_EMAIL: nobody@discourse.example.com    # 通知を送信するアドレス

  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (オプション、デフォルトは true)

  ## Lets Encrypt テンプレートを追加した場合は、以下をコメント外して無料の SSL 証明書を取得してください
  #LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
  #DISCOURSE_MAXMIND_LICENSE_KEY: 1234567890123456

  ## この Discourse インスタンスの http または https CDN アドレス(プルするように設定)
  ## 詳細は https://meta.discourse.org/t/14857 を参照してください
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

## Docker コンテナはステートレスです。すべてのデータは /shared に保存されます
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## プラグインはここに配置します
## 詳細は https://meta.discourse.org/t/19157 を参照してください
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-sitemap.git
          #- git clone https://github.com/discourse/discourse-math.git # 数式 JAX サポート用のカスタムプラグイン
          - git clone https://github.com/discourse/discourse-solved.git # 質問と回答、ベストアンサー選択用のカスタムプラグイン
          #- git clone https://github.com/discourse/discourse-voting.git # トピックの投票専用のカスタムプラグイン
          #- git clone https://github.com/discourse/discourse-yearly-review.git # フォーラム活動の年次トピックを自動的に投稿するカスタムプラグイン
          - git clone https://github.com/discourse/discourse-user-notes.git # スタッフがユーザーに関するメモを追加できるようにするカスタムプラグイン
          - git clone https://github.com/paviliondev/discourse-question-answer.git # SO 風の投稿投票機能を持つ非公式カスタムプラグイン
          - git clone https://github.com/discourse/discourse-adplugin.git # 広告用の公式カスタムプラグイン
          #- git clone https://github.com/discourse/discourse-whos-online.git # オンラインユーザーを表示するカスタムプラグイン
          - git clone https://github.com/paviliondev/discourse-topic-previews.git # トピックプレビューを美しく表示するカスタムプラグイン
          #- git clone https://github.com/paviliondev/discourse-ratings.git # ユーザーがトピックを評価できるようにするカスタムプラグイン
          #- git clone https://github.com/discourse/discourse-cakeday.git # 誕生日と加入記念日の祝賀会用の公式プラグイン
          #- git clone https://github.com/discourse/discourse-saved-searches.git # 保存された検索通知用の公式プラグイン
          #- git clone https://github.com/paviliondev/discourse-follow.git # ユーザー同士がフォローし合えるようにするカスタムプラグイン
          - git clone https://github.com/discourse/discourse-assign.git # スタッフにトピックを割り当てるためのカスタムプラグイン
          - git clone https://github.com/paviliondev/x-discourse-tlp-thumbnail.git # CDN 画像からのサムネイルを表示するカスタムプラグイン
          - git clone https://github.com/discourse/discourse-prometheus.git # 低速モニタリング用のカスタムプラグイン
          - git clone https://github.com/discourse/discourse-push-notifications.git # プッシュ通知用のプラグイン
## ビルド後に実行する任意のカスタムコマンド
run:
  - exec: echo "カスタムコマンドの開始"
  ## 最初の登録時の「From」メールアドレスを設定したい場合は、コメントを外して変更してください。
  ## 最初のサインアップメールを受信した後、再度コメントアウトしてください。一度だけ実行すれば十分です。
  - exec: rails r "SiteSetting.notification_email='noreply@howtodiscuss.com'"
  - exec: echo "カスタムコマンドの終了"
  ## リアル IP を表示するために https://meta.discourse.org/t/troubleshooting-a-429-rate-limit/81060/19
  # Discourse に IP 番号を転送するための魔法のような設定
  # 詳細は https://meta.discourse.org/t/last-ip-address-and-action-dispatch-trusted-proxies/50098/3?u=pfaffman を参照
  - replace:
      filename: /etc/nginx/conf.d/discourse.conf
      from: "types {"
      to: |
        set_real_ip_from 172.17.0.0/24;
        real_ip_header X-Forwarded-For;
        real_ip_recursive on;
        types {

おそらく、リバースプロキシ用の replace セクション(real_ip を追加する部分)が、Cloudflare のテンプレートと競合している可能性があります。どちらも同様の処理を行うためです。Discourse が認識するのは、Cloudflare やリバースプロキシの IP ではなく、実際のユーザーの IP であることを確認する必要があります。推測するに、これがレート制限テンプレートが機能しない原因だと思われます。現在、すべてのトラフィックがローカル IP から来ているため、その点を修正する必要があるでしょう。

AMD サーバーは Intel より少し高速ですが(専用 CPU が用意されていないようですが?そのため、Intel を優先した方が良いかもしれません)。

172.17.0.1 という IP は、おそらく Docker の IP アドレスです。投稿されたログは、Discourse コンテナ内の nginx サービスからのものだと推測します。私の推測では、ホスト側の nginx が Discourse 内の nginx へリクエストを送信しており、Discourse 内の nginx がホスト側の nginx の IP を認識しているため、このような状態になっていると思われます。

これを解決するには、Discourse 側の「実 IP」をホスト側の nginx が送信するヘッダーの値として設定するか、あるいは nginx サービス間をソケットで接続する方法のいずれかがあります。

例えば、ホスト側の nginx で proxy_set_header X-Real-IP $remote_addr; を設定し、Discourse コンテナ内の nginx では、このヘッダーに基づいて実 IP を認識するように設定します。具体的には、set_real_ip_from 0.0.0.0/0;(Discourse 内の nginx が外部から直接アクセスされないことを前提)および real_ip_header X-Real-IP; を使用します。Discourse 内の nginx 設定ファイルにこれらを反映させるには、テンプレートを使用するか、sed コマンドを実行して追加する必要があるでしょう。

もう一つの選択肢は、ソケットを使用する方法です。その場合は、以下のリンクに従って web.socketed.template.yml を含めてください。

ただし、予算が許すのであれば、私の推奨は、Discourse を独自のサーバーで運用し、前方にリバースプロキシとして nginx を配置しないことです。そうすれば、セットアップがはるかにシンプルで容易になります。

この負荷は、トラフィック量に対して正常ですか?彼はかなり優秀な VPS を持っています。

CPU を引きずっている他の要因がないか確認しましたか?プラグインかもしれません。

あなたのサイトは肥大化しているように見えます。私が訪問した際、3 つのトピックをクリックするだけで少なくとも 20 件の広告が表示されました。これがサーバーに影響するかどうかはわかりませんが、実際にテストしてみないとわかりません。

レート制限がオンになっている状態で Cloudflare テンプレートを無効にすると、すべてのユーザーが Cloudflare の IP を使用しているため、全員がレート制限の対象になります。実際の IP を取得し、全員がレート制限されるのを防ぐには、Cloudflare テンプレートを有効にする必要があります。