[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-08-02 Thread Santiago Corredoira
go 1.19 has just been released and the problem is gone! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-29 Thread Santiago Corredoira
>> bill 63668 155 0.0 1891292 12140 pts/0 Sl+ 09:15 1:52 >>> /tmp/go-build910547164/b001/exe/test >>> bill 63750 0.0 0.0 11564 652 pts/1S+ 09:16 0:00 grep >>> --color=auto test >>> >>> El martes, 12 de ab

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-12 Thread Santiago Corredoira
0:00 go run test.go bill 63668 155 0.0 1891292 12140 pts/0 Sl+ 09:15 1:52 /tmp/go-build910547164/b001/exe/test bill 63750 0.0 0.0 11564 652 pts/1S+ 09:16 0:00 grep --color=auto test El martes, 12 de abril de 2022 a las 9:13:41 UTC+2, Santiago Corredoira

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-12 Thread Santiago Corredoira
> 140341803388040) = 0 >> [pid 42659] 23:36:49.035281 epoll_pwait(3, [], 128, 0, NULL, >> 18704162493558) = 0 >> [pid 42659] 23:36:49.035293 epoll_pwait(3, [], 128, 0, NULL, >> 140341803388040) = 0 >> [pid 42659] 23:36:49.035306 epoll_pwait(3, [], 128, 0, NULL, >> 1

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-11 Thread Santiago Corredoira
) = 0 The program is too large to post here. I have tested it with go race and it doesn't run into any problem. Any idea of what to look for? Thank you! El lunes, 11 de abril de 2022 a las 17:08:40 UTC+2, Santiago Corredoira escribió: > I tried with the stripped tmp version of &quo

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-11 Thread Santiago Corredoira
I tried with the stripped tmp version of "go run" and after a while I was able to reproduce it too. It definitely took me more time but probably is just random. I tried "$ GODEBUG=asyncpreemptoff=1 ./test" and I kept seeing the the calls every 10ms. Is this expected to happen? I compiled the

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-11 Thread Santiago Corredoira
=LinuxMint DISTRIB_RELEASE=19.3 The 100% CPU spikes would sart at any moment and would usually stop after a I made a new http request to the server. El lunes, 11 de abril de 2022 a las 10:15:23 UTC+2, Santiago Corredoira escribió: > Hi Brian, thanks for your help. > > Al my go downlo

[go-nuts] Re: Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-11 Thread Santiago Corredoira
Hi Brian, thanks for your help. Al my go downloads are from go.dev In this tests I am using $ go version go version go1.18 linux/amd64 I run the tests in a laptop with linux as the main OS, no emulation. $ grep "model" /proc/cpuinfo | sort | uniq -c 12 model: 165 12 model

[go-nuts] Constant CPU usage on an idle HTTP server from Go 1.17

2022-04-10 Thread Santiago Corredoira
Hi, On Linux, if I compile and run this simple program: package main import ( "fmt" "net/http" "time" ) type x struct{} func (x) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Write([]byte("")) } func main() { sp := { ReadHeaderTimeout: 5 *

Re: [go-nuts] HTTP timeout per handler

2019-09-30 Thread Santiago Corredoira
cel the request after the certain time > you like. > > ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) > defer cancel() // releases > > > On Mon, Sep 30, 2019, 8:54 PM Santiago Corredoira > wrote: > >> Using the http package, timeouts are

[go-nuts] HTTP timeout per handler

2019-09-30 Thread Santiago Corredoira
Using the http package, timeouts are defined per server. Is there any way of changing it for a specific handler? Imagine a long download from a loged user or a websocket but also be protected against clients that don't close connections and fload the server. -- You received this message