-->	mattiasb (mattiasb@nl.freeBNC.net) has joined #sysadmin
mattiasb    av: ping
av          mattiasb: hi
mattiasb    hi! How's it going? :)
av          is it my room mate there?
mattiasb    I have some questions from the maps-team (that also has to do with general geolocation stuff). 
mattiasb    the same :)
av          woo, hi man! missing our talks :)
av          mattiasb: sure!
mattiasb    yeah! I'm a bit on-and-off on IRC.
mattiasb    Ok so, basically we want two things, one is probably more reasonable than the other. 1) a proxy for nominatim on nominatim.gnome.org 2) our own instance of nominatim
mattiasb    How should I / we go forward if we want to make a request for this? Who should be involved?
av          can you tell me more about the reqs? also what's nominatim?
av          is it packaged?
mattiasb    The reason for a proxy is so that the nominatim guys can tell us kindly that our traffic are too high without having to ban us (ie so that we can turn off or redirect existing programs "in the wild" when / if that is requested).. 
mattiasb    I have some links for you. One sec
mattiasb    http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Fedora.2FCentOS
mattiasb    The server demands are around 32GB's of ram (and cpu/network depends on the amount of requests of course).
av          that's a lot :(
mattiasb    also an IRC-log when we talked to the nominatim-guys a while ago: https://bugzilla.gnome.org/attachment.cgi?id=251631
mattiasb    yeah I know :/
mattiasb    suppose that we go for a proxy for now. How much money would I need to raise to get GNOME a server that could host nominatim. :) (Blue sky dreaming)
mattiasb    (and I guess a server can't just stand there being unmaintaned also, and it draws power etc)
mattiasb    brb, fetching a coke
av          mattiasb: corporate servers cost a lot, and it's usually best to get one through a partner, so we actually have a special warranty and support
andreasn	but we don't have any server that we can use for this today, right?
av          andreasn: our new machines are being used by OSTree and by many virtual machines, the total amount of RAM is 48G but having 32G or more used for a service will get us into troubles
andreasn	I see
av          if we need to deploy more VMs or we need to migrate some services in the case something breaks
mattiasb    ah
mattiasb    so doing this would likely demand a new dedicated machine basically?
av          yes
av          the geo location service isn't a critical service right now
mattiasb    So. What do you think a machine of this magnitude would cost? 
mattiasb    That depends on if you're building Maps or not ;) But yeah, I totally get that.
av          mattiasb: around 7k dollars?
av          maybe more with taxes
mattiasb    That's a lot of money for sure
av          yeah : /
av          also we must make sure that the donation is managed by one of our sponsors as I told you above, so that we get support + warranty
mattiasb    Hm yeah
mattiasb    Thanks a lot for this info, I didn't have a high hope for this right now anyways but I like knowing what we're dealing with etc. :)
mattiasb    So back to point #1, proxying.
av          mattiasb: what kind of proxy do you need? caching proxy?
mattiasb    yeah I think so
mattiasb    I have no idea how much cache is reasonable though
av          mattiasb: can you explain me how the whole thing works? I mean we set up a nominatim.gnome.org service
av          what the caching proxy should then do?
mattiasb    But my guess is that a cache would handle a large percent of the requests since people search for the same places. 
mattiasb    Ok so nominatim is just an HTTP REST service
mattiasb    One sec. Gonna read up a little bit
av          mattiasb: but the proxy will actually be needed for the service itself right?
av          mattiasb: I mean there's no point in adding a proxy if we won't host the service for now
av          but the way I see it is: varnish + nominatim 
mattiasb    The proxy is needed for a few reasons.
av          mattiasb: you can try and ask OSU OSL a machine, but I doubt they'll provide us with a machine with that specs
mattiasb    1) if we get our own instance at some poing we want to be able to redirect our client to the new one
mattiasb    2) nominatim demands that you do this I think (need to read up on that too)
mattiasb    3) if nominatim thinks that we are overusing their service we need to be able to shut down the other apps (that is also stated in the ToS)
mattiasb    hold
mattiasb    I'll find the ToS
mattiasb    the interface is here btw: http://wiki.openstreetmap.org/wiki/Nominatim
mattiasb    and the return values are just json or xml
av          mattiasb: so we set up our own istance but we rely on the official nominatim for gathering some of the data?
av          thus the need to cache the requests as much as possible to not overload them?
mattiasb    Nah we set up a proxy (nginx, haproxy, varnish) and point to the official nominatim instance. 
mattiasb    and yeah
mattiasb    we proxy to make the load lesser on them
mattiasb    (and to be future proof)
mattiasb    here's the usage policy btw: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy
av          mattiasb: mmm...so we actually need a caching proxy in front of a reverse proxy
av          mattiasb: first to cache the requests then to reverse the request to the nominatim server
mattiasb    ah ok
av          which acts as a backend
mattiasb    that sounds correct
av          what could be the other way? running our own istance of nominatim?
mattiasb    "that sounds correct" basically meant: "I don't really know the difference between a caching proxy and a reverse proxy, but it sounds like we are on the same page"  :)
mattiasb    or I understand it now, from context. :)
av          mattiasb: honestly I'm not getting how nominatim would actually work :)
av          mattiasb: the way I see it is:
av          1. caching proxy
av          2. reverse proxy that redirects the request to the backend
av          3. the backend is a local nominatim server 
mattiasb    3 would instead be http://nominatim.openstreetmap.org/
av          4. the local nominatim server then query the database at the official nominatim server
mattiasb    (which is a nominatim demo instance that we can freely use for now)
mattiasb    try this for example: http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1
mattiasb    or: http://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon=1&addressdetails=1
av          mattiasb: "For a full planet install you will need about 600GB of hard disk space" :D
mattiasb    :)
mattiasb    That's vector data mind you
mattiasb    at my old company we had 6 zoom levels of raster images of sweden (fly photo). That was 6TB :P
av          oh damnit
mattiasb    So for serving the whole world you cache the hot spots and generate the rest.
mattiasb    There's a lot of 256x256 tiles of just blue for example (the ocean is big) :)
 *	mattiasb likes talking about maps :P
av          :D
av          mattiasb: I wasn't aware of maps being so heavy in requirements
mattiasb    me neither before i started working with it
av          mattiasb: I would get in touch with the OSU OSL guys about this tbh
av          I'm sure about the answer but it's worth trying
mattiasb    ah about a server for nominatim?
mattiasb    but back on track. 
mattiasb    I want some answers before either one of us need to leave. :D
mattiasb    1) where should I send emails about a proxy setup? 2) Do you understand what I mean about this proxy setup?
av          mattiasb: I feel I didn't get about what "proxy setup" you need, we actually need the whole app deployed before setting the proxies up
mattiasb    no that's the important point
mattiasb    we would just set up a proxy that would forward to nominatim.openstreetmaps.org
mattiasb    but also have a cache in front
mattiasb    so
mattiasb    three layers
mattiasb    1) cache proxy 2) reverse proxy (or something) 3) nominatim.openstreetmap.org
av          mattiasb: yeah, so that's probably what I proposed above, which is using nominatim.openstreetmaps.org as our "backend"
mattiasb    yup
av          and what are the reqs for this?
mattiasb    how much we would need to cache do you mean?
av          no, what are the reqs for the proxy setup itself in term of CPU / RAM
mattiasb    I'd hope you would know that better than me. :)
av          that indeed depends on the amount of users we'll receive but yeah :)
av          puiterwijk: adding the whole thing to the existing proxies would load them too much in your opinion?
mattiasb    but I guess it's how much processing power that nginx/haproxy/varnish/whatever takes + a linear amount of cpu relative to the amount of requests
av          puiterwijk: ideally we can just add a varnish istance in front of haproxy
av          mattiasb: yeah :) I'll discuss this with puiterwijk as soon as he recovers from FLOCK :)
av          hang around here :)
mattiasb    hehe
av          mattiasb: but yeah, I like the whole idea of having our own geolocation service
av          especially when gnome-maps will be ready :-)
av          mattiasb: so the reverse proxy will just pass the correct url to nominatim.openstreetmap.org in the form of http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1
mattiasb    Yeah. :) It's also a bit more universally usable than for example graphhopper (which is another service I might bug you about in a few months)
mattiasb    av: yes
av          mattiasb: request --> nominatim.gnome.org/xml_stuff --> reverse proxy --> nominatim.openstreetmap.org/xml_stuff
av          that makes sense
av          with varnish in front of request
mattiasb    I guess we could be fancy and disable xml and just demand json or say that we only proxy to /search and /reverse (to not support the html client).
av          yeah
mattiasb    but not sure what it would gain us
av          not sure people will decide to use nominatim.gnome.org on a web browser anyway
av          when they can actually use the service itself
av          it makes sense when nominatim.g.o will be built-in into gnome-maps
mattiasb    it would ofc be good for the cache if we only had one sort of data and only one sort of request, but we control the client code anyway. So unless some people start using our proxy instead we should be fine.
mattiasb    "some people" == "some non-gnomers that find out about nominatim.g.o"
av          yeah
av          I see your point
av          we'll just add a vhost on apache
av          for preventing that to happen
mattiasb    ok cool. If it is simple to add and later change then go for it. 
mattiasb    one thing more
mattiasb    changing what "backend" we point to is also not too hard right?
mattiasb    I ask since there's also another free instance of nominatim that mapquest hosts
mattiasb    last time I read up on their ToS I was a bit scared but I see in the irc-logs I linked earlier that the nominatim-devs suggested that we might use their service instead (/also):
av          mattiasb: one puppet commit away :=
av          :)
mattiasb    nice! :)
mattiasb    av: do you mind me posting this log in bz btw? 
av          no, go ahead
mattiasb    cool thx!
av          mattiasb: I have all the details I need, I'll poke puiterwijk tomorrow and discuss the whole thing with him
av          then we can go ahead and deploy it
