LWS OOM issue building (cooking) in a Xeon server

Hi everyone!

I’m building a linux dedicated server for a small project using the latest dev-slim docker image unreal-engine:dev-slim-5.5.1. It builds perfectly fine on 2 computers, an i7 and an i9, in both windows11 (WSL) and linux, but when I try to build exactly the same thing on a Xeon based server (same Dockerfile, same build command, same project…) I get an OOM error initializing libwebsockets in the cooking stage.

This is the specific error I get in my Xeon server:

LogInit: Display:
LogInit: Display: Warning/Error Summary (Unique only)
LogInit: Display: -----------------------------------
LogInit: Display: LogWebSockets: Error: Failed to initialize libwebsockets
LogInit: Display: LogWebSockets: Warning: Lws(Error): OOM allocating 1073741816 fds
LogInit: Display: LogWebSockets: Warning: Lws(Error): ZERO RANDOM FD

My server has this specific CPU:

Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz

This Xeon server of course has much more memory than the computers I use to build it without any issue. Actually it has 256GB and during the build it never uses more than 4-5GBs. Docker builds are not limited at all in this server.

This is what I use to build the dedicated server with the unreal-engine:dev-slim-5.5.1 docker image:

RUN /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh \
    BuildCookRun \
    -project=/src/MYPROJECT.uproject \
    -nop4 \
    -Server \
    -NoClient \
    -ServerConfig=Shipping \
    -unrealexe=/home/ue4/UnrealEngine/Engine/Binaries/Linux/UnrealEditor-Cmd \
    -UTF8Output \
    -NoDebugInfo \
    -platform=Linux \
    -targetplatform=Linux \
    -build \
    -cook \
    -allmaps \
    -skipcookingeditorcontent \
    -unversionedcookedcontent \
    -pak \
    -distribution \
    -compressed \
    -stage \
    -package \
    -archive \
    -archivedirectory=/src/dist

Any idea why it builds well in i7/i9 computers and libwebsockets fails with that OOM in my Xeon based server?

Thanks so much in advance! :slight_smile:

Ok, I feel now dumb I’ve been stuck with this for a couple days and I just found it a few minutes after posting here :sweat_smile:

It seems that libwesockets has this issue when “nofiles” in ulimit is set to “too high” values. I just found a couple references:

I just limited it in my Dockerfile so it always uses a reasonable low limit, like:

RUN ulimit -n 1024
RUN /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh \
      BuildCookRun \
      -project=/src/MYPROJECT.uproject \
      -nop4 \
      -Server \
      -NoClient \
      -ServerConfig=Shipping \
      -unrealexe=/home/ue4/UnrealEngine/Engine/Binaries/Linux/UnrealEditor-Cmd \
      -UTF8Output \
      -NoDebugInfo \
      -platform=Linux \
      -targetplatform=Linux \
      -build \
      -cook \
      -allmaps \
      -skipcookingeditorcontent \
      -unversionedcookedcontent \
      -pak \
      -distribution \
      -compressed \
      -stage \
      -package \
      -archive \
      -archivedirectory=/src/dist

And it builds fine everywhere including my Xeon build server.

Sorry for the noise, I hope it helps anybody else having this issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.