Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache geoip lookups #1071

Merged
merged 8 commits into from
Aug 6, 2019
Merged

cache geoip lookups #1071

merged 8 commits into from
Aug 6, 2019

Conversation

jbenet
Copy link
Member

@jbenet jbenet commented Jul 23, 2019

geoip lookups for the same ip4 addr can be cached. this uses a similar
cache to the peerid location cache (arguably peerid loc shouldnt be
cached-- ip addr only?).


Requesting a pull to ipfs-shipyard:master from ipfs-shipyard:cache-geoip-lookups

Changes:

a1290cc (jbenet, 20 seconds ago)
bumped up concurrency for geoip lookups

28af4b6 (jbenet, 6 minutes ago)
cleaned up geoip cached resolver code

cleaned up the geoip cached resolver code some. put things into a class.

4f33563 (jbenet, 32 minutes ago)
cache geoip lookups

geoip lookups for the same ip4 addr can be cached. this uses a similar
cache to the peerid location cache
(arguably peerid loc shouldnt be cached-- ip addr only?) the code is a bit
messy, and probably should be refactored

This reduced my load time significantly.

lots of nodes have the same ip4 addr:

  • nodes under same physical machine
  • nodes under same VPN
  • nodes under same carrier grade nats
  • nodes behind city-wide firewalls

eg lots of nodes in china show the same ip addr.

e9ece8e (jbenet, 2 hours ago)
class should be className

Seems like this is a bug -- caught by the dev server compiler/linter

jbenet added 4 commits July 23, 2019 00:26
Seems like this is a bug -- caught by the dev server compiler/linter
geoip lookups for the same ip4 addr can be cached.
this uses a similar cache to the peerid location cache
(arguably peerid loc shouldnt be cached-- ip addr only?)
the code is a bit messy, and probably should be refactored

This reduced my load time significantly.

lots of nodes have the same ip4 addr:
- nodes under same physical machine
- nodes under same VPN
- nodes under same carrier grade nats
- nodes behind city-wide firewalls

eg lots of nodes in china show the same ip addr.
cleaned up the geoip cached resolver code some.
put things into a class.
@jbenet
Copy link
Member Author

jbenet commented Jul 23, 2019

Note, i couldn't get the map to render properly (osx). it gives this error in the console, and stops rendering dots. Looks like a d3 error w/ the paths:

I dont think this is due to this changeset -- the same error exists for me in master.

Note: looks like d3 currently renders one dot per peer. it should probably render one dot per city (massively deduped).

image

@jbenet
Copy link
Member Author

jbenet commented Jul 23, 2019

I also get these logs in the console -- ~6msgs every second

image

@jbenet
Copy link
Member Author

jbenet commented Jul 23, 2019

BTW, this is critical when peer count is large :) -- though it starts helping at ~100 peers

image

@jbenet jbenet force-pushed the cache-geoip-lookups branch from d361921 to 70e843f Compare July 23, 2019 09:41
@olizilla
Copy link
Member

Wowsez! I need to create some tests with large numbers of peers. I've never seen a 26k before. Thanks for the heads up, will dig into it.

@olizilla olizilla mentioned this pull request Jul 23, 2019
8 tasks
@olizilla
Copy link
Member

Here is a first draft of all things we need to fix in the peers page: #1072

@olizilla
Copy link
Member

Am digging in to why the e2e test fails on CI. @jbenet I'm gonna adopt this PR. Let me know if you are still working on it.

#1039 fixed a bunch
of language issues, including upgrading a hyphen to and endash in
the page title of the ipld explore section. The page title is used
to by the e2e test to check that navigation has worked.

This tweak should fix e2e tests for this PR.

We have a more general issue in that we don't get CI tests for PRs
from forks, as circle-ci (and all the CI systems) have no good way
to protect users from exfiltration of secrets if you let anyone
trigger a CI build, and the config for CI is stored in the repo...
@jbenet
Copy link
Member Author

jbenet commented Jul 23, 2019

thanks for adopting! go for it! 👍

@olizilla
Copy link
Member

olizilla commented Aug 6, 2019

@hacdias if you're happy with this it can be merged as is and we can refine it as discussed in #1072

@hacdias
Copy link
Member

hacdias commented Aug 6, 2019

Merged with master, looks good and seems to work well.

@hacdias hacdias merged commit 01561df into master Aug 6, 2019
@hacdias hacdias deleted the cache-geoip-lookups branch August 6, 2019 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants