-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Low-level HTTP APIs #525
Comments
Isn't this the entire point of ASP.NET's Project Bedrock? |
@Joe4evr Bedrock is a connection establishment abstraction, not a HTTP API. |
Yeah, but the HTTP APIs would built on top of Bedrock. |
You'd need a reader and writer API for HTTP/1 and 2 (maybe 3 as well?) for server and client. I worry about making the writing and reader of each header asynchronous. I also worry about using this for reading the body. We have lots of optimizations to avoid copying and this would likely negate that (though we could just skip the body altogether) or have different types for those readers. A callback API, though much less convenient, would likely be more efficient here. |
OMG plz do! Several bottlenecks in many projects i work are on HttpClient. |
@Rodrigo-Andrade do you have more info? We'd be interested in hearing... |
@scalablecory sory, for some reason i didn't see this sooner. We have a bunch of microservices and an API Gateway that runs on dotnet core. I am kind of the "performance guy" and every time there are issues of performance i get to profile a different system on a different team. After most obvious optimizations, most performance to win are from HttpClient. Things got really better, but making http requests from the I cobbled up a simple http1.1 client that departs from The cobbled up client is already a lot of code (even when its only http1.1, no ssl suport etc), so it would be nice to have lower level apis for this stuff, so we could benefit from all the work on http2 and 3 you guys are doing. Tell me if you need more details (ill be sure to be checking this) |
…net#525) Repro case hit a pointer to a function pointer in a signature that this check wasn't covering. Reflection-invoking things that have function pointers in them is a TODO.
We are interested in this for our OSS gateway/reverse proxy that forwards http requests that are sent to it as udp packets across a data diode. The udp receiving side uses the allocation free Socket stack, but the sending side has the allocations one gets when using HttpClient to send to remote servers. |
@freddyrios why is HttpClient not sufficient for you? Do you have hard requirement to have no allocations? Or limit on allocations? |
@karelz we were aiming for little to no allocations from the beginning, but quickly realized there are some unavoidable allocations with HttpClient. We did not consider the trade off worth it to remove the allocations by avoiding the HttpClient, so we do use it and it does work for the current throughput levels. Our context is we get data through a 1 way physical link, so no type of flow control is possible, either the data gets handled at the right steady speed or not. Of course buffers change how much slow downs can be tolerated, so its only an issue for very high throughput and for long enough pauses/slow downs. |
We've got desires for a) code sharing between HttpClient and Kestrel, and b) very precise control for partners with advanced needs (e.g. reverse proxies).
What do we think of an XmlReader-like API for low level HTTP? Minimal allocation, no connection pooling, no proxy support, etc. -- something like:
@geoffkizer @stephentoub @davidfowl @davidsh @anurse
The text was updated successfully, but these errors were encountered: