Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird performance on the load #601

Closed
gobwas opened this issue Jul 8, 2015 · 5 comments
Closed

Weird performance on the load #601

gobwas opened this issue Jul 8, 2015 · 5 comments

Comments

@gobwas
Copy link

gobwas commented Jul 8, 2015

Hello!

Im currently researching technologies for some web app, and have wrote a simple http server as you show in your example:

extern crate hyper;

use std::io::Write;

use hyper::Server;
use hyper::server::Request;
use hyper::server::Response;
use hyper::net::Fresh;

fn hello(_: Request, res: Response<Fresh>) {
    let mut res = res.start().unwrap();
    res.write_all(b"Hello World!").unwrap();
    res.end().unwrap();
}

fn main() {
    Server::http("127.0.0.1:4000").unwrap().handle(hello);
}

Then I used JMeter for emulate some load, and thats what I've found, for example, in comparsion with Node.js:

Samples Average Median 90% 95% 99% Min Max Throughput /sec
hyper.rs 2500 595 0 4 5619 10859 0 12387
node.js 2500 2 2 6 7 9 0 30

50'th and 90'th percentiles are very fast, and faster than node, but, then, 95 and higher - is much lower.
It means, that 95% of requests are faster than node, but 5% much slower.

Then I've looked at detailed results of requests, and that is what I have found (more attention on the Duration column - it repeat high latency in period of ~50 requests):

Sample Thread Duration(ms) Bytes Latency
1 Pure hello 1-2 4 106 4
2 Pure hello 1-1 11 106 11
3 Pure hello 1-3 2 106 2
4 Pure hello 1-4 4 106 4
5 Pure hello 1-5 6 106 6
6 Pure hello 1-1 0 106 0
7 Pure hello 1-2 1 106 1
8 Pure hello 1-3 1 106 1
9 Pure hello 1-4 1 106 1
10 Pure hello 1-5 1 106 1
11 Pure hello 1-1 0 106 0
12 Pure hello 1-2 0 106 0
13 Pure hello 1-3 1 106 1
14 Pure hello 1-4 1 106 1
15 Pure hello 1-5 1 106 1
16 Pure hello 1-2 0 106 0
17 Pure hello 1-1 0 106 0
18 Pure hello 1-3 0 106 0
19 Pure hello 1-4 0 106 0
20 Pure hello 1-5 0 106 0
21 Pure hello 1-2 0 106 0
22 Pure hello 1-1 1 106 1
23 Pure hello 1-3 1 106 1
24 Pure hello 1-4 1 106 1
25 Pure hello 1-5 1 106 1
26 Pure hello 1-2 1 106 1
27 Pure hello 1-1 1 106 1
28 Pure hello 1-3 0 106 0
29 Pure hello 1-4 0 106 0
30 Pure hello 1-5 0 106 0
31 Pure hello 1-2 0 106 0
32 Pure hello 1-1 0 106 0
33 Pure hello 1-4 0 106 0
34 Pure hello 1-3 0 106 0
35 Pure hello 1-5 0 106 0
36 Pure hello 1-2 0 106 0
37 Pure hello 1-1 0 106 0
38 Pure hello 1-4 0 106 0
39 Pure hello 1-3 0 106 0
40 Pure hello 1-5 0 106 0
41 Pure hello 1-2 1 106 1
42 Pure hello 1-1 0 106 0
43 Pure hello 1-4 0 106 0
44 Pure hello 1-3 0 106 0
45 Pure hello 1-5 0 106 0
46 Pure hello 1-2 0 106 0
47 Pure hello 1-1 0 106 0
48 Pure hello 1-4 0 106 0
49 Pure hello 1-3 0 106 0
50 Pure hello 1-5 0 106 0
51 Pure hello 1-6 448 106 448
52 Pure hello 1-7 480 106 480
53 Pure hello 1-8 478 106 478
54 Pure hello 1-9 476 106 476
55 Pure hello 1-10 473 106 473
56 Pure hello 1-6 0 106 0
57 Pure hello 1-8 0 106 0
58 Pure hello 1-7 1 106 1
59 Pure hello 1-10 0 106 0
60 Pure hello 1-9 0 106 0
61 Pure hello 1-6 0 106 0
62 Pure hello 1-7 1 106 1
63 Pure hello 1-8 1 106 1
64 Pure hello 1-9 0 106 0
65 Pure hello 1-10 0 106 0
66 Pure hello 1-6 1 106 1
67 Pure hello 1-7 0 106 0
68 Pure hello 1-8 0 106 0
69 Pure hello 1-9 1 106 1
70 Pure hello 1-10 1 106 1
71 Pure hello 1-6 0 106 0
72 Pure hello 1-7 0 106 0
73 Pure hello 1-8 1 106 1
74 Pure hello 1-9 1 106 1
75 Pure hello 1-10 0 106 0
76 Pure hello 1-6 1 106 1
77 Pure hello 1-8 0 106 0
78 Pure hello 1-7 0 106 0
79 Pure hello 1-10 0 106 0
80 Pure hello 1-9 0 106 0
81 Pure hello 1-6 1 106 1
82 Pure hello 1-8 1 106 1
83 Pure hello 1-7 1 106 1
84 Pure hello 1-10 1 106 1
85 Pure hello 1-9 1 106 1
86 Pure hello 1-8 1 106 1
87 Pure hello 1-6 2 106 2
88 Pure hello 1-7 2 106 2
89 Pure hello 1-9 7 106 7
90 Pure hello 1-10 8 106 8
91 Pure hello 1-8 0 106 0
92 Pure hello 1-6 0 106 0
93 Pure hello 1-7 0 106 0
94 Pure hello 1-9 0 106 0
95 Pure hello 1-10 0 106 0
96 Pure hello 1-8 0 106 0
97 Pure hello 1-6 0 106 0
98 Pure hello 1-7 0 106 0
99 Pure hello 1-10 0 106 0
100 Pure hello 1-9 0 106 0
101 Pure hello 1-13 895 106 895
102 Pure hello 1-12 898 106 898
103 Pure hello 1-11 903 106 903
104 Pure hello 1-14 893 106 893
105 Pure hello 1-15 888 106 888
106 Pure hello 1-196 116 1791 0
107 Pure hello 1-12 0 106 0
108 Pure hello 1-13 0 106 0
109 Pure hello 1-11 0 106 0
110 Pure hello 1-14 0 106 0
111 Pure hello 1-15 1 106 1
112 Pure hello 1-12 0 106 0
113 Pure hello 1-11 1 106 1
114 Pure hello 1-13 0 106 0
115 Pure hello 1-15 0 106 0
116 Pure hello 1-14 0 106 0
117 Pure hello 1-11 1 106 1
118 Pure hello 1-12 1 106 1
119 Pure hello 1-13 1 106 1
120 Pure hello 1-14 0 106 0
121 Pure hello 1-15 0 106 0
122 Pure hello 1-12 1 106 1
123 Pure hello 1-13 0 106 0
124 Pure hello 1-11 1 106 1
125 Pure hello 1-15 1 106 1
126 Pure hello 1-14 1 106 1
127 Pure hello 1-13 1 106 1
128 Pure hello 1-12 1 106 1
129 Pure hello 1-11 0 106 0
130 Pure hello 1-15 1 106 1
131 Pure hello 1-14 1 106 1
132 Pure hello 1-12 0 106 0
133 Pure hello 1-13 0 106 0
134 Pure hello 1-11 0 106 0
135 Pure hello 1-14 0 106 0
136 Pure hello 1-15 0 106 0
137 Pure hello 1-13 0 106 0
138 Pure hello 1-12 0 106 0
139 Pure hello 1-11 0 106 0
140 Pure hello 1-15 1 106 1
141 Pure hello 1-14 1 106 1
142 Pure hello 1-13 1 106 1
143 Pure hello 1-12 0 106 0
144 Pure hello 1-11 0 106 0
145 Pure hello 1-15 0 106 0
146 Pure hello 1-14 0 106 0
147 Pure hello 1-13 1 106 1
148 Pure hello 1-11 1 106 1
149 Pure hello 1-12 1 106 1
150 Pure hello 1-15 1 106 1
151 Pure hello 1-14 1 106 1
152 Pure hello 1-16 1117 106 1117
153 Pure hello 1-18 1110 106 1110
154 Pure hello 1-17 1114 106 1114
155 Pure hello 1-20 1132 106 1132
156 Pure hello 1-19 1139 106 1139
157 Pure hello 1-18 0 106 0
158 Pure hello 1-16 0 106 0
159 Pure hello 1-17 0 106 0
160 Pure hello 1-20 0 106 0
161 Pure hello 1-19 0 106 0
162 Pure hello 1-18 0 106 0
163 Pure hello 1-16 1 106 1
164 Pure hello 1-17 1 106 1
165 Pure hello 1-19 1 106 1
166 Pure hello 1-20 1 106 1
167 Pure hello 1-16 1 106 1
168 Pure hello 1-17 1 106 1

... and so on.

Is it a bug or feature? 😄

Thanks )

@gobwas
Copy link
Author

gobwas commented Jul 8, 2015

Also, FYI, the "Thread group" of JMeter is configured as:

@seanmonstar
Copy link
Member

I assume it's related to 1) no timeouts #368, and 2) the use of synchronous IO, which pretty much just makes No. 1 hurt more.

@gobwas
Copy link
Author

gobwas commented Jul 8, 2015

How and when could it be solved? I see that #368 is closed..

@seanmonstar
Copy link
Member

No, it's still open. Just several issues referencing it are closed.

For timeouts, see #315. For async IO, see #395.

@gobwas
Copy link
Author

gobwas commented Jul 8, 2015

Oops, sorry 👍
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants