Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] HTTP/2 max concurrent streams

I see. I fixed this by changing the source code to disable the check whether the number of concurrent streams is exceed. But anyway thanks a lot. 

BTW: do you think client can send max_concurrent_streams in the settings frame to tell the server to change this value? Nginx support it while h2o doesn't support it.

A question related to this:
I tried to make 500 concurrent streams using a for loop. And when the file I request is big, it may come out such a exception below:

2015-10-21 21:33:03.397:DBUG:oejh.HTTP2Session:qtp1360875712-10: Removed HTTP2Stream@61009542#999{sendWindow=2147483647,recvWindow=65525,reset=false,CLOSED}

2015-10-21 21:33:03.397:WARN:oeju.Promise$Adapter:qtp1360875712-10: 

java.lang.OutOfMemoryError: Java heap space

at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)

at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)

at org.eclipse.jetty.util.BufferUtil.allocate(BufferUtil.java:114)

at org.eclipse.jetty.io.MappedByteBufferPool.newByteBuffer(MappedByteBufferPool.java:70)

at org.eclipse.jetty.io.MappedByteBufferPool.acquire(MappedByteBufferPool.java:60)

at org.eclipse.jetty.io.ByteBufferPool$Lease.acquire(ByteBufferPool.java:71)

at org.eclipse.jetty.http2.generator.HeadersGenerator.generateHeaders(HeadersGenerator.java:78)

at org.eclipse.jetty.http2.generator.HeadersGenerator.generate(HeadersGenerator.java:54)

at org.eclipse.jetty.http2.generator.Generator.control(Generator.java:80)

at org.eclipse.jetty.http2.HTTP2Session$ControlEntry.generate(HTTP2Session.java:1028)

at org.eclipse.jetty.http2.HTTP2Flusher.process(HTTP2Flusher.java:247)

at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)

at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)

at org.eclipse.jetty.http2.HTTP2Session.frame(HTTP2Session.java:607)

at org.eclipse.jetty.http2.HTTP2Session.frames(HTTP2Session.java:581)

at org.eclipse.jetty.http2.BufferingFlowControlStrategy.onDataConsumed(BufferingFlowControlStrategy.java:144)

at org.eclipse.jetty.http2.HTTP2Session$1.succeeded(HTTP2Session.java:173)

at Client7$1.onData(Client7.java:155)

at org.eclipse.jetty.http2.HTTP2Stream.notifyData(HTTP2Stream.java:362)

at org.eclipse.jetty.http2.HTTP2Stream.onData(HTTP2Stream.java:263)

at org.eclipse.jetty.http2.HTTP2Stream.process(HTTP2Stream.java:208)

at org.eclipse.jetty.http2.HTTP2Session.onData(HTTP2Session.java:168)

at org.eclipse.jetty.http2.parser.BodyParser.notifyData(BodyParser.java:103)

at org.eclipse.jetty.http2.parser.DataBodyParser.onData(DataBodyParser.java:138)

at org.eclipse.jetty.http2.parser.DataBodyParser.parse(DataBodyParser.java:103)

at org.eclipse.jetty.http2.parser.Parser.parseBody(Parser.java:186)

at org.eclipse.jetty.http2.parser.Parser.parse(Parser.java:110)

at org.eclipse.jetty.http2.HTTP2Connection$HTTP2Producer.produce(HTTP2Connection.java:156)

at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:162)

at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.execute(ExecuteProduceConsume.java:101)

at org.eclipse.jetty.http2.HTTP2Connection.onFillable(HTTP2Connection.java:96)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)


when the client make a request for a small file, this exception may not be raised I am wondering is it because Jetty has some constraints on it.


2015-10-21 21:26 GMT+08:00 Simone Bordet <sbordet@xxxxxxxxxxx>:
Hi,

On Sun, Oct 18, 2015 at 9:49 AM, Muhui Jiang <jiangmuhui@xxxxxxxxx> wrote:
> Hi,
>
> I want to know how to change the max concurrent streams from the client
> side. I find the default value is 128. I opened the session as follows:
>
> FuturePromise<Session> sessionPromise = new FuturePromise<>();
>
> client.connect(sslContextFactory, new InetSocketAddress(host, port),
>
> new ServerSessionListener.Adapter(), sessionPromise);

This is the client, you should pass just a Session.Listener.Adapter,
but see below.

> Session session = sessionPromise.get(5, TimeUnit.SECONDS);
>
> But it seems there is no method for session to set the maxlocalstream, only
> HTTP/2 session has such a method.
>
> Anyone know how to set the value.

Session.Listener has a method called onPreface() that returns a
Map<Integer, Integer>.
On the client, onPreface() is called before sending the client
preface, so you can return a Map<Integer, Integer> that specifies the
max number of concurrent streams.
Use SettingsFrame.MAX_CONCURRENT_STREAMS as the key for the value you
want to set.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top