Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1142

Configuration property for jetty request buffer size.

    Details

      Description

      This is a feature request to allow the configuration of the jetty request buffer size.

      See BLZG-1138 (configure jetty response buffer size)

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        This can be defined per the following pattern. However, a smaller default should be used!

        /**
                        * The name of the system property that may be used to specify the maximum
                        * size (in bytes) for the Jetty request buffer (default @value
                        * {@value #DEFAULT_MAX_REQUEST_BUFFER_SIZE})
                        *
                         */
                        public static final String REQUEST_BUFFER_SIZE = RemoteRepository.class
                                                        .getName() + ".requestBufferSize";
         
                        /**
                        * The default maximum size of the jetty request buffer (@value
                        * {@value #DEFAULT_MAX_REQUEST_BUFFER_SIZE}).
                        */
                        public static final String DEFAULT_REQUEST_BUFFER_SIZE = "20971520";
        ?.
                                        httpClient.setRequestBufferSize(Integer.parseInt(System.getProperty(
                                                                        REQUEST_BUFFER_SIZE,
                                                                        DEFAULT_REQUEST_BUFFER_SIZE)));
        
        Show
        bryanthompson bryanthompson added a comment - This can be defined per the following pattern. However, a smaller default should be used! /** * The name of the system property that may be used to specify the maximum * size (in bytes) for the Jetty request buffer (default @value * {@value #DEFAULT_MAX_REQUEST_BUFFER_SIZE}) * */ public static final String REQUEST_BUFFER_SIZE = RemoteRepository.class .getName() + ".requestBufferSize"; /** * The default maximum size of the jetty request buffer (@value * {@value #DEFAULT_MAX_REQUEST_BUFFER_SIZE}). */ public static final String DEFAULT_REQUEST_BUFFER_SIZE = "20971520"; ?. httpClient.setRequestBufferSize(Integer.parseInt(System.getProperty( REQUEST_BUFFER_SIZE, DEFAULT_REQUEST_BUFFER_SIZE)));
        Hide
        bryanthompson bryanthompson added a comment -

        The response buffer is managed by the RemoteRepository. However, the request buffer is managed by the Jetty HttpClient class. Thus, the caller can already configure this value by overriding the jetty client configuration. For example, using the HttpClientConfigurator to provide a factory (other than DefaultHttpClientFactory) for HttpClient instances. Further, it is not really appropriate for the RemoteRepository to change the configuration on the HttpClient object since that might have been allocated and pre-configured explicitly by the caller.

        Further, it appears that you can already specify the default response buffer size as well on the http client using the same mechanisms.

        Therefore, I have added the parameter to control the request buffer size to the DefaultHttpClientFactory. This is the factory for the HttpClient objects that are used by default. I have also MOVED the response buffer size parameter to the DefaultHttpClientFactory and REMOVED it from the JettyResponseListener API (it is presumed to be used by default now).

        DefaultHttpClientFactory

        	    /**
        		 * The name of the system property that may be used to specify the maximum
        		 * size (in bytes) for the Jetty response buffer (default @value
        		 * {@value #DEFAULT_RESPONSE_BUFFER_SIZE})
        		 * 
        		 * @see <a href="http://trac.bigdata.com/ticket/1092"> Set query timeout and
        		 *      response buffer length on jetty response listener</a>
        		 * @see <a href="http://trac.bigdata.com/ticket/1096"> Set jetty request
        		 *      buffer size</a>
        		 */
        		static public final String RESPONSE_BUFFER_SIZE = DefaultHttpClientFactory.class
        				.getName() + ".responseBufferSize";
        	    
        		/**
        		 * The default maximum size of the jetty response buffer (@value
        		 * {@value #DEFAULT_RESPONSE_BUFFER_SIZE}).
        		 * <p>
        		 * Note: The default value for the jetty platform is 16kb.  
        		 */
        	    static public final int DEFAULT_RESPONSE_BUFFER_SIZE = 16 * 1024;
        	    
        		/**
        		 * The name of the system property that may be used to specify the maximum
        		 * size (in bytes) for the Jetty request buffer (default @value
        		 * {@value #DEFAULT_REQUEST_BUFFER_SIZE})
        		 * 
        		 * @see <a href="http://trac.bigdata.com/ticket/1096"> Set jetty request
        		 *      buffer size</a>
        		 */
        		public static final String REQUEST_BUFFER_SIZE = DefaultHttpClientFactory.class
        				.getName() + ".requestBufferSize";
        
        		/**
        		 * The default maximum size of the jetty request buffer (@value
        		 * {@value #DEFAULT_REQUEST_BUFFER_SIZE}).
        		 * <p>
        		 * Note: The default value for the jetty platform is 4kb.
        		 */
        		public static final int DEFAULT_REQUEST_BUFFER_SIZE = 16 * 1024;
        

        See BLZG-1138 (configure jetty response buffer size)

        Show
        bryanthompson bryanthompson added a comment - The response buffer is managed by the RemoteRepository. However, the request buffer is managed by the Jetty HttpClient class. Thus, the caller can already configure this value by overriding the jetty client configuration. For example, using the HttpClientConfigurator to provide a factory (other than DefaultHttpClientFactory) for HttpClient instances. Further, it is not really appropriate for the RemoteRepository to change the configuration on the HttpClient object since that might have been allocated and pre-configured explicitly by the caller. Further, it appears that you can already specify the default response buffer size as well on the http client using the same mechanisms. Therefore, I have added the parameter to control the request buffer size to the DefaultHttpClientFactory. This is the factory for the HttpClient objects that are used by default. I have also MOVED the response buffer size parameter to the DefaultHttpClientFactory and REMOVED it from the JettyResponseListener API (it is presumed to be used by default now). DefaultHttpClientFactory /** * The name of the system property that may be used to specify the maximum * size (in bytes) for the Jetty response buffer (default @value * {@value #DEFAULT_RESPONSE_BUFFER_SIZE}) * * @see <a href="http://trac.bigdata.com/ticket/1092"> Set query timeout and * response buffer length on jetty response listener</a> * @see <a href="http://trac.bigdata.com/ticket/1096"> Set jetty request * buffer size</a> */ static public final String RESPONSE_BUFFER_SIZE = DefaultHttpClientFactory.class .getName() + ".responseBufferSize"; /** * The default maximum size of the jetty response buffer (@value * {@value #DEFAULT_RESPONSE_BUFFER_SIZE}). * <p> * Note: The default value for the jetty platform is 16kb. */ static public final int DEFAULT_RESPONSE_BUFFER_SIZE = 16 * 1024; /** * The name of the system property that may be used to specify the maximum * size (in bytes) for the Jetty request buffer (default @value * {@value #DEFAULT_REQUEST_BUFFER_SIZE}) * * @see <a href="http://trac.bigdata.com/ticket/1096"> Set jetty request * buffer size</a> */ public static final String REQUEST_BUFFER_SIZE = DefaultHttpClientFactory.class .getName() + ".requestBufferSize"; /** * The default maximum size of the jetty request buffer (@value * {@value #DEFAULT_REQUEST_BUFFER_SIZE}). * <p> * Note: The default value for the jetty platform is 4kb. */ public static final int DEFAULT_REQUEST_BUFFER_SIZE = 16 * 1024; See BLZG-1138 (configure jetty response buffer size)

          People

          • Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: