Live data from Hacker News

I made a simple geolocation service

maxkostinevich.com

141–150 of 187 posts

Re: I made a simple geolocation service

#141
post #98

Earlier quoted context omitted.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Sorry silly question, still learning. Can you talk about how your linode setup is? Do you report back the same fields?

It's just a normal linode running archlinux. There are very minimal tweaks to handle the new connection load.

I should write a blog post about it. It has steadily gained more traffic over the years and hasn't need much care and feeding.

The go code can be found here if you're interested, though it some of the ugliest code I've written. I made it when ifconfig.me was having load issues many years ago.

https://github.com/georgyo/ifconfig.io

Re: I made a simple geolocation service

#143
post #98

Earlier quoted context omitted.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Have you considered not including the entire bootstrap.css on the front page since you only use about 1% of it :)

I almost never do frontend work. I'll gladly take a PR if you want to make that one page faster and prettier. Though I don't want to make the build require yarn or other js/css compiler framework for a single page.

Re: I made a simple geolocation service

#144

I applaud your efforts but it's disingenuous to title this how you "made a geolocation service" when you are just reading a field in someone else's geolocation service.

Almost all geolocation services read a field from MaxMind's db file. It's a nice solution. Why log into your alt account to crap on it?

I agree with you. Thanks for being supportive - it speaks very well of you. That said though, hackers are hackers because we think like this.

I'm trying to learn to take it as the highest form of compliment - when hackers care enough to hack on one of my ideas, that means it has to be cool.

Re: I made a simple geolocation service

#145

Earlier quoted context omitted.

Have you considered not including the entire bootstrap.css on the front page since you only use about 1% of it :)

I would assume the majority (99.9%) of the requests is actually API calls without delivering CSS.

Indeed. Only ~30k page views that trigger the google analytic script, so 99.9991% of requests have no html at all.

Re: I made a simple geolocation service

#146

I've been trying to build open source MaxMind alternatives for a bit. (Mostly so I could distribute them with my open source projects) IP to country is fairly easy and I open sourced all the scripts and the database itself [0]. But IP to city is much harder, I'm not actually sure it's viable for anyone to do that without relying on some other 3rd party service. I'd be very interested to hear if anyone knows how to pu…

A big part of why you can't freely distribute Maxmind's Lite databases is them trying to apply CCPA requirements. That law will affect open source solutions just as much.

IANAL but Maxmind has to comply with CCPA I assume because they are sourcing data from California residents. If data is sourced in an aggregate or anonymous way, it wouldn't be subject to CCPA.

> Aggregate and anonymous data is exempt from the CCPA, unless it is in any way re-identifiable. https://www.cookiebot.com/en/what-is-ccpa/

Re: I made a simple geolocation service

#147
I built a simple API using pure NGINX to get the IP address of a client, for times when I needed to ask a customer for his IP address; it was easier sending them a URL for a service I control, than explaining how they could get that information another way.

Now I have been thinking about opening it up for more people because while there are a variety of these services out there, one more does not hurt — it already exists, and works, so who knows, maybe more people would like to use it. The code is open, and access logs go to /dev/null; I could probably add a read-only SSH user for people to confirm that for themselves.

Geolocation could easily be added to it, but then comes my question: is there any use-case for geolocation APIs that does not involve tracking users for shitty purposes?

I was excited about adding this feature because I am using pure NGINX for it, and it was a fun learning experience, but I asked myself that question when I started writing the documentation for the website, and I still do not have an answer. Marketing material for other APIs that offer geolocation usually have user tracking as a selling point.

Personally, I have no use for geolocation, and if all use-cases involve tracking without consent users, and breaking their privacy, I want no part in that.

Re: I made a simple geolocation service

#148
post #98

Earlier quoted context omitted.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Thanks for sharing. This is a perfect example which proves lambda/serverless/cf worker are snake oils.

There's TONS of use cases for Lambdas where the operational costs (both in terms of time/energy/expertise and to lesser extent monetary) of running something persistent are much higher.

In my last gig, we ran plenty of services that would never need to scale and would likely never hit the point where Lambda became too expensive. Low-utilization services (Example for order submit, because we only ever got a couple hundred orders per day), Cron-type jobs (Admins could use Cloudwatch to monitor), Temporary fan-outs using queues. Anything that won't ever hit the millions-per-day level is a good candidate for something along these lines. Most of those services cost <$5/month.

Re: I made a simple geolocation service

#149
post #98

Earlier quoted context omitted.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Thanks for sharing. This is a perfect example which proves lambda/serverless/cf worker are snake oils.

There's a cost curve lambda excels at. For services handling under 100 requests a second it's cheaper than a cheap EC2 instances.

Re: I made a simple geolocation service

#150

I built a simple API using pure NGINX to get the IP address of a client, for times when I needed to ask a customer for his IP address; it was easier sending them a URL for a service I control, than explaining how they could get that information another way. Now I have been thinking about opening it up for more people because while there are a variety of these services out there, one more does not hurt — it already ex…

I have exactly one non-shady use case:

I work with an event org with a fairly common name, and another city in our region has an event with the same name. For some years, we’ve outranked them for major keywords and getting their confused customers was becoming a headache for us.

So now if our website thinks you’re in the other city, a little banner appears above the content asking if you’re looking for the other site, and offers the link.

This has saved us ~10 phone calls per day in season. Before adding this link we all got to the point of just doing their customer service for them and helping people buy tickets because it was less drama than trying to get them to call the right people.

Post reply on HN