rdf4j icon indicating copy to clipboard operation
rdf4j copied to clipboard

[FedX] Configure timeouts using the configuration file

Open ludovicm67 opened this issue 10 months ago • 4 comments

Problem description

I'm currently using the following to create the FedX repository from a turtle configuration file:

FedXFactory.createFederation(configFile)

My configuration file look like this:

@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
@prefix fedx: <http://rdf4j.org/config/federation#> .

<http://example.com/endpoint1> a sd:Service ;
	fedx:store "SPARQLEndpoint";
	sd:endpoint "http://endpoint1:8080/sparql".

<http://example.com/endpoint2> a sd:Service ;
	fedx:store "SPARQLEndpoint";
	sd:endpoint "http://endpoint2:8080/sparql".

<http://example.com/endpoint3> a sd:Service ;
	fedx:store "SPARQLEndpoint" ;
	sd:endpoint "http://endpoint3:8080/sparql".

<http://example.com/endpoint4> a sd:Service ;
	fedx:store "SPARQLEndpoint";
	sd:endpoint "http://endpoint4:8080/sparql".

One of my endpoint is a Ontop endpoint in front of a huge database, and queries to that endpoint are very slow.

Currently, it's so slow, that even simple queries are hitting a timeout (in the logs: java.net.SocketTimeoutException: Read timed out, and a 500 is returned).

I want to know if it is possible to configure timeouts in general and by endpoint.

Preferred solution

Be able to configure timeouts for the global FedX instance and for each configured endpoint using the configuration file, and have those options documented.

Are you interested in contributing a solution yourself?

No

Alternatives you've considered

No response

Anything else?

In my situation, I know that one endpoint is very slow, so I ideally I just want to increase the timeout for that endpoint. If a query takes too long on other endpoints, then throwing the timeout makes sense.

ludovicm67 avatar Aug 23 '23 09:08 ludovicm67