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

Rate limiting #27

Open
ghost opened this issue Jan 10, 2019 · 0 comments
Open

Rate limiting #27

ghost opened this issue Jan 10, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2019

  • TCP has two separate lines: read & write, they can be separately frozen.
  • TLS does not, you cannot properly freeze read without potentially freezing write.
  • We want the common denominator.

us_socket_pause, us_socket_resume, us_ssl_socket_pause, us_ssl_socket_resume for freezing and resuming both lines.

Protocols like HTTP where clients can POST large streams of data are properly solved with this,

HTTP POST sends data until done, and THEN the server writes the response. Throttling upload to server is easily done with us_socket_pause, since the server won't send anything until the upload is done anyways. So it works, most web protocols are not dependent on the ability to freeze only the read or write part of the connection, that's probably why SSL works for these protocols.

Should be simple thing to remove from epoll on pause and add again on resume.

TCP-only extensions for freezing only one part can be added later if needed, as tcp-only functions.

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

No branches or pull requests

0 participants