Fail Faster — Derick Rethans
Home
Archive
Talks
Projects
Contact
Search
Fail Faster
Wednesday, August 12th 2026, 16:00 BST
London, UK
For a long time I have heard complaints that Xdebug, with its debugger enabled, slows down applications, even if there is no IDE listening.
I have never been able to reproduce this, as on Linux (and macOS), TCP connections to a localhost ports fail immediately if that port is not open.
Xdebug waits for up to 200ms when making a debug connection. This is configurable with the xdebug.connect_timeout_ms setting.
But if there is nothing listening, there should not be any delay, as it ought to be an immediate error.
I wrote a comment in an issue from 2024:
The error message ERR: Time-out connecting to debugging client, waited:<br>200 ms. indicates that your network stack doesn't immediately reject the connection if it can't be made. That's usually due to a (misconfigured) firewall.
It turns out, that it is not a firewall, but that Windows itself behaves bad here. Instead of failing immediately, it does retry sending TCP SYN packets to try to establish a connection. This is pointless on the local loopback interface, as network packets cannot get lost.
Through a post by Daniel Stenberg on Mastodon, I found out the cause, and a solution.
He explains how it affects curl's Happy Eyeballs algorithm in a blog post from 2024. Although Xdebug does not use Happy Eyeballs, the underlying problem is the same.
Last week, Marcel Jamin wrote to the curl mailing list, with a solution. This solution disables the retry mechanism to establish a connection. And in turn that means, that there is no longer a delay on Windows either.
I have today merged a pull request for Xdebug which implements this solution. The patch is part of the upcoming Xdebug 3.6 release.
Shortlink
This article has a short URL available: https://drck.me/fail-faster-kbh
Likes
❤️ Christoph Ziegenberg
❤️ Daniël Klabbers
❤️ Daniel Neuman
❤️ Dennis Koch
❤️ Derick Rethans
❤️ Kore Nordmann
❤️ Larry Garfield
❤️ mattsches
Comments
Grummfy 🍫
Wednesday, August 12th 2026, 15:37 UTC
@blog nice one
Add Comment
Name:
Email:
Will not be posted. Please leave empty instead of filling in garbage though!
Comment:
Please follow the reStructured Text format. Do not use the comment form to report issues in software, use the relevant issue tracker. I will not answer them here.
All comments are moderated
My Amazon wishlist can be found here.
Human-Made Webring
previous |<br>random |<br>next
Life Line
Merged pull request #1100
github:xdebug/xdebug — Aug 12th, 13:35 UTC
Fixed issue #2267: Application slow when debugger is not listening on…
github:xdebug/xdebug — Aug 12th, 13:07 UTC
I walked 3.0km in 1h10m24s<br>runkeeper — Aug 11th, 15:50 UTC
Is there somebody who runs PHP on native windows (with Xdebug) and can run a simple script for me?<br>It must be in a file (`test.php`):<br>```<br>And run like:<br>php -dxdebug.log_level=11 -dxdebug.log=c:\temp\xdebug-i.log -dxdebug.client_host=localhost -dxdebug.client_port=9111 -dxdebug.mode=debug c:\temp\test.php<br>With the port 9111 not open.<br>Would love to see the output and log file (in a DM).<br>#xdebug #php
mastodon — Aug 11th, 15:43 UTC
I walked 5.5km in 55m06s<br>runkeeper — Aug 11th, 07:55 UTC
@harry_wood This is this list of 100 Go-mistakes that I was talking about: https://100go.co/
mastodon — Aug 10th, 13:50 UTC
Updated a crossing<br>51.54° N, 0.17° W — osm — Aug 10th, 06:54 UTC
I walked 2.1km in 20m08s<br>runkeeper — Aug 9th, 19:50 UTC
Enjoying my afternoon and evening out at Lords for some cricket!<br>#TheHundred #cricket #london
mastodon — Aug 9th, 18:17 UTC
I walked 3.2km in 38m54s<br>runkeeper — Aug 9th, 12:37 UTC
I walked 9.1km in 1h34m28s<br>runkeeper — Aug 9th, 10:53 UTC
Updated a gate<br>51.53° N, 0.17° W — osm — Aug 9th, 10:40 UTC
Updated a bakery shop<br>51.54° N, 0.19° W — osm — Aug 8th, 22:09 UTC
Updated a convenience shop<br>51.57° N, 0.13° W — osm — Aug 8th, 12:50 UTC
I walked 8.1km in 1h32m18s<br>runkeeper — Aug 8th, 11:22 UTC
I walked 5.6km in 59m13s<br>runkeeper — Aug 8th, 09:56 UTC
Updated a restaurant and a cafe; Confirmed 2 restaurants and a cafe<br>51.52° N, 0.14° W — osm — Aug 7th, 19:27 UTC
I walked 6.7km in 1h8m27s<br>runkeeper — Aug 7th, 17:05 UTC
I walked 4.7km in 50m02s<br>runkeeper — Aug 7th, 11:58 UTC
I got myself a sheet of Sun-safe filter material, and McGuyvered a pop-up filter for my lens.<br>The first attempt sort of worked, but I didn't get the filter 100% straight. Luckily I have more material.<br>But this is sort of my first attempt, and a few sunspots are clearly visible on the right of the image.<br>Warning: Never look at the Sun without protection!<br>#Sun #Photography #Astronomy #AstroPhotography
mastodon — Aug 6th, 16:10 UTC
Go with 2026.02
github:derickr/timelib — Aug 6th, 15:55 UTC
Improve error messages for `timelib_duration_create_from_iso8601strin…
github:derickr/timelib — Aug 6th, 14:41 UTC
Fix overflow in the nanosecond carry in...