Giter Club home page Giter Club logo

http2comm's People

Contributors

testillano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

http2comm's Issues

Maximum Request Body Size must not be static within Stream class

Is your feature request related to a problem? Please describe.
The current design manages the maximum request body for every stream, regardless the server instantiated by the application.
This is because the value is an static member of stream class.

Describe the solution you'd like
Maximum request body size should be non-static and controlled under http2 server class.

Additional context
Memory reservation size will be affected by traffic managed for foreign servers, as currently it is stored in an static atomic variable.

Fix coredump on delayed responses for broken connection

Describe the bug
Delayed responses over broken connection crashes on response post.

To Reproduce
Provision a delay of 2 seconds and send a request with a smaller timeout (1 second).
When the connection is broke, the delayed event crashes.

Performance optimizations

Is your feature request related to a problem? Please describe.
Sometimes, library user don't need to process the request body received.
In such case, transforming a stringstream to std::string (via str()) is overkilling.
We will modify the interface to pass shared pointer to initial stringstream, and this could be
trnasformed on-demand later.

Also, we will calculate stringstream size withouth wasting time building str(). We will use tellg and seekg.

Add dynamic counters for status codes

Is your feature request related to a problem? Please describe.
We would improve metrics capabilities adding dynamic counters for every different registered status code.
This must be done for both server and client endpoints.

Dynamic threads grow until maximum provided

Is your feature request related to a problem? Please describe.
Just an improvement to allow to provide a maximum value for number of threads, so the threads initially created could grow to a top value configured.

Describe the solution you'd like
Add a max value for worker threads which defaults to initial worker threads.
Http2Server interface adds a new size_t parameter, so it is non backward compatible.

Describe alternatives you've considered
Threads are not decreased when no longer needed, so be careful when configuring the max value.

New virtual method to ignore request bodies

Is your feature request related to a problem? Please describe.
Add new virtual method to ignore request bodies

A new virtual method could be reimplemented to
ignore the request body storage under some
conditions, in order to speed up the performance
with high load.

This is useful when huge requests are received and not need to use their bodies.

Describe the solution you'd like
ignoreRequestBody, returns bool to ignore (false on base class default implementation).
Provide req structure to analyze.

Provide reception timestamp in microseconds to server receive() virtual method

Is your feature request related to a problem? Please describe.
This reception timestamp should be shared with the application user in order to better sinchronize this value with application events regarding latencies measured in this library metrics.

Describe the solution you'd like
Modify receive() at Http2Server class.

Include general server sequence

Is your feature request related to a problem? Please describe.
A monotonically increased sequence should be managed at this library, to simplify upper layers.

Describe the solution you'd like
Use an atomic uint64 and increment within on_data lambda

Improve timeout implementation for client connections

Is your feature request related to a problem? Please describe.
Timeout is poorly managed.

Describe the solution you'd like
We need to have an agreement to signal timeout event.
We need also to discard further receptions on timeout

Describe alternatives you've considered
Add a timed_out boolean flag to response task.

Improve metrics design for grafana

Family names never must e dynamic, so, class name is not an endpoint or something that could change (at least for clients).
Also, application/process name must not be provided in class name to be part of family name.
So, class name (fo1r Http2Server and Http2Client classes) shall be static. And the source label, which is dynamic, and could carry application/process name and client endpoints name, will be provided on enableMetricss() method.

Make configurable the server activity keepalive

Is your feature request related to a problem? Please describe.
The read timeout can be configurable in nghttp2 API.

Describe the solution you'd like
We will add this new parameter in the interface. Keep default value of 60 seconds as nghttp2 does.

Refactor metrics families' names

Reorganize metrics to better fit grafana expectatives. Redundant family name with "source" label to ease identification. Provide class name (which will be application name plus context information: module or http2 endpoint), to better configure externally.

Add busy threads count to queue dispatcher

Is your feature request related to a problem? Please describe.
Just to improve queue dispatcher monitoring, it would be interesting to know the
number of worker threads doing processing of data received.

Reserve initial memory for request body storage

Is your feature request related to a problem? Please describe.
Implement configurable pre reserve memory allocation for request body string container. This avoids possible reallocations done by std::string append() when the string object is constructed from scratch without initial memory reservation.

Describe the solution you'd like
The amount used for that reservation is the maximum size registered for incoming request bodies, something stored in static atomic member for Stream class.
The behavior will be configurable through virtual method preReserveRequestBody().

Simplify method enum class to use string

Is your feature request related to a problem? Please describe.
Method in 3rd party library is std::string but we use enum class.
So, we need conversions (takes time) and introduce complexity without need.

Describe the solution you'd like
Use std::string instead.

ReceptionId must not be static within Stream class

Is your feature request related to a problem? Please describe.
The current design increases monotonically the reception id for every stream, regardless the server instantiated by the application.
This is because the value is an static member of stream class.

Describe the solution you'd like
Reception id sequence should be non-static and controlled under http2 server class.

Additional context
Current approach is causing h2agent CT fail for this test:
FAILED server-data_operation/delete_data_test.py::test_001_i_want_to_delete_partial_internal_data_after_storing_some_traffic_events
This is because administrative flows are also increasing globally the sequence, but we want that sequence specific of each server.
Administrative server is not using that secuence, but also will be increased for every administrative request and only for them. Traffic requests only should increase traffic server sequence and admin traffic only should increase admin server sequence.

Improve reception performance

Is your feature request related to a problem? Please describe.
stringstream has worse performance than string, also we should provide to upper layer, a better usable interface. Const std::string reference is much better than a shared pointer to stringstream buffer.

Fix memory leak with delay timers

Describe the bug
There is a tiny memory leak if delay responses are used for http2 server.

To Reproduce
long term traffic with a provision including delays in responses.

Implement basic congestion control

Implement a basic algorithm based in:

  • number of busy threads
  • size of FIFO queue dispatcher (when used)

Provide a maximum queue size to be allowed. Disabled by default (-1) this algorithm will activate the congestion situation when no idle consumers are available (busy threads are equal to consumers launched) and queue size is over the maximum provided.

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.