neon
neon copied to clipboard
manage the threadcount issues in pageserver
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).
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?
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?
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.