olegcherr / OkHttp-TimeWait-Test

0 stars 0 forks source link

Main discussion #1

Open olegcherr opened 7 years ago

olegcherr commented 7 years ago

Hi @swankjesse! Here is an isolated test case you asked for on SO.

swankjesse commented 7 years ago

I don’t know how to Netty but that is not a proper webserver. In particular you want something like this:

    byte[] data = "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nhello".getBytes();

Otherwise you’re unable to reuse socket connections.

olegcherr commented 7 years ago

@swankjesse Okay, thanks. I've added the keep-alive support eba7cd8568db1ca8addb84d51c60a814681866f4 Everything works without any exception now, but an another problem appeared: the performance of benchmarking is getting lower significantly during the testing:

17712 req/sec
21319 req/sec
22163 req/sec
17914 req/sec
13894 req/sec
12003 req/sec
10269 req/sec
9012 req/sec
8009 req/sec
7198 req/sec
...
...
...
651 req/sec
646 req/sec
638 req/sec
634 req/sec
628 req/sec

Memory usage seems Okay. It stays put around 300Mb, so no memory leaks I guess.

Could you please help me figure out what's wrong?

swankjesse commented 7 years ago

Unsure. You're probably best off using a benchmark framework like JMH to investigate further.

mysileng commented 7 years ago

i got the same problem.