-
We have a use-case where we routinely run 1000+ pods off a single enterprise-gateway instance. In initial testing we hit a hard limit of around 200 pods. We tracked it down to default ZMQ_MAX_SOCKETS = 1024. We raised this limit higher by adding a couple lines to the RemoteMappingKernelManager as follows:
Ideally this parameter would be exposed in a standardized manner for users to set/change. Does such a mechanism exist already? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @arv1ndn - this is really interesting and I'm really glad you were able to get past your threshold of 200 pods! The ZMQ context is not configurable itself but I think we have a couple of approaches. The most simple would be to extend The other would be to add support for configuring One of the advantages of having our own Since I've gone ahead and coded up what the # Hook the validation of the ZMQ context object to set MAX_SOCKETS is the connection is shared
@validate("context")
def _context_validate(self, proposal: Dict[str, str]) -> Context:
zmq_context = proposal["value"]
try:
# First, assert we have a ZMQ context instance
assert isinstance(zmq_context, Context)
except ValueError:
raise TraitError(f"Invalid ZMQ Context instance! '{type(zmq_context)}'")
if self.shared_context:
zmq_context.set(MAX_SOCKETS, int(os.getenv("EG_MAX_ZMQ_SOCKETS", 1024)))
self.log.debug(f"Set ZMQ sockets to {zmq_context.MAX_SOCKETS}")
return zmq_context Please note that I have not exercised this validator so please take that into account, although this should work. You can also see that I kept the If you find this successful, please open a pull request so we can include it in our upcoming 3.0 release, which should be entering its RC phase shortly (hopefully next week). Please feel free to continue the discussion should you run into issues or need more information. |
Beta Was this translation helpful? Give feedback.
-
Ok I'll try to raise a PR on this today. Unfortunately while libzmq does define ZMQ_MAX_SOCKETS_DLFT, I was unable to find a python binding for this value in pyzmq. I think we might need to end up replicating the value (1023). |
Beta Was this translation helpful? Give feedback.
Ok I'll try to raise a PR on this today. Unfortunately while libzmq does define ZMQ_MAX_SOCKETS_DLFT, I was unable to find a python binding for this value in pyzmq. I think we might need to end up replicating the value (1023).