Code Monkey home page Code Monkey logo

Comments (6)

craff avatar craff commented on May 23, 2024

The command wrk -t 5 -c100 -d15 url on a small file gives a lot of 500 codes probably because of this.

from tiny_httpd.

c-cube avatar c-cube commented on May 23, 2024

I think it's good to close the connection if an option is set (--no-connection-reuse or whatever). Otherwise, a client might send another query. We might be able to set a timeout on how long it takes to send the new query, I'm not sure.

We have problems with slow lorris and other things, I'm afraid. In general it's going to be hard to be iron solid. A reverse proxy should be the way to do that cleanly if you're exposed to the public internet, and it can also handle TLS.

from tiny_httpd.

craff avatar craff commented on May 23, 2024

I don't understand ? What is slow lorris ? It does not seem costly to close the stream ? I don't speak about the connection socket, but the stream of the file being send over the socket. I just submitted PR #55, which is rather trivial.

from tiny_httpd.

craff avatar craff commented on May 23, 2024

Without this PR #55, a long running connection downloading many files will fail with EMFILE (no more file descriptor).
It is quite strange that this bug was not detected actually.

from tiny_httpd.

c-cube avatar c-cube commented on May 23, 2024

https://en.wikipedia.org/wiki/Slowloris_(computer_security)

but here you're talking about the stream in a response, which is not closed after being written back to the client, is that it? I guess it can be a leak indeed. I'm not sure why it did not pop up before; maybe we only did load testing with a server that didn't use streams with underlying FDs.

from tiny_httpd.

c-cube avatar c-cube commented on May 23, 2024

I think this is fixed by #55

from tiny_httpd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.