Skip to content

Instantly share code, notes, and snippets.

@yazinnnn

yazinnnn/md Secret

Created August 23, 2023 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yazinnnn/8e8529fab8eb93ba81ad68e1767a2965 to your computer and use it in GitHub Desktop.
Save yazinnnn/8e8529fab8eb93ba81ad68e1767a2965 to your computer and use it in GitHub Desktop.
wormhole test
ab 串行测试
```shell
ab -n 1000 -c 1 localhost:25675/Evolve/ 11:04:49
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: nginx/1.23.2
Server Hostname: localhost
Server Port: 25675
Document Path: /Evolve/
Document Length: 3180 bytes
Concurrency Level: 1
Time taken for tests: 2.955 seconds
Complete requests: 1000
Failed requests: 59
(Connect: 0, Receive: 0, Length: 59, Exceptions: 0)
Non-2xx responses: 4
Total transferred: 3278838 bytes
HTML transferred: 3048010 bytes
Requests per second: 338.43 [#/sec] (mean)
Time per request: 2.955 [ms] (mean)
Time per request: 2.955 [ms] (mean, across all concurrent requests)
Transfer rate: 1083.66 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 1 3 15.5 2 406
Waiting: 0 2 15.5 1 406
Total: 1 3 15.5 2 406
Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 2
80% 2
90% 3
95% 3
98% 5
99% 22
100% 406 (longest request)
```
ab -k -c 10 并发测试失败
```shell
ab -n 1000 -c 10 localhost:25675/Evolve/ 11:07:23
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
apr_pollset_poll: The timeout specified has expired (70007)
Total of 16 requests completed
```
测试失败之后代理貌似无法正常恢复
看了一下proxy的rss使用达到了8g
```
1880836 7785M java -jar proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar --serverHost 127.0.0.1 --serverPort 8090 --configPath ./config.json
```
重启proxy, server端提示端口已经占用
```
java.net.BindException: 地址已在使用
```
全部重启之后测试了一下大文件下载,proxy出错
```shell
wget http://localhost:25675/AlasApp_0.4.3_fullcn.7z 11:11:44
--2023-08-23 11:12:00-- http://localhost:25675/AlasApp_0.4.3_fullcn.7z
正在解析主机 localhost (localhost)... ::1, 127.0.0.1
正在连接 localhost (localhost)|::1|:25675... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK
长度:489279538 (467M) [application/x-7z-compressed]
正在保存至: “AlasApp_0.4.3_fullcn.7z”
AlasApp_0.4.3_fullcn.7z 16%[=====================> ] 77.89M --.-KB/s 剩余 3m 9s
```
```java
11:12:18.266 [nioEventLoopGroup-2-1] WARN i.n.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(0) + length(4) exceeds writerIndex(0): PooledSlicedByteBuf(ridx: 0, widx: 0, cap: 0/0, unwrapped: PooledUnsafeDirectByteBuf(ridx: 3078, widx: 3081, cap: 4096))
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:308) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:422) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at java.lang.Thread.run(Thread.java:750) [na:1.8.0_345]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(0) + length(4) exceeds writerIndex(0): PooledSlicedByteBuf(ridx: 0, widx: 0, cap: 0/0, unwrapped: PooledUnsafeDirectByteBuf(ridx: 3078, widx: 3081, cap: 4096))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1477) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.buffer.AbstractByteBuf.readInt(AbstractByteBuf.java:810) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at com.github.wandererex.wormhole.serialize.FrameSerialization.deserialize(FrameSerialization.java:36) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at com.github.wandererex.wormhole.serialize.FrameSerialization.deserialize(FrameSerialization.java:10) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at com.github.wandererex.wormhole.proxy.PackageDecoder.decode(PackageDecoder.java:20) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at com.github.wandererex.wormhole.proxy.PackageDecoder.decode(PackageDecoder.java:12) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) ~[proxy-1.0.0-SNAPSHOT-jar-with-dependencies.jar:na]
... 23 common frames omitted
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment