Closed cyrusmsk closed 5 days ago
@waghanza it seems some error in running script..
@cyrusmsk
object.Exception@/root/.dub/packages/serverino/0.7.2/serverino/source/serverino/config.d(231): Configuration error. Must be minWorkers <= maxWorkers
Oh it seems it was this error. Now probably it should work
Unfortunately no @cyrusmsk . Could you enqble logging / debug mode ?
@trikko server hang I mean I built the container, and run ito in. on an other terminal with curl http://172.17.0.2:3000 -v
, I have
* Trying 172.17.0.2:3000...
* Connected to 172.17.0.2 (172.17.0.2) port 3000 (#0)
> GET / HTTP/1.1
> Host: 172.17.0.2:3000
> User-Agent: curl/8.0.1
> Accept: */*
>
* Recv failure: Connexion ré-initialisée par le correspondant
* Closing connection 0
curl: (56) Recv failure: Connexion ré-initialisée par le correspondant
In my local test I received this: curl http://localhost:3000 -v
GET / HTTP/1.1 Host: localhost:3000 User-Agent: curl/7.87.0 Accept: /
Is 172.17.0.2
the right ip of docker?
@waghanza if you start docker with -p 3000:3000 and then you execute curl -v localhost:3000
, what happens?
What is serverino log saying? That could help a lot!
where are logs produced by serverino ?
On stderr, of course. Redirect with ./your_serverino_exe 2>log.txt
when using curl http://172.17.0.2:3000 -v
I have
* Trying 172.17.0.2:3000...
* Connected to 172.17.0.2 (172.17.0.2) port 3000 (#0)
> GET / HTTP/1.1
> Host: 172.17.0.2:3000
> User-Agent: curl/8.0.1
> Accept: */*
>
on server side, I have
nobody@493a850a94bd:/opt/web$ ./server
* [000008] [i] 2024-04-22 21:37 [daemon.d:0259] Daemon started.
* [000008] [i] 2024-04-22 21:37 [daemon.d:0283] Listening on http://0.0.0.0:3000/
[000010] [l] 2024-04-22 21:38 [worker.d:0123] Worker started. (user=nobody group=nogroup)
I tried with -p
@trikko
Is that the complete log? It seems there's only one worker running.
If you use -p, try localhost:3000 (or the ip of the machine where it is running)
It is what I do. Using docker inspect for that
-p 3000:3000 map the docker port 3000 on the server port 3000. So if you're running docker on your pc you can try curl localhost:3000 rather than curl 172.x.x.x:3000.
Same @trikko
Workers starts after a long time on server side.
Maybe we can activate some verbose level
Workers starts after a long time on server side.
What?! Is it the log lagging or the timestamps confirm that they start slowly? They should start in a fraction of second!
This is serverino running on a raspberry pi (not a really powerful machine). Check the startup times!
@waghanza where are you running the whole thing? On your computer? On a server? (aws? digitalocean? which kind of instance)
On a local machine (fedora Linux) with docker, will investigate on that
I see @trikko . I have compiled on the docker container, copied it to my local machine and execute the binary, and the results are
[waghanza@localhost:~] $ wrk -H 'Connection: keep-alive' --connections 64 --threads 8 --duration 15 --timeout 1 --script /home/waghanza/workspace/benchmark/web/pipeline_post.lua http://127.0.0.1:3000/user
Running 15s test @ http://127.0.0.1:3000/user
8 threads and 64 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.70ms 31.07ms 904.99ms 98.20%
Req/Sec 8.61k 4.18k 18.13k 75.88%
461928 requests in 15.10s, 44.49MB read
Socket errors: connect 0, read 10, write 0, timeout 12
Requests/sec: 30591.29
Transfer/sec: 2.95MB
but I have a lot of errors
[waghanza@localhost:~/workspace … eb/d/serverino] serverino_test+* 12m48s ± /tmp/server
* [018379] [i] 2024-04-23 21:36 [daemon.d:0259] Daemon started.
* [018379] [i] 2024-04-23 21:36 [daemon.d:0283] Listening on http://0.0.0.0:3000/
[018381] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018384] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018387] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018390] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018393] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018396] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018399] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
[018402] [l] 2024-04-23 21:36 [worker.d:0123] Worker started. (user=waghanza group=waghanza)
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
* [018379] [l] 2024-04-23 21:36 [communicator.d:0375] Socket error on read. Connection reset by peer
Slow computer! rpi get 15k req/s :)
How many times did you run the test?
Typically those are not errors, but warnings. In fact wrk does not bother to close the connection at the end of the timeout but turns off the program suddenly and serverino detects an interrupted communication. So normally at the end of each test with wrk you will find a message like this for each worker.
If you try other programs (for example: bombardier) that smoothly and correctly close the connection when they are finished, you will not see any errors.
8 core (AMD FX-8320E Eight-Core Processor) qnd 16G of RAM
and quit the same with bombardier
Bombarding http://127.0.0.1:3000 for 10s using 125 connection(s)
[========================================================================================================================================================================================================================================] 10s
Done!
Statistics Avg Stdev Max
Reqs/sec 30196.52 1558.81 33198.69
Latency 4.13ms 83.49ms 4.00s
HTTP codes:
1xx - 0, 2xx - 301968, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput: 4.70MB/s
Nice, no errors with bombardier, right? It seems too slow, anyway.
I tested the version 0.7.2 on rpi4, right now:
Running 10s test @ http://localhost:8080
8 threads and 64 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 9.82ms 75.85ms 1.64s 97.93%
Req/Sec 5.05k 4.66k 20.77k 58.20%
224159 requests in 10.10s, 21.59MB read
Socket errors: connect 0, read 5, write 0, timeout 28
Requests/sec: 22197.15
Transfer/sec: 2.14MB
On my laptop (i7-12700H) I get 140-150k with both bombardier and wrk (without scripts).
I'm not joking!
weird on the same workstation, some nim frameworks are aroun 200K rps ;-)
but anyway, still not understand the docker layer troubles, because the problem here is not about performances, is about running or not, and why CI is OK ;-)
There's a good chance all this things are related in some way, isn't it?
weird on the same workstation, some nim frameworks are aroun 200K rps ;-)
some frameworks are cheating :)
Yes, I'm sure this is located to my machine, on github action the container is up and running, https://github.com/the-benchmarker/web-frameworks/actions/runs/8790164134/job/24121594878?pr=7409#step:7:2091
I plan to run all thos benchmark on a brand new workstation, this server is old
weird on the same workstation, some nim frameworks are aroun 200K rps ;-)
Yeah I know, but at least some of them I've tried are not real server. They are made just for win benchmarks, they don't even parse headers or request correctly. Not the point anyway.
don't even parse headers or request correctly.
Btw maybe worth to add such tests and requests into benchmark. To make it more "real testing", rather than absolutely synthetic and our of the real business cases.
Not the point anyway.
Agree.
But I don't understand why Docker could be the problem..
A simple test you can try is uploading a file with curl, it's not handled correctly by many server including httpbeast, the fastest one.
Uploading a big file (150MB!) on serverino:
andrea ~ > time curl -X POST -H "content-type: octet/stream" --data-binary @sdserverino.mp4 http://localhost:8080 -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> content-type: octet/stream
> Content-Length: 157915974
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< connection: keep-alive
< content-length: 0
< content-type: text/html;charset=utf-8
<
* Connection #0 to host localhost left intact
real 0m0,178s
user 0m0,020s
sys 0m0,090s
Same request, on httpbeast:
andrea ~ > time curl -X POST -H "content-type: octet/stream" --data-binary @sdserverino.mp4 http://localhost:8080 -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> content-type: octet/stream
> Content-Length: 157915974
> Expect: 100-continue
>
* Done waiting for 100-continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 10
< Server: HttpBeast
< Date: Tue, 23 Apr 2024 20:39:43 GMT
<
* Connection #0 to host localhost left intact
HELLO POST
real 0m11,152s
user 0m0,054s
sys 0m0,116s```
don't even parse headers or request correctly.
Btw maybe worth to add such tests and requests into benchmark. To make it more "real testing", rather than absolutely synthetic and our of the real business cases.
Not the point anyway.
Agree.
But I don't understand why Docker could be the problem..
Please notice that we use regulary serverino with docker in production without any performance issue!
So there is 3 concerns here :
I have a lot of tests if you need them :)
Be my guest @trikko. Maybe you could start a discussion on that.
Having more tests could reduce heterogeneity of implementations here
Workers starts after a long time on server side.
Maybe we can activate some verbose level
Could you please make a test? If they are slow to start on docker, try launch docker with an extra param --ulimit nofile=4096
Do you see any speedup?
Workers starts instantely but still not reacheable
PS : Not understood, since the default of open files is 1073741816
Workers starts instantely but still not reacheable
PS : Not understood, since the default of open files is 1073741816
It's a bad default value. It's way too high, It degrades CPU performances. Now I set it to 4096 on Serverino startup if it's too high, if not set by user.
About reachability: from last release I set a custom name for processes, does it mess your config scripts?
I can run it now, but server seems to crash at some point
PS : With number of open file to 4096
I can run it now, but server seems to crash at some point
PS : With number of open file to 4096
Pump up that number, it counts every fd
I have use 10240 for next run
In the meanwhile I've added a workaround to serverino (that set 16384 as value) and send a pull request (already accepted) to dlang to fix the problem that is in the standard library.
Can you try to run this code for full test please?