NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

For past two days some user started bulk downloading tiles from my server. The tile cache quickly eaten up all the disk space. I've blocked that user with iptables, but now wondering if that can be done a) automatically, b) not by physically blocking them, but by replacing tiles with an error tile "you're doing it wrong, contact admin". Is there such option in mod_tile? How it is done on osm.org?

asked 23 Jan '15, 13:31

Zverik's gravatar image

Zverik
61331016
accept rate: 10%


mod_tile has a built-in throttling capability (see demo config file which explains things) where you can slow down tile delivery for IP numbers that ask for too much. The general approach is usingh buckets and top-up rates, i.e. any IP gets an allowance of X tiles initially but then their "bucket" is empty and only fills up again at a predefined rate. You can can even differentiate between tiles that are already there (allow more of those) and tiles that have to be freshly computed (make them reeeealllyy slow). There's no way to switch to an error tile automatically though, I believe.

You an also use fail2ban which would by default simply kill the IP with iptables, but can also be made to re-route the requests to port 81 or so, where you'd have a simple web server that only ever hands out an error tile.

As far as I know, osm.org uses a technique similar to that mod_tile offers, but it runs on the proxy level i.e. before the requests even reach mod_tile.

permanent link

answered 23 Jan '15, 13:50

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 23 Jan '15, 13:50

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×204
×80
×20
×2

question asked: 23 Jan '15, 13:31

question was seen: 5,491 times

last updated: 23 Jan '15, 13:50

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum