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 |
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. answered 23 Jan '15, 13:50 Frederik Ramm ♦ |