-
Notifications
You must be signed in to change notification settings - Fork 1.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
HTTP/2 support #144
Comments
Hi, @uppfinnarn!
https://github.com/valyala/fasthttp/blob/master/TODO
Because fasthttp implements http stack from scratch, http2 support should implement RFC 7540 from scratch. So, IMHO you can start just implementing RFC 7540 with the motto "Tuned for high performance. Zero memory allocations in hot paths." in mind and trying to reuse existing low-level pieces (e.g. bytesconv_*.go) It will take a lot of time, effort and research. |
Are there any estimates as to when this would be available? |
This is a very important feature, HTTP/2 support would make the package faster in real word applications:
Right now fasthttp might be winning unrealistic benchmarks but the official Go package supports HTTP/2 which is a big plus in real world applications. I'd also be interested in helping fasthttp implementing HTTP/2. |
@valyala when will HTTP/2 support come to fasthttp? It will make it the preferred http package for Go. Thank You! |
@DevotionGeo Since HTTP/2 is in TODO, but it gives me a feeling that there's no person to do it. |
HTTP/2 is worth implementing. |
Are there any progress on HTTP/2? |
@gnanakeethan Hello. In this repository github.com/erikdubbelboer/fasthttp we are working to improve fasthttp library. Now we are working to implement http2. |
@TheMester Do you continue developing HTTP/2 for fasthttp? |
Or is there someone developing it? |
@savsgio I stopped because of exams. I want to follow after the next week. |
I created a repo here to develop http2 for fasthttp @kirillDanshin |
@dgrr awesome! thanks for your work. is there any roadmap and current status? when you finish your work, we can embed it in the fasthttp and finally support http/2 officially. also, feel free to ping me if you have any questions |
@kirillDanshin we talk about embedding it in fasthttp and finally I decided to do not do this. Fasthttp has a good support for HTTP/1.x. |
@dgrr I think we should at least try and benchmark embedded version and see if we can get any better solution for this |
Okay. Let me finish fasthttp2 and we will try to embed it in original repo. |
@dgrr huge shout-out to you for that work 👍 |
There are anyone interested in participate in this project? |
I'm afraid I currently don't do anything with http2. I see you have continued working on your implementation. How is that going? |
I am blocked working on it. I tried to implement it in my repo but the main problem is the RequestCtx header fields handling. HTTP/2 follows a frame by frame schema (like Websocket). There are many types of frames. The two main types are Headers and Data which in HTTP/1.x language are the same as the headers and a body in a HTTP Request/Response. If you agree I can commit changes in my fasthttp fork and start making pull request in other branch (not master. http2?). |
I think if you implement http2 in the fasthttp repo instead of a separate one it makes the most sense to have it be one big pull request/commit. So working on a separate http2 branch in this repo and making pull requests to that branch sounds like a good idea. When everything works then we can rebase on master and squash into one big commit. |
@dgrr I would like to participate in! How can I help? How is it going? Do you have any plan about the project? |
Hello @skiloop Right now it's stopped because I am a little busy with my work and that stuff. But you can take a look here https://github.com/dgrr/http2 To summarize:
|
Lately I've been working on a small "pet project" regarding a high performance static server, and I thought that for some use-cases HTTP/2 would be a perfect match (i.e. lots of small requests). However given the complexity of HTTP/2, I would incline more towards keeping it out of the "main" I wonder if it wouldn't be simpler for one to implement a fast HTTP/2 to HTTP/1 gateway, that would also benefit other projects. |
Today I wondered "what if":
Granted, it will be sub-optimal, but it would still allow one to have HTTP/2 and use I've tried implementing this idea: And apparently it works flawlessly, by using Any thoughts about this proposed "hack"? Perhaps we could implement some of this code as part of |
@cipriancraciun I will develop more this comment but just want to let you know that I already successfully develop something like a gateway for HTTP/2 to fasthttp. The only concern I have on doing that is the performance. You can check that here |
Hello. I know it's been long but just wanted to tell you all that I have a working on HTTP/2 a little. Example here. Why after 2 years I recovered that old work? Because the HTTP/2 library of the Golang's std sucks quite a lot. fasthttp (using HTTP/1.1) is faster than the Golang's HTTP/2. I tested that in a server made in with the net/http. That's ridiculous. I want to create a full implementation (so client and server). If someone wants to help, I'll be appreciated! |
Do we have a date planned to use http2 on fasthttp? |
For now I am a bit busy. I'll continue working in a few weeks. The client is my priority number one. I'll do the server later. |
alright, can you need help? anything you can call me |
@renanbastos93 you can pick the issue you want and start a discussion/solving the issue |
Do you have any plan to release stable HTTP/2 adapter ? |
Is there any ETA on this? Seems there's no progress on this for a while... |
@dgrr Do you have any plan to release stable HTTP/2 adapter ? |
Just give up and add quic / http3.. http2 wasn't that great anyway |
This issue has been open for over 6 years now, is there a concrete plan on how to address this? |
I'm afraid not. Most features of http2 aren't relevant for the use cases fasthttp is meant for. |
Having experimented in my kawipiko static server based on In my experiments the major issue with Go-based HTTP servers and performance is mainly memory allocation overhead (or as it's called in Go "heap escape"); with |
http2 is supported by hertz but a lot of things are not compatible. tried porting fasthttp to hertz for 1 week and still working on areas. they have ideas on http2 which is great but means changing a few sections of fasthttp. |
@erikdubbelboer, when you get a second, can you quickly clarify just three things for any downstream project that might be waiting on HTTP2 support from
Motivation: HTTP/2 support is brought up about once every 2 months for downstream webserver project, e.g. gofiber/fiber, and in a few other projects. The spike in HTTP/2 interest is mainly due to the increased popularity and adoption of gRPC, and now HTTP/3 & QUIC being enabled by default in all major browsers as of March 2023 (Safari was the last holdout). The standing position within these projects is to wait for If the answer to all 3 questions above is " Cheers, |
Hello @bryanvaz. Thanks for your comment. Supporting HTTP/2 is possible, but it requires a LOT of work to develop an HTTP/2 framework. Work can be done to fork net/http2 and adapt it to fasthttp. But then more work will need to be added to the pile to support GRPC, aka forking the compiler to replace the code that generates net/http code with fasthttp code. And what is the actual incentive? A few microseconds that you could save per request? Because memory-wise is going to be mostly the same, you need a goroutine per connection and maybe another gorouting to handle the HTTP/2 streams. If you are using Golang, generally you don't care about microseconds (generally). And... on top of that, who is going to use http/2 without GRPC support? Is it worth the try? Maybe the explanation is too big, but I think it helps. |
There is currently no plans to include HTTP/2 support into fasthttp. I myself would only like to add support if I was going to use http2 myself, otherwise it's too hard and time consuming to work on. Pull requests on either repo are always welcome of course. |
Agree with both of you, Erik and Darío. Basically no HTTP/2 support is actively being built for If any downstream project needs HTTP/2, it should not expect one from |
agree. I used to use fasthttp for rtb, and I realized we only need a http2 client rather than a http2 framework. So I ripped a http2 implementation from grpc-go but haven't to verify it yet. |
fasthttp is used by plenty of frameworks that aren't limited to computer-to-computer communication. Roughly 35-40% of the web properties use HTTP/2. You're using HTTP/2 fairly regularly without gRPC support. That's not necessarily a reason for a fasthttp HTTP/2 implementation to be developed, but it definitely doesn't have to come with support for gRPC to be useful. JSON-over-HTTP works just as well for HTTP/2 and you'd still benefit from the improvements to the wire format like multiplexing and the HPACK header compression. |
Websocket can handle that too. |
@daenney Sure, I agree with you that it does have usages, but I don't even use Golang anymore (not only fasthttp but Go at all), so it doesn't make sense that I try to implement it because it would divert my focus from my current job. Also, I would not be able to test it in a daily basis because I wouldn't be using it, therefore I would have to wait for people to report bugs, etc... I don't wanna sell a product that I wouldn't even buy. |
PLEASE MENTION IT IN THE README! that this lib doesn't support http2 |
@apuatcfbd you mean like this snippet that already exists in the README: Lines 577 to 581 in 5f81476
|
Is this planned at all? And if I was interested in implementing it myself, where would I start?
The text was updated successfully, but these errors were encountered: