neon icon indicating copy to clipboard operation
neon copied to clipboard

manage the threadcount issues in pageserver

Open stepashka opened this issue 3 years ago • 3 comments

stepashka avatar May 02 '22 15:05 stepashka

One part of this problem is that the sharded_slab crate has a limit of 4096 threads by default (https://docs.rs/sharded-slab/latest/sharded_slab/trait.Config.html#associatedconstant.MAX_THREADS).

hlinnaka avatar May 06 '22 10:05 hlinnaka

Now we use threadpool for background tasks: https://github.com/neondatabase/neon/pull/1933

Should we close this or we plan to deal with threads going from page_service as well?

LizardWizzard avatar Aug 08 '22 16:08 LizardWizzard

It will take a while until we hit that limit and we can avoid it by spawning more pageservers instead. But making the page_service async will take some work, so it's worth laying out the first steps. Should we transition away from PostgresBackend similarly to what we did in the proxy? Since that would be a big-ish lift anyway, is it time to consider whether the libpq protocol is serving us well in this use case?

bojanserafimov avatar Aug 15 '22 18:08 bojanserafimov

We have switched to async in the pageserver in page_service.rs too, in https://github.com/neondatabase/neon/pull/2376. The number of threads should be limited now. Closing.

hlinnaka avatar Oct 04 '22 08:10 hlinnaka