Jump to content



Photo
- - - - -

DOFLinx 10.03: high CPU usage with DEBUG_TCP_PORT client and possible worker leak on reconnect


  • Please log in to reply
No replies to this topic

#1 Pyrrvs

Pyrrvs

    Neophyte

  • Members
  • Pip
  • 1 posts

  • Flag: ---------

  • Favorite Pinball: Ghost Busters

Posted Today, 11:33 AM

Hi DDH69,

I don't know if this is the right way to report a bug, please let me know if I should report this differently or elsewhere.

 

I use DOFLinx 10.03 with Pinball FX and Pinball FX Midnight, with DEBUG_TCP_PORT=47831 and a TCP client connected to 127.0.0.1.

With one TCP client connected, I observed approximately 125 seconds of cumulative process CPU time over 96 seconds of wall time. After restarting DOFLinx without a TCP client, CPU usage was substantially lower. This is an indicative observation, not yet a controlled benchmark.

 

Read-only inspection of the installed executable suggests that:

  • The client worker loops without waiting when the outgoing queue is empty.
  • The worker continues looping after a write failure or disconnection.
  • Reconnections may therefore accumulate active workers.
  • The two-millisecond delay runs only after sending a message

I collected logs and CPU measurements for four scenarios, each lasting approximately 30 seconds:

  • After a fresh start, without a TCP client: 0.84 seconds of CPU time.
  • With one TCP client connected, receiving no data: 31.02 seconds.
  • After disconnecting that client: 31.08 seconds, with the server-side socket still in CLOSE_WAIT.
  • After restarting DOFLinx again, without a client: 0.72 seconds.

The configuration remained unchanged throughout, with DEBUG=2 and DEBUG_TCP_PORT=47831. No Pinball game was running during these measurements.

I would be happy to help reproduce the issue, collect CPU and resource measurements, and test a candidate fix. If you’re comfortable sharing the relevant source, I could also help develop and test a patch.

 

Thank you for your work on DOFLinx.