-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Limit cache size by default #65
Comments
The linked issue has been implemented, what's a good default cache size? |
@amphp/dns Any suggestions? |
Don't really know. |
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? |
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) |
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 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. |
See amphp/cache#4.
The text was updated successfully, but these errors were encountered: