trickster icon indicating copy to clipboard operation
trickster copied to clipboard

1.1 performance regression

Open BertHartm opened this issue 6 years ago • 13 comments

It seems like when we load test trickster with a prometheus backend, that 1.1 has a reasonably large performance regression as compared to 1.0

both 1.1.2 and 1.1.3 seems to max out at around 100 requests per second when we load test it. 1.0 doesn't seem to get throttled in the same way and can go to several hundred (haven't tried higher yet). We also see much higher cpu and memory usage for 1.1.

We're trying about 15 different queries set to query over the last hour.

BertHartm avatar Oct 28 '20 17:10 BertHartm

Hey Bert, thanks for reporting this. Would you be able to give a bit more information (e.g., cache type and tsdb type). Also if it would be possible to capture some pprof samples (particularly the goroutine sample, but all would be welcomed), that would be really helpful in troubleshooting. Thanks again.

jranson avatar Oct 29 '20 02:10 jranson

btw, if you are not a pprof master, you can go to http://trickster:8481/debug/pprof where each of the links are downloadable artifacts that help us with the performance profiling, and you'll want to grab them during the load test.

jranson avatar Oct 29 '20 03:10 jranson

Hey, not sure what you mean by cache type?

The TSDB is prometheus (though we remote read from m3db). we have it set to not cache the last 5 minutes.

here's the text of the heap endpoint, as well as a cpu profile and binary heap:

trickster_heap.out.gz trickster_cpu.out.gz heap_debug.txt.gz

BertHartm avatar Oct 29 '20 20:10 BertHartm

we support memory, filesystem, redis, etc. for where the actual cached data is stored and retrieved by trickster. The default is memory, so if you have not configured anything else, that is what your deployment is using. would you be able to attach the goroutine pprof for us? that one is what lets us know where time is being spent. Thanks again!

jranson avatar Oct 29 '20 20:10 jranson

sorry, yeah we're using filesystem for the cache type.

here are the goroutines and allocs from a different instance that was slightly less stressed than the other profiles above:

allocs_debug.txt.gz goroutines_debug_2.txt.gz goroutines_debug.txt.gz

BertHartm avatar Oct 29 '20 20:10 BertHartm

Some CPU sampling would be useful as well. That may get you to the meat of what you/James are looking for pretty quickly.

curl http://trickster:8481/debug/pprof/profile\?seconds\=300 -o profile.out

This will give us/you a good representation of what the CPU is spending its time executing.

go tool pprof -http=":8081" /path/to/binary profile.out

I love the flame graph view.

LimitlessEarth avatar Oct 29 '20 20:10 LimitlessEarth

Ideally while there is load which is showing the symptoms you are describing.

LimitlessEarth avatar Oct 29 '20 20:10 LimitlessEarth

Hi @LimitlessEarth , there's a cpu profile in the first set of files (trickster_cpu.out.gz). It's only 5 seconds worth of data though.

It does seem to be spending all of its time in the DeltaProxyCacheRequest based on the cpu and memory profiles.

BertHartm avatar Oct 29 '20 20:10 BertHartm

@BertHartm I think we have this one nailed down. We're working on a design pattern that will achieve the locking ability we need without suffering performance under load, and should have a patch for 1.1 in the next few days.

jranson avatar Nov 10 '20 23:11 jranson

@jranson thanks. let me know if you have a PR and want us to test.

BertHartm avatar Nov 11 '20 17:11 BertHartm

@BertHartm sorry for the delay in getting back to you on this. We have rolled a release candidate v1.1.4-rc1 build that hopefully will address this. We'd love to get some feedback from you on it. The build is available in the releases section here on GitHub, and at tag tricksterproxy/trickster:1.1.4-rc1 on Docker Hub. Thanks for your help! (PR: #517)

jranson avatar Dec 16 '20 13:12 jranson

@BertHartm just wanted to check and see if you were able to give this a spin? Thanks for your help!

jranson avatar Jan 05 '21 23:01 jranson

@BertHartm we went ahead and pushed the 1.1.4 GA release, which includes improves in the areas you identified. If you are still having issues please reopen. Thanks!

jranson avatar Feb 01 '21 14:02 jranson