[ 
https://issues.apache.org/jira/browse/JENA-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13729510#comment-13729510
 ] 

Andy Seaborne commented on JENA-498:
------------------------------------

Testing, using client and server on the same Linux machine, shows the 
non-deterministic behaviour albeit with a different exception at between 20K 
and 50K very simple SPARQL update requests requests (INSERT DATA { :s :p :o }).

Guess: the operating system can not keep up with the rate open/close 
connections and temporarily runs out of some system resource.  It may also be 
the jetty server not returning resources fast enough to the operating system.  

Adding a pause in the client, say every 100 operations, shows that in that case 
example runs (until 1.1 million requests when the test was stopped out of 
boredom).  This may be giving the Fuseki server more chance to run; it may be 
giving the operating system a chance to do house-keeping.

If this is the case, the client is unwittingly making a denial-of-service 
attack on the server.  Sending few, larger requests is better for several 
reasons including atomicity of the request.

The other solution is a more sophisticated HttpOp that manages request pools so 
that connections are cached (if they are not already by Apache HTTP client - if 
they are, this may be another source of retained networking resources).

                
> Multiple repeated use of HttpOp.execHttpPost leads to "No buffer space 
> available (maximum connections reached?)"
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: JENA-498
>                 URL: https://issues.apache.org/jira/browse/JENA-498
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RIOT
>    Affects Versions: Jena 2.10.1, Fuseki 0.2.7
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>
> From
> http://mail-archives.apache.org/mod_mbox/jena-users/201308.mbox/%3CCAE5DGJjODJJ-o5t4gJCGqc6mXPyLgDbsDgD%2BxM0eU6WZVacbbw%40mail.gmail.com%3E
> See 
> http://stackoverflow.com/questions/6068423/java-net-socketexception-no-buffer-space-available-maximum-connections-reached
> Things to check:
> * The SO link suggests having only one HttpClient.
> * Make sure the POST is closed (entity consumed)
> * Call HttpRequestBase.reset() 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to