Better HN
topnewbestaskshowjobs
Log inSign up

hyperknot

1,249 karma · joined Aug 14, 2015 (11y ago) · 220 submissions

founder of MapHub: https://maphub.net/

personal website: https://hyperknot.com/

email: zsolt@maphub.net

Submissions

comment 2y ago · link · parent

Author here. That's a standard dialog built into the browser, which of course was implemented from Day 1. The problem is that people leave tabs open for indefinite time, the browser regularly saves memory by emptying old tabs and then it's gone.

comment 2y ago · link · parent

I think he was referring to a freely available full planet OSM mbtiles dump, to be used with OpenMapTiles. I cannot find a reference to that in your blog post.

comment 2y ago · link · parent

Yes, the key thing about Btrfs is how it handles inodes and how it can store data with the metadata. In the OpenFreeMap image, 60% of the files are stored with the metadata, essentially taking up no space.

comment 2y ago · link · parent

Cloudflare Free is a good idea, but I'm afraid they'd be the one who limit me before. There is a comment in this thread who did 150 TB+ on Hetzner. I don't believe Cloudflare Free would allow 150 TB, not alone 300 TB in a month (I use two servers currently).

comment 2y ago · link · parent

You are right in that I'd be afraid if this was hosted on AWS or on Cloudflare Workers. This whole idea is only possible because there are some hosts like Hetzner, which offer flat rate bandwidth.

comment 2y ago · link · parent

Thanks a lot! Yes, I believe this dynamic pricing is making it impossible for small or non-profit projects to host maps. And you can see, "fun" maps basically disappeared from the internet - they were really common 10 years ago!

For POIs, they are present in the data, it's just that the styles might not have the matching icons for them. But you can always make them into a circle, etc.

Having said that, working on the styles is a big and never ending effort, so if someone would like to help with matching the POIs then contributors welcome.

comment 2y ago · link · parent

Since I wrote it, one person made 1 commit related to the visual style. Before that, 1 visual commit in 2023 and then 2021 is when work kind of stopped.

comment 2y ago · link · parent

Here the requests are really really small, on average 405 bytes each. I guess in your genomics work you are making larger requests, so probably it's not so much of an issue.

BTW, we are discussing latency with bdon in this issue, it seems to be specific to Cloudflare: https://github.com/hyperknot/openfreemap/issues/16

comment 2y ago · link · parent

Thanks! It's not so bespoke, it's Fabric (https://www.fabfile.org/), it's been around at least since 2011, but probably much longer, since they already had 1.2.0 in 2011. It's a super reliable script for setting up servers over SSH. Yes, you run the same commands you'd type in a terminal, works perfectly.

comment 2y ago · link · parent

I benchmarked and nginx can host 30 Gbps on cold cache, on actual real world load. (I played back a log of 1 million real world requests).

So using nginx in a 1 Gbps server is definitely not asking too much of it, or I might not have understood your comment clearly.

Why would Facebook decide to use my tile server? When a company's business depends on having reliable map tiles, they either self host or have an Enterprise deal with Mapbox, etc.

comment 2y ago · link · parent

Thank you for sharing the story! I hope OpenFreeMap can contribute either with the MBTiles / Btrfs dumps, or with the public instance.

comment 2y ago · link · parent

Yes, small files can fit in the metadata, which makes a super big difference when you have 300 million files of 405 bytes each. Also, inode handling is way better compared to ext4.

comment 2y ago · link · parent

Yes, Versatiles is a nice truly open project! One of the long term plans for OpenFreeMap is to migrate to Shortbread + Versatiles styles.

comment 2y ago · link · parent

Thank you for sharing this, I'll make a issue about both.

The Vatican situation is trickier than you'd think, as it's on country level, while Rome is on city level, and naturally you'd want to give countries a priority over cities. Like on low zooms you only want to show countries, then as it gets closer you show cities. Well, except for Vatican.

comment 2y ago · link · parent

Yes, MapLibre is the gold standard now.

comment 2y ago · link · parent

The Linux kernel's filesystem cache is actually really efficient at doing this. I doubt we could come up with a nginx scripting solution which could be equally efficient.

comment 2y ago · link · parent

The whole extract_mbtiles.py file is 97 lines of code. This contains parsing MBTiles, writing metadata and some CLI specific lines. It's actually quite a concise script for doing this while taking care of the hard-link limits.

comment 2y ago · link · parent

I've literally just launched it.

comment 2y ago · link · parent

On the main page I disabled scroll zoom, because it hijacks your scroll and literally you cannot scroll through the map. It makes sense for full-screen maps only.

Of course, you have 100% control over exactly what controls you configure with MapLibre, when you set up your app.

comment 2y ago · link · parent

My main project is MapHub, it gives me my income. It's not an income like you'd get in a FAANG job, but still, I'm running it for making a living.

For MapHub to work, I had to invest in my own tile server infrastructure: there is no way I could have made MapHub financially profitable with a 3rd party tile provider. So I kept iterating and iterating on the tile server infrastructure and after 9 years I arrived at a state which was worth open-sourcing.

I'm happy if this project gets to the point from sponsorship where my hosting bill is covered ($175 per month), but it doesn't have to be financially successful on its own.

I'll keep working on it because it's part of my main business, not because I beg for donations.

comment 2y ago · link · parent

The thing is that hosting this really isn't that expensive. My first GitHub Sponsors goal is to reach $175 per month, which would cover the hosting on Hetzner. Of course this cost can grow if the project gets more popular, but it's a good start!

I honestly believe this project can cover $175 per month eventually.

Of course there is the countless hours which went and which can possibly go into this, but to cover the hosting is still meaningful.

comment 2y ago · link · parent

Yes, PMTiles with the Caddy plugin is very similar to nginx + Btrfs.

At that point, the difference between the two projects is mostly which schema is being used.

comment 2y ago · link · parent

Thanks a lot, I didn't know about it! I also liked the fact that Btrfs is probably super well tested in the Linux kernel by now.

btrfs.openfreemap.com just a public Cloudflare bucket, no idea why it might be slow.

comment 2y ago · link · parent

I'd recommend at least 200 GB.

comment 2y ago · link · parent

If you know the tile numbers, you can just copy them out of the Btrfs image.

comment 2y ago · link · parent

I think both solutions could easily saturate a 1 Gbps line. I benchmarked Btrfs + nginx and it could do 30 Gbps, which doesn't really make a difference if your server is 1 Gbps only.

The fact that there is no service running was the more important for me. Mostly for security and bugs. I had so many problems with various tile servers in production, they needed daily restarting, they had memory leaks, etc.

Basically I wanted to go nginx-only for security and to avoid tile server bugs.

comment 2y ago · link · parent

Wow, now that's an ambitious project! I wish you a lot of success with it!

comment 2y ago · link · parent

Yes, I think it would. Have a look at the extract_mbtiles script: https://github.com/hyperknot/openfreemap/blob/main/modules/t...

comment 2y ago · link · parent

They are providing the building blocks for making a self-hosted vector tiles server, they don't actually host the tiles.

comment 2y ago · link · parent

No, the ping is 150 ms to us-west-2, and the tiles load in like 5 seconds on a cold start. Of course we cannot test cold start on HN comments because HN is the definition of hot :-)

I can imagine workers to be fast, it's the range requests which are super slow. It's also outside of your control, it depends on how Cloudflare and S3 handles range requests to 90 GB files.

I think if you could make PMTiles split into files <10 MB, it'd be perfect with range requests.

12345
8