-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snuffleupagus associated with high CPU load #481
Comments
Nevermind, i found the issue: we were loading a non-existent rules file but also having this option on: sp.allow_broken_configuration=true closing the issue |
Snuffleupagus shouldn't eat all the CPU even when provided with an invalid config. |
We have High CPU usage too, i will check for broken config later today and report back. |
please provide a configuration which allows us to reproduce this. |
Hello, sorry for delay, i was trying to find the minimal setup that can replicate this. If you follow these steps on a fresh Debian i believe you should be able to replicate the issue: Install minimal PHP packages: # apt-get purge php*
# apt autoremove
# apt-get install php8.2-fpm php8.2-dev Compile Snuffleupagus: $ git clone https://github.com/jvoisin/snuffleupagus
$ cd snuffleupagus/src
$ phpize
$ ./configure --enable-snuffleupagus
$ make
$ make install Create a new FPM pool: # rm /etc/php/8.2/fpm/pool.d/www.conf
# vi /etc/php/8.2/fpm/pool.d/www.conf Add this minimal FPM config: [www]
user = www-data
group = www-data
listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = www-data
; Choose how the process manager will control the number of child processes.
pm = ondemand
pm.max_children = 150
pm.start_servers = 1
pm.min_spare_servers = 3
pm.max_spare_servers = 10
pm.process_idle_timeout = 10s
; ext-snuffleupagus
php_admin_value[sp.configuration_file] = /etc/snuffleupagus/nonexistent.rules Add an empty directory for Snuffleupagus rules: # mkdir -p /etc/snuffleupagus Load Snuffleupagus into PHP: # vi /etc/php/8.2/fpm/php.ini Add these lines to the top of the file: extension=snuffleupagus.so
sp.allow_broken_configuration=true Restart FPM: # service php8.2-fpm restart Watch the logs: # tail -f /var/log/php8.2-fpm.log
[29-Jan-2024 14:46:58] NOTICE: fpm is running, pid 457231
[29-Jan-2024 14:46:58] NOTICE: ready to handle connections
[29-Jan-2024 14:46:58] NOTICE: systemd monitor interval set to 10000ms Keep log open. All is OK until any request comes to FPM. Simulate by a curl call to port 9000 in a new shell: $ curl localhost:9000 Log now looks like this and load goes up:
|
It seems that PHP doesn't like when one of its processes exists, so it keep trying to respawn new ones, sigh. I guess screaming in the logs and returning "Success, everything's dandy!" is the way to go. |
Hello,
we recently activated Snuffleupagus on a AMD 2core 8gb ram VM in GCP. We are using it with one php8.2 FPM pool. The machine has literally zero traffic as it being used only sporadically for some tests.
However after enabling Snufleupagus the CPU load has gone to 100% making it hard to work with the box.
After tweaking around we found out that the load goes away as soon as we disable Snuffleupagus and comes back after enabling it.
Do you have any ideas what might have caused this ? We are running Snuffleupagus also on other machines but have not encountered this issue before. Do you have some benchmarks that would show how much Snuffleupagus consumes when in "rest" conditions (eg. no traffic to PHP) ?
The text was updated successfully, but these errors were encountered: