You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
This is a fine way to convey the message to the admin that the affinity flags won't work, but…
In a virtual (container) environment it is posible that a container have access to a limited set of CPUs, say, [1,2,3,4], and since the admin was suggested to pin the single-threaded python code to one CPU s/he may do a pin to cpu1.
But then the virtualisation evironment may reassign the CPUs, say, [5,7,9,11] to the container, and pin-to-1 will panic. This makes cpu_affinity basically unuseable.
Suggestion
It seems one reason to use cpu_affinity is to bound the process to one CPU and it it usually does not matter which one. It would be good if there was an alternative way to request that every thread should be affine to one (existing) cpu, no matter which. Or, alternatively, using this as a fallback to current cpu_affinity, but I don't think this added complexity would serve any good.
It seems python already handle the knowledge pretty well:
as per #5525: cpu_affinity isn't much use on python3, and we're removing support for it.
I think restricting synapse to one CPU (and only one CPU) is somewhat out of scope for the application-level configuration, and is better managed with OS-level tools such as cgroups. (It's worth noting that synapse is largely single-threaded anyway, so I'm not sure that applying such a limit will gain you much.)
Description
Right now
cpu_affinity
is a bitmask: the admin have to say which CPUs the process can me bound.When the request cannot be fulfilled the syscall gives
and homeserver panics.
This is a fine way to convey the message to the admin that the affinity flags won't work, but…
In a virtual (container) environment it is posible that a container have access to a limited set of CPUs, say, [1,2,3,4], and since the admin was suggested to pin the single-threaded python code to one CPU s/he may do a pin to cpu1.
But then the virtualisation evironment may reassign the CPUs, say, [5,7,9,11] to the container, and pin-to-1 will panic. This makes
cpu_affinity
basically unuseable.Suggestion
It seems one reason to use
cpu_affinity
is to bound the process to one CPU and it it usually does not matter which one. It would be good if there was an alternative way to request that every thread should be affine to one (existing) cpu, no matter which. Or, alternatively, using this as a fallback to currentcpu_affinity
, but I don't think this added complexity would serve any good.It seems python already handle the knowledge pretty well:
Version information
v1.0.0, platform linux, lxc based containers.
The text was updated successfully, but these errors were encountered: