OCEAN-xyz / datum_gateway

Decentralized Alternative Templates for Universal Mining
Other
32 stars 9 forks source link

Attempt to to set our own soft limits #26

Open jesterhodl opened 2 days ago

jesterhodl commented 2 days ago
  1. attempt to set out own soft limits
  2. align wording: "hard open file limit" and "soft open file limit"

We basically check if max_clients is higher than the soft limit and if so, set the soft limit to the max_clients or the hard limit, if max_clients is higher.

It looks like this in action (when I doubled the defaults):

2024-10-22 21:51:39.315 [              datum_stratum_v1_socket_server]  INFO: Stratum V1 Server Init complete.
2024-10-22 21:51:39.315 [              datum_stratum_v1_socket_server]  WARN: *** NOTE *** Max Stratum clients (2048) exceeds soft open file limit (Soft: 1024 / Hard: 1048576)
2024-10-22 21:51:39.315 [              datum_stratum_v1_socket_server]  WARN: *** NOTE *** Attempting to increase the soft limit...
2024-10-22 21:51:39.315 [              datum_stratum_v1_socket_server]  INFO: Successfully increased the soft open file limit to 2048

Now that I suggest this PR. Is setting the limits to max_clients sufficient? Surely not, because there are other files open. This of course doesn't invalidate this PR, because it does what it is supposed to, but I suppose we should have more room.