Questions tagged [fasthttp]

Go HTTP implementation with a focus on performance. Use this for tags about using the fasthttp API.

53 questions
0
votes
1 answer

How do I convert post request body to query string format on go fasthttp/gofiber?

This is what I'm doing with Get requests app.Get("/", func(c *fiber.Ctx) error { fmt.Println(string(c.Request().URI().QueryString())) return c.SendString("Ok!") }) I'm getting the following output hello=12&sdsdf=324 I want to do…
AH.
  • 741
  • 1
  • 12
  • 27
0
votes
1 answer

Receiving Golang GET request with # in the URL parameter

I'm trying to create a fulfillment app for shopify, and they send a call once an hour to an endpoint on my app, with the order names they need me to provide tracking numbers for. Unfortunately the order names have "#" in them (ex. #1001.1). When I…
0
votes
0 answers

High latency spikes with fasthttp simple example

I sampled 5 minutes latency with an simple fasthttp example in 100QPS, and found high latency spikes (up to 9ms latency but less than 1ms most of the time) in the result: see the latency chart Is the latency spikes normal or I missing…
xiaowenxia
  • 17
  • 2
0
votes
1 answer

First requests not sending in the start of the goroutine func

i am running goroutines in my code. say, if i set my threads to 50, it will not run the first 49 requests, but it will run the 50th request and continue with the rest. i am not really sure how to describe the issue i am having, and it gives no…
tanpug
  • 1
0
votes
1 answer

How to configure Proxy in Locust for FastHTTPUser approach

How to configure Proxies in Locust for FastHTTPUser Approach. It is working fine for HTTPUser approach as given below but same is not working for FastHTTPUser approach. proxies = { "http": "my.company.cmm:80", "https":…
vnbal
  • 41
  • 3
0
votes
1 answer

Cannot get value from session store in gofiber session

I am working with fiber golang framework. I can't figure out why I cannot get the value set in the store(Redis in this case) from another request or within. Below is the code: sessionProvider := redis.New(redis.Config{ KeyPrefix: "session", …
0
votes
1 answer

How to create HTTP Session in Go

I am currently using fasthttp for sending my requests my question is, is there a way to have a persistent session? I need the cookies and data to stick. c := fasthttp.Client{ Name: "Add To Cart",} store, err := session.Start() // ????? args :=…
0
votes
1 answer

Fasthttp error when reading request headers: invalid header key " http/1.1\r\nuser-Agent"

I am just started learning Go, and this question made me stuck. Trying to test request handling on localhost in testing func using github.com/valyala/fasthttp. First running the server like in…
Lara Zaiets
  • 5
  • 1
  • 4
0
votes
0 answers

FastHttp server "removes" Authorization header

Edit: Fixed. To see what was wrong take a look at this. When I try to send a request to a FastHttp server with an Authorization header, the header gets removed. When I send a request with Postman, the Authorization header does not get removed. To…
Cerus
  • 141
  • 1
  • 11
0
votes
1 answer

Too many open files serving http

I have the following code package main import ( "bytes" "fmt" "github.com/gorilla/mux" "log" "net/http" "time" "io" httprouter "github.com/fasthttp/router" "github.com/valyala/fasthttp" ) func main() { …
user3677365
  • 95
  • 2
  • 13
0
votes
0 answers

Understanding response time costs

I'm new in Golang and trying to write simple web-server with json response. One of endpoints is for database access. With static-like response (such as any static string or simple data conversion) average response time is about 0s (<1ms). If I add…
0
votes
0 answers

How to handle closure event for "server push" http connections

The situation is: a server has many open connections with custom BodyStreamWriter (for server push), and all the clients close the connections on their side. I see two issues: fasthttp seems keeping all the related internal objects in…
0
votes
0 answers

Why are my mgo queries running slower than they do in php

I've swapped an endpoint from our PHP 7 app to a new Go service. The service takes a geographic bounding box and returns properties from a mongo database. The problem is that it's currently taking 4-5 times as long as the old PHP service took to do…
Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88
0
votes
1 answer

Serving multiple directories is not working

Is there any way to serve multiple directory using fasthttp framework? I wrote the below code for the same purpose. But, this code is not working as I expected. When I access localhost:8080/path1, It throws error and warnings, Cannot open requested…
sprabhakaran
  • 1,615
  • 5
  • 20
  • 36
0
votes
1 answer

Function as argument, access inner parameter

The package valyala/fasthttp implements the following function type: type RequestHandler func(ctx *RequestCtx) It is used in buaazp/fasthttprouter like this: func (r *Router) Handle(method, path string, handle fasthttp.RequestHandler) { …
Arnaud H
  • 881
  • 2
  • 10
  • 16