Re: [go-nuts] profiling help

2022-01-12 Thread Steve Roth
Thanks, Kurtis, The production version of this code runs as a regular web server. I was profiling in CGI just to simplify the configuration. Regards, Steve On Wed, Jan 12, 2022 at 5:34 PM Kurtis Rader wrote: > FWIW, I had the same suspicion as Robert. In my experience a CGI task that > takes

Re: [go-nuts] profiling help

2022-01-12 Thread Kurtis Rader
FWIW, I had the same suspicion as Robert. In my experience a CGI task that takes less than, say, 200ms is going to be swamped by startup costs. It's usually better to use the FastCGI protocol

Re: [go-nuts] profiling help

2022-01-12 Thread Steve Roth
Hi, Robert, The request *should* be super short, but it was actually taking 2.5 seconds. That was the whole reason I started trying to profile it, to figure out why a simple request was taking so long. Ian's suggestion of heap tracing found the issue for me: there was an unexpected allocation o

Re: [go-nuts] profiling help

2022-01-12 Thread robert engels
Are you certain that the requests aren’t super short - so all you are measuring is the runtime startup time / and the overhead of parsing the CGI “protocol". This is not insignificant. CGI really only works well for long requests IMO. > On Jan 12, 2022, at 5:29 PM, Steve Roth wrote: > > Thank

Re: [go-nuts] profiling help

2022-01-12 Thread Steve Roth
Thank you, Ian. From the function names, I suspected that the 70% chain was the garbage collector. But in this run, garbage collection was turned off with GOGC=off, and that was verified with GODEBUG=gctrace=1. So I thought perhaps they must be something else. I will proceed with heap profiling

Re: [go-nuts] profiling help

2022-01-12 Thread Ian Lance Taylor
On Wed, Jan 12, 2022 at 1:54 PM Steve Roth wrote: > > I am attempting to profile my code, and I'm unable to interpret the results. > So first, the meta-question is, what's the best forum to use to request help > with such things? This is a good place. See also https://golang.org/wiki/Question

[go-nuts] profiling help

2022-01-12 Thread Steve Roth
I am attempting to profile my code, and I'm unable to interpret the results. So first, the meta-question is, what's the best forum to use to request help with such things? The code I'm profiling is the server side of a moderately complex webapp. For simplicity, I've wrapped it with net/http/cgi a