Troubleshoot PHP-FPM performance



  • Hello,

    I've got a pfSense router which has a terribly slow GUI. Network performance still is fine.

    Every time that I make a change in the GUI I can go for a cup of coffee before the change has been processed.

    When looking on the command line I always notice that php-fpm is consuming 100% cpu for several minutes. As soon as the config change is saved the php-fpm process goes back to 0% cpu utilisation.

    I've enabled the slow logging which is filled with the following messages:
    [2.2.6-RELEASE][root@pfSense.marcoach.nl]/var/log: tail -f php5-slow.log

    [09-Jan-2016 15:13:02]  [pool lighty] pid 39968
    script_filename = /usr/local/www/diag_confbak.php
    [0x0000000802846a88] startElement() /etc/inc/xmlparse.inc:89
    [0x00007fffffffa1b0] startElement() unknown:0
    [0x0000000802846568] xml_parse() /etc/inc/xmlparse.inc:189
    [0x0000000802845df8] parse_xml_config_raw() /etc/inc/xmlparse.inc:151
    [0x0000000802845b10] parse_xml_config() /etc/inc/config.lib.inc:144
    [0x00000008028450e0] parse_config() /etc/inc/config.lib.inc:633
    [0x0000000802844c20] config_restore() /usr/local/www/diag_confbak.php:63

    [09-Jan-2016 15:19:51]  [pool lighty] pid 34956
    script_filename = /etc/rc.start_packages
    [0x0000000802847470] startElement() /etc/inc/xmlparse.inc:89
    [0x00007fffffff9e70] startElement() unknown:0
    [0x0000000802846f50] xml_parse() /etc/inc/xmlparse.inc:189
    [0x00000008028467e0] parse_xml_config_raw() /etc/inc/xmlparse.inc:151
    [0x00000008028464d8] parse_xml_config() /etc/inc/config.lib.inc:539
    [0x0000000802845878] write_config() /etc/inc/pkg-utils.inc:1206
    [0x0000000802843298] delete_package_xml() /etc/inc/pkg-utils.inc:435
    [0x00000008028430f8] force_remove_package() /etc/inc/pkg-utils.inc:465
    [0x0000000802842218] sync_package() /etc/rc.start_packages:66

    [09-Jan-2016 15:19:58]  [pool lighty] pid 38153
    script_filename = /usr/local/www/index.php
    [0x000000080284a800] flock() /etc/inc/util.inc:128
    [0x000000080284a3a0] lock() /etc/inc/config.lib.inc:100
    [0x0000000802849990] parse_config() /etc/inc/config.gui.inc:78
    [0x00000008028493a0] +++ dump failed

    [09-Jan-2016 15:21:12]  [pool lighty] pid 62056
    script_filename = /usr/local/www/pkg_mgr_install.php
    [0x00000008028466a0] startElement() /etc/inc/xmlparse.inc:89
    [0x00007fffffffa350] startElement() unknown:0
    [0x0000000802846180] xml_parse() /etc/inc/xmlparse.inc:189
    [0x0000000802845a10] parse_xml_config_raw() /etc/inc/xmlparse.inc:151
    [0x0000000802845708] parse_xml_config() /etc/inc/config.lib.inc:539
    [0x0000000802844ba8] write_config() /usr/local/www/pkg_mgr_install.php:222

    [09-Jan-2016 15:22:09]  [pool lighty] pid 62381
    script_filename = /etc/rc.filter_synchronize
    [0x0000000802846190] flock() /etc/inc/util.inc:128
    [0x0000000802845d30] lock() /etc/inc/config.lib.inc:100
    [0x00000008028452c8] parse_config() /etc/inc/config.inc:200
    [0x0000000802843d48] +++ dump failed

    [09-Jan-2016 15:25:43]  [pool lighty] pid 84307
    script_filename = /etc/rc.filter_synchronize
    [0x0000000802845f20] flock() /etc/inc/util.inc:128
    [0x0000000802845ac0] lock() /etc/inc/config.lib.inc:100
    [0x0000000802845058] parse_config() /etc/inc/config.inc:200
    [0x0000000802843ad8] +++ dump failed

    [09-Jan-2016 15:29:34]  [pool lighty] pid 60481
    script_filename = /etc/rc.filter_synchronize
    [0x0000000802845f20] flock() /etc/inc/util.inc:128
    [0x0000000802845ac0] lock() /etc/inc/config.lib.inc:100
    [0x0000000802845058] parse_config() /etc/inc/config.inc:200
    [0x0000000802843ad8] +++ dump failed

    [09-Jan-2016 15:33:22]  [pool lighty] pid 73996
    script_filename = /etc/rc.filter_synchronize
    [0x0000000802845f20] flock() /etc/inc/util.inc:128
    [0x0000000802845ac0] lock() /etc/inc/config.lib.inc:100
    [0x0000000802845058] parse_config() /etc/inc/config.inc:200
    [0x0000000802843ad8] +++ dump failed

    [09-Jan-2016 15:37:23]  [pool lighty] pid 71633
    script_filename = /etc/rc.filter_synchronize
    [0x0000000802845f20] flock() /etc/inc/util.inc:128
    [0x0000000802845ac0] lock() /etc/inc/config.lib.inc:100
    [0x0000000802845058] parse_config() /etc/inc/config.inc:200
    [0x0000000802843ad8] +++ dump failed

    When trying to reinstall the packages the system is too slow to complete.

    I'm seeing this problem on 2.2.4, 2.2.5 and 2.2.6. Each time I'm importing a backup xml file on a clean installed system.

    How can I troubleshoot this problem further? Any help is welcome



  • Use the top command on shell to see the process php-fpm and look if closing the graphical interface the process will get lower.

    sorry my bad english