Virtualmin modify-php-ini and mofiy-web, updates max_spare_servers

SYSTEM INFORMATION
OS type and version AlmaLinux 9.6
Virtualmin version 7.30.8.pro
Webmin version 2.402
Theme version 24.02

I have several PHP versions installed. When I run the “virtualmin modify-php-ini” or “virtualmin modify-web” commands to change the execution modes, php version, memory_limit’s etc. for a site I am seeing that the pm.max_spare_servers for these are also changing from 3 to 2 when the max_children is set to 4 - (PM is set to dynamic). I noticed that in php-lib.pl, there is a section of code here:

sub get_php_max_spare_servers
{
my ($defchildren) = @_;
my $defmaxspare = $defchildren <= 1 ? $defchildren :
        $defchildren >= 4 ? int($defchildren / 2) : 2;
return int($defmaxspare);
}

I’m guessing that this is what is changing the max_spare_servers.

My question are:

  • Does this get called every time a PHP setting is changed?
  • Is this the cause of my max_spare_servers changing?
  • Does this only apply when PM is dynamic?
  • Is there a way for my max_spare_servers to remain the same upon changing any of these settings?

Hello,

Thanks for bringing this up!

Yes, it looks like a bug… I will look into it more and update this ticket with progress.

@lopYRoLe Try this patch and let me know if it fixes your issue:

webmin patch https://github.com/virtualmin/virtualmin-gpl/commit/b20e7ee

@Ilia I appreciate you looking into this. It does appear to have fixed the issue. Thank you!
Do you know if this patch be implemented in the next release/update?

Yes, it will be.