zazuko / trifid

Lightweight Linked Data Server and Proxy
Apache License 2.0
77 stars 10 forks source link

Trifid is slow to start #345

Closed tpluscode closed 1 month ago

tpluscode commented 3 months ago

I configured trifid with Lando but I expect the same would happen with plain docker compose.

When started, I quickly get the Server listening on http://0.0.0.0:8080 message in logs but the health check takes several more seconds to actually start (docker reports the container as "starting..."). During that time all requests to trifid return 404

What is taking so long? If it has to be like that, can we implement a "Starting up" page which would automatically refresh until the server is ready to serve resources?

ludovicm67 commented 3 months ago

Can you check the health check interval? And provide a quick way to try your scenario?

The "Starting up" page is not a good solution, as we want to be able to serve content as fast as possible, including things that are not the dereferenced pages. The only thing that might take a bit more time, is when it's using the file-handler plugin, where it needs to read the triple file from the disk, load it in memory and load everything in the Oxigraph instance. The file-handler offers a great way to play with data quickly, but for improved performances, using a dedicated endpoint would be the way to go.

ludovicm67 commented 1 month ago

I finally managed to reproduce the issue by using a Docker Compose stack, where the health check was not able to succeed.

I updated the health check configuration. It should be faster to start and doesn't rely anymore on the resolution of localhost. In case localhost was resolving to the IPv6 version and if Trifid is only listening to IPv4, then the health check was never able to be work.

Everything should be fixed since v5.0.4.