Disable systemd rate limiting for PHP-FPM to prevent installation fai…#7
Closed
klemenza wants to merge 4 commits into
Closed
Disable systemd rate limiting for PHP-FPM to prevent installation fai…#7klemenza wants to merge 4 commits into
klemenza wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix PHP-FPM installation failures by disabling systemd rate limiting
Problem
On first provision, the PHP extension installation task fails with:
This only happens on first provision because:
php8.3-bcmath,php8.3-cli,php8.3-curl, etc.)php-fpmto restart via dpkg post-install hooksOn subsequent provisions, extensions are already installed (no restarts triggered), so the issue doesn't occur.
Solution
Add a systemd override during bootstrap that disables rate limiting for
php8.3-fpm.service:Setting StartLimitIntervalSec=0 tells systemd to never enforce rate limits on this service, allowing unlimited restarts during the package installation loop.
Why WSL-specific
This is particularly problematic in WSL2 because:
Fresh distros are bootstrapped and provisioned in one flow
The entire stack (Ansible + PHP + all extensions) installs in minutes
The rapid-fire dpkg operations hit systemd limits that production servers never see (they install packages gradually over time)
Testing
Tested on Windows 11 with WSL2 Ubuntu 24.04. PHP 8.3 and all extensions now install successfully on first provision without start-limit-hit errors.