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

Poor Preformance #34

Open
meydanb opened this issue Jul 5, 2021 · 5 comments
Open

Poor Preformance #34

meydanb opened this issue Jul 5, 2021 · 5 comments

Comments

@meydanb
Copy link

meydanb commented Jul 5, 2021

Hello, i am trying to implement a custom web application based on this project.
first of all i want to say that this is a really cool project that is almost perfect for my needs.
however i am facing one major issue, it looks like there is a very high processing time for the http requests.
i am using a rather simple setup with 5 routes set up,.
when i am starting up my app, and the index.html file starts to load (which requires 30 something js and css files) it takes more than 10 seconds to load.
single file requests can take up to 5 and even 10 seconds.

even putting a breakpoint on one of the handlers i can tell that it takes almost a second until the HandleAsync request is called

any idea what is happening here?

@kenkendk
Copy link
Owner

kenkendk commented Jul 5, 2021

I have noticed a similar issue where some requests would take a long time to load.
It looks like the flushing of the streams is not done with async, and that ties up threads, causing a delay for new requests.

I have not had the time to dig in deeper, but I think the flushing code simply needs to be fixed.

@kenkendk
Copy link
Owner

For my usage, I can see dramatic speed improvements with the latest commit.

@meydanb
Copy link
Author

meydanb commented Jul 31, 2022

This is absolutely fantastic news!
Can we expect a new release in Nuget anytime soon?
Tnx

@kenkendk
Copy link
Owner

Yes, I published a new NuGet package just now (v0.9.10)

@smaudet
Copy link

smaudet commented Feb 27, 2024

Still seeing this issue - after start I the following from the debug listener (why are your loggers so complicated?):

Waiting for throttle
Waiting for socket
Waiting for throttle
Waiting for socket
// pauses here for a good 10-20 seconds and does nothing...
Re-waiting for socket
Re-waiting for socket
Threadpool says 32762, 1000
Spawning runner with id: 7923871983b84edda11fb6d1d1adccba
Waiting for throttle
Waiting for socket
Re-waiting for socket
Threadpool says 32761, 1000
Spawning runner with id: 3f3d5a6a73fb4fa4b35c75bb962a5db6
Waiting for throttle
Waiting for socket
// here the client has already given up and closed the connection.
Running SSL
Running SSL
Authenticate SSL
Authenticate SSL
Failed setting up SSL

127.0.0.1 - - [27/Feb/2024:18:22:15 +0000] " " 500 -1 "-" "-"
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the r
emote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
Failed setting up SSL

Because the client has closed the connection the stream is dead.

This is really bad - the server should not hang like this - I suspect this is due to invalid usage of async/await - you should be running on your own thread, at minimum, for embedding.

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

3 participants