Go HTTP implementation with a focus on performance. Use this for tags about using the fasthttp API.
Questions tagged [fasthttp]
53 questions
0
votes
2 answers
Combining net/http and fasthttp
I was looking for a fast framework for go and I stumbled upon fasthttp https://github.com/valyala/fasthttp which is according to the developer and the benchmark is 10x faster than Golang net/http package. I'm already familiar with gorilla toolkit…

ginad
- 1,863
- 2
- 27
- 42
-1
votes
1 answer
Why is fasthttp.Client slow when used concurrently to consume an API?
it is first case.
var fastClient fasthttp.Client
fastClient = fasthttp.Client{
ReadTimeout: 500 * time.Millisecond,
MaxConnsPerHost: 500,
}
runtime.GOMAXPROCS(1)
for i := 0; i < 500; i++ {
req := fasthttp.AcquireRequest()
…

SungHo Kim
- 291
- 1
- 3
- 11
-1
votes
1 answer
Golang fasthttp router custom logger
I'm playing with fasthttp and it's router, I have no issues with basic things, I have a working server and a router, that is the easy part.
The issue is with the logger, I would like to be able to customize that one, but it does not seem possible…

night-gold
- 2,202
- 2
- 20
- 31
-1
votes
1 answer
How do I make go fasthttp server to trigger the handler faster at a fileupload?
I use fasthttp for a file server project. The file server has an upload function. For uploading files I pass a key as a URL Query to validate the permission for upload.
The main():
// start http server
log.Printf("Starting HTTP server on %q",…

ChrisG
- 202
- 2
- 13
-1
votes
1 answer
Save cookies for maintained session using fasthttp library
I have been pulling my hair out recently, I need to find a way to save cookies after a post request to a URI, so that I can send requests to other endpoints and maintain that session. I am trying to add an item to cart but without saving the cookies…

EmptyCarts
- 3
- 4
-2
votes
2 answers
Memory leak in go http server and fasthttp
My code was a simple fasthttp server like its github examples
but that had an unknown memory leak.
Then I tried to find it and cleared my codes and it had that problem again.
Then I ran just the official example and even that had memory leak…

abgr
- 63
- 9
-3
votes
2 answers
why is fasthttp like single process?
requestHandler := func(ctx *fasthttp.RequestCtx) {
time.Sleep(time.Second*time.Duration(10))
fmt.Fprintf(ctx, "Hello, world! Requested path is %q", ctx.Path())
}
s := &fasthttp.Server{
Handler: requestHandler
}
if err :=…

just coder
- 7
- 2
-6
votes
1 answer
slow building of long string using "+="
I have very slow http response performance
Used Go and Fasthttp
package main
import (
"fmt"
"github.com/valyala/fasthttp"
)
func fastHTTPHandler(ctx *fasthttp.RequestCtx) {
var s string = ""
for i := 1; i <= 100000; i++ {
s…

Влад
- 44
- 5