cache-handler icon indicating copy to clipboard operation
cache-handler copied to clipboard

nutsdb: server hang without log

Open daflyinbed opened this issue 1 year ago • 2 comments

caddy 2.8.4 cache-handler v0.13.0 in global option:

    cache {
        nuts {
            configuration {
                Dir /tmp/nuts-configuration
                EntryIdxMode 1
                RWMode 0
                SegmentSize 1024
                NodeNum 42
                SyncEnable true
                StartFileLoadingMode 1
            }
        }
        storers nuts
    }

/tmp/nuts-configuration is created, but caddy response internal server error to client.

daflyinbed avatar Jun 25 '24 05:06 daflyinbed

Hello @daflyinbed do you have some logs about that? Are there any error logs during startup?

darkweak avatar Jun 28 '24 09:06 darkweak

No. I will try to reproduce this problem in test environment in next few weeks. ( I've reverted back to using Varnish, so this is not my top priority task )

daflyinbed avatar Jun 29 '24 07:06 daflyinbed

Same here

long2ice avatar Oct 16 '24 15:10 long2ice

@long2ice same question then, do you have some logs about that? Are there any error logs during startup?
Can you give me more context?

darkweak avatar Oct 16 '24 15:10 darkweak

@daflyinbed Thanks for your reply! I tried many storages which support file storage, but none of them work fine for me. For badger, it cost much memory and I didn't found any solution. For nutsdb, it will hang up after some time. This is my minimal caddy file:

{
        admin :2019
        cache {
                api {
                        souin
                        prometheus
                }
                nuts {
                        path /data/nuts
                }
                ttl 1h
        }
        https_port 8443
        email [email protected]
        acme_dns cloudflare xx
        acme_ca https://acme.zerossl.com/v2/DV90
        acme_eab {
                key_id xx
                mac_key xx
        }
        servers {
                listener_wrappers {
                        proxy_protocol
                        tls
                }
        }
        layer4 {
                :443 {
                        @secure_cdn tls sni example.com
                        route @secure_cdn {
                                proxy {
                                        proxy_protocol v2
                                        upstream 127.0.0.1:8443
                                }
                        }
                }
        }
}

example.com {
        reverse_proxy https://upstream.com
}

long2ice avatar Oct 16 '24 16:10 long2ice

For who have same problem, I finally use https://github.com/sillygod/cdp-cache

long2ice avatar Oct 17 '24 06:10 long2ice

For who have same problem, I finally use https://github.com/sillygod/cdp-cache

That's not a suitable solution because the module you are mentioning is not maintained and doesn't implement fully the RFC. By the way I'm already working on a filesystem storage with TTL based eviction but that takes time to work on that beside my daily work and other projects I'm contributing to.

darkweak avatar Oct 17 '24 06:10 darkweak

For who have same problem, I finally use https://github.com/sillygod/cdp-cache

That's not a suitable solution because the module you are mentioning is not maintained and doesn't implement fully the RFC. By the way I'm already working on a filesystem storage with TTL based eviction but that takes time to work on that beside my daily work and other projects I'm contributing to.

Thanks! Looking forward to it. I think It is useful for many people who do not want too high performance by providing a simple filesystem storage.

long2ice avatar Oct 17 '24 06:10 long2ice