-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
example: fast, multi-threaded, non-blocking, port and host reuse, thread-safe, epoll server #23094
Conversation
…d-safe, epoll server
Please use something like Just |
Also add the new folder name in the |
What we are missing to a 500k+ Requests/sec in wrk -H 'Connection: keep-alive' --connections 512 --threads 8 --duration 5s --timeout 1 http://localhost:3000/ Unfortunately, I don't have much time to research and investigate bottlenecks. So, having the community's help would be amazing!! |
wrk -H 'Connection: keep-alive' --connections 512 --threads 8 --duration 60s --timeout 1 http://localhost:3000/ Running 1m test @ http://localhost:3000/
8 threads and 512 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.42ms 1.12ms 13.48ms 78.10%
Req/Sec 47.73k 1.74k 51.86k 75.52%
22792466 requests in 1.00m, 2.02GB read
Requests/sec: 379530.05
Transfer/sec: 34.39MB |
NOTE: Removing all lockers and runnig with (*server).lock_flag.lock()
mut readed_request_buffer := []u8{cap: bytes_read}
(*server).lock_flag.unlock()
defer {
unsafe {
(*server).lock_flag.lock()
readed_request_buffer.free()
(*server).lock_flag.unlock()
}
}
unsafe {
readed_request_buffer.push_many(&request_buffer[0], bytes_read)
} Needs to be made :| |
I'm very busy this week. I'll try to complete this task as soon as possible. |
It makes a lot more sense to use manual memory management for something low-level like this, where you want the best possible throughput. |
I am more concerned about it not compiling on windows. Examples should either compile everywhere (ideally), or be skipped on the platforms, where they are known to fail in |
I agree with you. It will be compiled in all OSs |
I will try to make it ready to merge today :D |
Running 30s test @ http://localhost:3000
16 threads and 512 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.43ms 1.10ms 27.64ms 75.69%
Req/Sec 23.90k 1.57k 61.21k 84.72%
11419029 requests in 30.10s, 1.00GB read
Requests/sec: 379380.28
Transfer/sec: 34.01MB |
Very nice speed increase. |
445k
|
Amazing! Great job @enghitalo |
@Casper64 check this out |
Thank you, @medvednikov |
We finally cross the Running 30s test @ http://localhost:3001
16 threads and 512 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.10ms 1.12ms 26.43ms 85.85%
Req/Sec 32.67k 3.29k 60.78k 70.80%
15628885 requests in 30.10s, 1.37GB read
Requests/sec: 519212.27
Transfer/sec: 46.54MB |
@spytheman , Sorry, I tried to implement some solutions to support Windows, but the results were terrible. It increased the size of the project a lot and I felt a bit uncomfortable simulating technologies and concepts from one platform on another. When I create a library, I will possibly use the native technologies of each O.S. |
I agree. I don't think we need an epoll server on windows. Too many resources needed for 0.5% of servers that will run it. No need to use windows servers to run V. Debugging can be done via wls. |
ok, I've added it to the skip list for windows. |
Thank you |
Benchmark
with pontencial to be faster