Git Product home page Git Product logo

Comments (5)

tmaiaroto avatar tmaiaroto commented on May 23, 2024

About 655mb of memory allocated to do the initial load. Then each lookup allocates about 1.4mb of memory. So I'd like to reduce the memory needs so that this package works on smaller virtual servers.

from geobed.

tmaiaroto avatar tmaiaroto commented on May 23, 2024

Apparently some of the records from MaxMind don't have lat/lng values set (they come out to 0 when parsed). So removing those has reduced the data set from 2,771,454 to 1,968,549 records.

This has reduced the memory allocation to about 496mb to load the set and 0.58mb per lookup (which are also now faster). Getting closer to running on a 512MB RAM VPS!

Removing the index on the first two characters saved a little more. 451mb to load the set now. 0.56mb per lookup (not expected to change in this case). That index wasn't being used, but could be to further increase lookup speed.

from geobed.

tmaiaroto avatar tmaiaroto commented on May 23, 2024

2,008,788 records now. The previous limitation was too aggressive. Still, that's 478mb to load into memory and 0.56mb per lookup (0.005s).

from geobed.

tooolbox avatar tooolbox commented on May 23, 2024

Is this memory growth bounded? I noticed that the first time I loaded geobed, it was using 2.5GB of memory (!!!!!) but on successive loads it was ~500mb and went up to ~650mb as I ran lookups. Will it eventually hit 2.5GB?

from geobed.

tmaiaroto avatar tmaiaroto commented on May 23, 2024

It does require a good bit of memory unfortunately. I thought it was bit less than 2.5GB though... Hmm.. I wanted to look into memory mapped files to reduce this. I was thinking about BoltDB at some point too.

from geobed.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.