Giter VIP home page Giter VIP logo

Comments (6)

kelunik avatar kelunik commented on July 23, 2024

The linked issue has been implemented, what's a good default cache size?

from dns.

kelunik avatar kelunik commented on July 23, 2024

@amphp/dns Any suggestions?

from dns.

bwoebi avatar bwoebi commented on July 23, 2024

Don't really know.
I think a LRU cache with size=256 should be really sufficient for most needs. That's not too large, but really not less than 99% of use cases will need.

from dns.

Danack avatar Danack commented on July 23, 2024

If it's a LRU cache, it should be way bigger than 256. Memory is pretty cheap and the entries are pretty small, right?

Is there any problem with having a 64kB entry cache?

from dns.

bwoebi avatar bwoebi commented on July 23, 2024

I meant 256 entries ;-), which, in PHP, will be around 80 KB, I guess. (if using an array as fundamental structure … an object could optimize it a bit, down to probably 30 KB)

from dns.

kelunik avatar kelunik commented on July 23, 2024

Yes, it's LRU as implemented in amphp/cache#5. Entries should be pretty small. Keep in mind that one lookup usually creates two entires, one for A and one for AAAA.

I guess something like 4096 entries should be totally enough? But most applications probably need way less, because they either query the same domains over and over or query random domains.

from dns.

Related Issues (20)

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.