-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complicated Determination Of SOMAXCONN #32
Comments
I agree with you that the value for I'm copying and pasting a well written article from https://utcc.utoronto.ca/~cks/space/blog/python/AvoidSOMAXCONN that explains the rationale behind why we have implemented the
Also newer kernels come with higher In our production systems, we have certainly hit the limit associated with the default value of |
Interesting. I just checked my Linux system (Debian Unstable, kernel version 6.1.0-9). The definition of
it returns ... 4096. Note also this part from the
|
If you really want to get the system-configured dynamic value, don’t spawn a separate process, just read it directly, e.g.
|
That would work if we were only dealing with linux machines. Unfortunately the macOS does not have a procfs. You'll need to spawn a subprocess to use sysctl to read these values. The current implementation works on macOS and Linux. The function runs once when the FastAGI server starts. |
The code is getting used and taking massive volume of calls. Developers using various different OS make changes tk fastagi scripts and test it locally. What Karthic says is true as most of us use mac os. Unless this causes severe issue then the changes is not necessary. |
I’m sure somebody else can come up with a corresponding improvement for particular proprietary systems. All we need is somebody with expertise in them to contribute. My contribution is to improve things under Linux. |
Did you know you can specify 0 as the backlog value? |
I’ve been looking a little into the Linux kernel source code, to try to understand how this backlog value is actually interpreted. It seems to me that raising this limit isn’t going to improve overall performance, it’s just going to help somewhat with transient peaks in the rate of incoming requests. If the sustained connection rate is larger than you can handle, then no amount of increasing the backlog will help. Something that might help with dealing with higher connection rates is the |
You have this routine
_ThreadedTCPServer.get_somaxconn()
inagi/fastagi.py
which goes to a lot of trouble to figure out the value of the system constantSOMAXCONN
.This is completely unnecessary, since that constant has been in the Python
socket
module since just about forever—certainly since Python 2.7—in other words, in every version of Python you could conceivably care about. Just use that value.The text was updated successfully, but these errors were encountered: