Limits.processes ~ process count in Linux container?

To show the number of running processes in an LXC container (Ubuntu 24.04) I know of the following command to do so:

ps -e | wc -l

Is that the process count which is limited by the LXC limits.processes setting?

It probably is but I just wanted to make sure.

Thanks

Basically, yes. The count doesn’t always exactly match as threads may not be counted in some scenarios.

You may be able to get the current pid count from /sys/fs/cgroup instead which would give you the exact value.