mardi 10 mars 2015

How to increase max socket connections for Yosemite 10.10


I'm trying to test a network service app that allows for a large number of simultaneous socket connections.


I have adjusted /etc/sysctl.conf with the following:



kern.maxfiles=65536
kern.maxfilesperproc=65536
kern.ipc.somaxconn=10000


With this in place, ulimit -n shows I have a 65536 "open file" maximum. Yet my service still gets stuck around the 1000th connection.


Thinking that perhaps it's something specific to the platform (Node), I re-implemented a simplified version of it in Golang, but it exhibits the same problem.


It also happens if I split the "client" side up into several procs that each open a handful of connections. The service always get stuck around the 1000th connection.


lsof -p <pid> shows 1011 IPv6 connections like so:



gochat 25034 username 178u IPv6 0x11c1273e19ee5c8f 0t0 TCP localhost:http-alt->localhost:50080 (ESTABLISHED)


What is imposing this maximum socket connection limit, and how can I expand it?





Aucun commentaire:

Enregistrer un commentaire