Skip to content

Restarting WS after reaching 1024 opened files limit #1056

Open
@erikas-tranauskas

Description

So I have this issue where at least once in a week our application WS server reaches too many opened files limit and just crashes eventually. It runs on supervisor and only after supervisor restart it becomes available again.

My sysadmins doesn't want to increase the limits for now, but that's another topic. Although the WS connection is opened on each signed in visitor in our app so I think it's pretty normal to reach this amount of opened connections based on our daily user count.

I wonder if it is possible to setup the supervisor in a way that it would restart the WS process if it hangs this way? Usually the process is up even if the WS goes down, it just doesn't accept any new connections. I use autorestart and autostart parameters in supervisor config.

Also I see some errors logged:

Warning: stream_select(): You MUST recompile PHP with a larger value of FD_SETSIZE.
It is set to 1024, but you have descriptors numbered at least as high as 1298.
 --enable-fd-setsize=2048 is recommended, but you may want to set it
to equal the maximum number of open files supported by your system,
in order to avoid seeing this error again at a later date.

One of the solutions could be just ping the WS from time to time and run the supervisor restart if it fails, but it doesn't sound like a good way to go. Has someone encountered the same opened files limit problem?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions