incubator-jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Castagna <>
Subject SPARQL endpoints and high CPU usage when a client goes away...
Date Thu, 03 Mar 2011 18:09:57 GMT
we have noticed a high CPU usage when a client send a SPARQL query
which returns a large result set and the client goes away when we
are streaming back the response.

I think I might have found the reason why the high CPU usage persist
even after the client went away.

We use ResultSetFormatter.outputAsXML(OutputStream outStream,
ResultSet qresults) which is then using IndentedWriter:<init>(String)
simple.http.MonitoredOutputStream.write(byte[], int, int)
simple.http.ResponseStream.write(byte[], int, int)
com.hp.hpl.jena.sparql.resultset.XMLOutputResultSet.binding(String, RDFNode)
com.hp.hpl.jena.sparql.resultset.XMLOutput.format(OutputStream, ResultSet)
com.hp.hpl.jena.query.ResultSetFormatter.outputAsXML(OutputStream, ResultSet, 
com.hp.hpl.jena.query.ResultSetFormatter.outputAsXML(OutputStream, ResultSet)

If an IOException is generated, for example, because the client which
we were streaming the response to went away, the exception is swallowed
by the write method in IndentedWriter:

     private void write(char ch)
     { try { out.write(ch) ; } catch (IOException ex) {} }

The problem does not depend on the particular web framework used.

I think Fuseki is affected by the same problem, but I have not time to replicate
it with Fuseki yet.

Am I missing something here?

Thank you,

View raw message