From 1647548590878bfd153b8b8c74e73eda0b8a2cd3 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 13 Jan 2020 14:54:04 +0000 Subject: [PATCH 1/1] planet: Rate limit downloads to help fibre fault --- cookbooks/planet/recipes/default.rb | 1 + cookbooks/planet/templates/default/apache.erb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cookbooks/planet/recipes/default.rb b/cookbooks/planet/recipes/default.rb index 28b1abdb8..5dd5953f8 100644 --- a/cookbooks/planet/recipes/default.rb +++ b/cookbooks/planet/recipes/default.rb @@ -97,6 +97,7 @@ end apache_module "cgid" apache_module "rewrite" apache_module "proxy_http" +apache_module "ratelimit" ssl_certificate "planet.openstreetmap.org" do domains ["planet.openstreetmap.org", "planet.osm.org"] diff --git a/cookbooks/planet/templates/default/apache.erb b/cookbooks/planet/templates/default/apache.erb index a67189a0d..8b46d6b04 100644 --- a/cookbooks/planet/templates/default/apache.erb +++ b/cookbooks/planet/templates/default/apache.erb @@ -64,6 +64,11 @@ RewriteRule ^(/cc\-by\-sa/changesets\-latest\.osm\.bz2)$ ${latestplanet:$1} [R,L] RewriteRule ^(/cc\-by\-sa/relations\-latest\.osm\.bz2)$ ${latestplanet:$1} [R,L] + # Temporary download rate limit due to upstream fibre connection issues. - 13 Jan 2020 + SetOutputFilter RATE_LIMIT + SetEnv rate-limit 400 + SetEnv rate-initial-burst 512 + -- 2.39.5