TCP: too many orphaned sockets when server is running after v26.6.0-alpha.1 #2005
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity#2005
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thank you for your work.
I was using early v26 alpha then updated to 26.6.2. When I start the container, the whole system seems like it can't perform network requests. DNS resolution isn't working, pings drop, etc.
dmesgsaysTCP: too many orphaned sockets.Latest working version is
v26.6.0-alpha.1.The continuwuity server last log is about successful ICMP email test.
You probably ran out of memory for network (see this). This is normally quite low on Linux, especially for Continuwuity which can make a lot of calls. Try increasing them via tuning your
/etc/sysctl.conffile. Example:Then do
sysctl -pto apply changesDo reply if the issue persists after.
Edit: before changing, you can check current values via
cat /proc/sys/net/core/rmem_maxand so onI've never encountered this before, some more information regarding your environment will required (fd limit, the limits stratself mentioned above, etc). 26.6 will make more network requests than 0.5.X since we improved federation reliability, which means more connection noise is expected, but this is the first report of it causing system problems
Thanks for investigating.
@stratself wrote in #2005 (comment):
Yeah, I also stumbled upon that thread when this happened, but my settings are well above:
This one is ridiculously high, but I didn't set it, so it must be one of the NixOS module's work (and, strangely, hasn't caused any issues with other services):
I applied your changes, but it didn't help. I suspect, there are indeed too many open sockets. Normal state (/proc/net/sockstat):
1 minute after continuwuity starts (somewhere around
used 40000a second after it starts, then it gets worse):When the alpha version is in use:
Upon the advice from katie from the continuwuity's room, I ran
netstat, which froze when continuwuity started. I had to stop it to see the logs, which are interesting. Seems like something makes the host try different DNS servers (one.one.one.one, etc), and sometimes even itself:...it goes on. These are the servers from dnsproxy I have configured. When I set my Adguard Home's IP as DNS, I saw around 2K requests just for 5 seconds the server ran.
@lippiece
These are expected levels of DNS load for Continuwuity (and Matrix in general). There's not much one can do about it. Host --> host traffic is likely the server talking to AGH.
I have a few more advises you can employ:
nofiledescriptors limit for your continuwuity user inlimits.conf, which should help per-user ulimits/proc/sys/net/ipv4/tcp_max_orphansin your sysctl as wellLet us know of further discoveries. I do think there are some noticeable DNS/system impact but not sure how
I've had Synapse running for year or more, but never had this at least tenfold increase in DNS requests. Docs say "sometimes thousands per minute", but this is thousands per second, and I haven't yet joined that many rooms as I had when I had Synapse.
I have increased
tcp_max_orhpansto 400000 and Adguard's cache to 100 MB, but it still can't handle this. The server starts, but doesn't run more than a few seconds: it times out when checking for announcements, and fails to query DNS for the SMTP connection test. The system can handle this many orphans, but Adguard or dnsproxy can't handle this many requests.There has been some discussion in continuwuity's Matrix room about this. In short (please correct if I missed something):
startup_netburst = falsein config.dnsproxy.