KeepAlive and HTTP/1.1 while querying Stardog

3 views
Skip to first unread message

Ron Michael Zettlemoyer

unread,
Nov 11, 2014, 10:12:47 PM11/11/14
to sta...@clarkparsia.com
Recently I started getting .NET WebRequest "underlying connection was closed" errors while using dotNetRDF to query Stardog. I'd only see it when the SPARQL query was POST-ed to Stardog rather than GET-ed (gotten?). It pretty much only happened when connecting to a remote Stardog box (one not on the same server). The servers (both Windows and Linux) were at Azure, running the latest version of Stardog. The kicker was that if I ran through a proxy, like Fiddler, it'd work! Making it hard to debug. FWIW the problem started hitting me hard shortly after upgrading to 2.2.2 but I got it intermittently in earlier versions. I'm not really convinced it has anything to do with 2.2.2.

After a lot of drinking I found this and turned off Keep Alive and switched from HTTP 1.1 to 1.0 and it fixed the problem.

Any ideas why this would be the case? And would permanently turning off Keep Alive and using HTTP 1.0 cause any new problems?

- Ron



Mike Grove

unread,
Nov 17, 2014, 8:15:33 AM11/17/14
to stardog
On Tue, Nov 11, 2014 at 10:12 PM, Ron Michael Zettlemoyer <r...@zettlemoyer.com> wrote:
Recently I started getting .NET WebRequest "underlying connection was closed" errors while using dotNetRDF to query Stardog. I'd only see it when the SPARQL query was POST-ed to Stardog rather than GET-ed (gotten?). It pretty much only happened when connecting to a remote Stardog box (one not on the same server). The servers (both Windows and Linux) were at Azure, running the latest version of Stardog. The kicker was that if I ran through a proxy, like Fiddler, it'd work! Making it hard to debug. FWIW the problem started hitting me hard shortly after upgrading to 2.2.2 but I got it intermittently in earlier versions. I'm not really convinced it has anything to do with 2.2.2.

Do you see anything in the logs?  Are there any queries that tend to trigger the behavior more than others?  Can you replicate the behavior via the command line?  Are the queries being performed within transactions?
 

After a lot of drinking I found this and turned off Keep Alive and switched from HTTP 1.1 to 1.0 and it fixed the problem.

Fixed it, or made it less frequent?
 

Any ideas why this would be the case? And would permanently turning off Keep Alive and using HTTP 1.0 cause any new problems?

Not particularly.  Netty handles those details for us, so we rarely fiddle with the low-level HTTP details.  At the Stardog level, we don't do anything different for keep-alive vs non keep-alive connections, so I don't know how that'd make a difference.

Cheers,

Mike
 

- Ron



--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Ron Michael Zettlemoyer

unread,
Nov 22, 2014, 11:04:11 AM11/22/14
to Stardog
No queries triggered it more than others. Not using transactions. Didn't notice anything in the logs, but I didn't turn on any extra logging yet. I haven't tried to replicate it in the command line yet just because it'd be a pain in the ass and it probably won't misbehave there.

I played with it some more and found that only turning off keep-alive was necessary to fix things. It didn't matter whether I was using HTTP 1.0 or 1.1.

Would having keep-alive turned on matter or ever help? As far as I understand it and Stardog, it doesn't seem like it'd ever be used.

Mike Grove

unread,
Nov 24, 2014, 9:53:53 AM11/24/14
to stardog
On Sat, Nov 22, 2014 at 11:03 AM, Ron Michael Zettlemoyer <r...@zettlemoyer.com> wrote:
No queries triggered it more than others. Not using transactions. Didn't notice anything in the logs, but I didn't turn on any extra logging yet. I haven't tried to replicate it in the command line yet just because it'd be a pain in the ass and it probably won't misbehave there.

I played with it some more and found that only turning off keep-alive was necessary to fix things. It didn't matter whether I was using HTTP 1.0 or 1.1.

That's what I would have guessed.
 

Would having keep-alive turned on matter or ever help? As far as I understand it and Stardog, it doesn't seem like it'd ever be used.

No, having it turned off should be fine.  We're not using it for anything internally.

Cheers,

Mike
Reply all
Reply to author
Forward
0 new messages