Php high cpu load



  • Hi,

    I've had a pfsense machine running in a building supporting about 150 people on 44 separate vlans (one for each tennant) on one of these systems http://www.amazon.com/gp/product/B004GKULFO/ref=oh_details_o08_s01_i00?ie=UTF8&psc=1 with 2GB of ram. I have had 0 problems until about 3 days ago. All of a sudden php is using almost 100% of one core on the server, and people's voip calls are being dropped, the internet is slow, etc. I have no packages installed, no traffic shaper set up, and when I unplug the lan the cpu usage gradually goes down to 0.

    here's my top -SH output

     PID USERNAME PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
    35761 root      76    0   140M 37872K lockf   3   4:42 88.87% php
     5658 root     115    0   138M 33612K CPU2    2   3:59 85.35% php
       11 root     171 ki31     0K    64K RUN     0  19:33 83.15% idle{idle: cpu0}
       11 root     171 ki31     0K    64K CPU1    1  12:20 70.46% idle{idle: cpu1}
       11 root     171 ki31     0K    64K RUN     2  11:06 25.00% idle{idle: cpu2}
       11 root     171 ki31     0K    64K CPU3    3   8:28 18.26% idle{idle: cpu3}
    57547 root      76   20  8296K  2068K wait    0   0:02  0.20% sh
     8899 root      76   20  2716K   968K nanslp  1   0:00  0.20% sleep
      258 root      76   20  6908K  1524K kqread  0   1:09  0.00% check_reload_status
        0 root     -16    0     0K   240K sched   1   0:54  0.00% kernel{swapper}
    61427 root      44    0 26268K  6368K kqread  1   0:08  0.00% lighttpd
       12 root     -32    -     0K   432K WAIT    0   0:06  0.00% intr{swi4: clock}
       12 root     -68    -     0K   432K WAIT    0   0:06  0.00% intr{irq259: em1:rx 0}
    67389 nobody    44    0 10100K  2964K select  1   0:04  0.00% dnsmasq
        3 root      -8    -     0K    16K -       0   0:03  0.00% g_up
       12 root     -68    -     0K   432K WAIT    0   0:03  0.00% intr{irq256: em0:rx 0}
    77965 root      76   20  8296K  2068K wait    2   0:02  0.00% sh
    75268 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
    40614 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
    47460 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
      142 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
    82846 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
    78882 root      76   20  8296K  2068K wait    1   0:02  0.00% sh
    94538 root      76   20  8296K  2068K wait    1   0:02  0.00% sh
    39935 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
       12 root     -64    -     0K   432K WAIT    0   0:02  0.00% intr{irq19: uhci2 uhc}
    95838 root      76   20  8296K  2068K wait    2   0:02  0.00% sh
    78575 root      76   20  8296K  2068K wait    2   0:02  0.00% sh
    42848 root      76   20  8296K  2068K wait    2   0:02  0.00% sh
    74959 root      76   20  8296K  2068K wait    1   0:02  0.00% sh
    61980 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
        4 root      -8    -     0K    16K -       0   0:02  0.00% g_down
    40859 root      76   20  8296K  2068K wait    0   0:02  0.00% sh
    43711 root      76   20  8296K  2068K wait    2   0:02  0.00% sh
    19025 root      44    0  6956K  1656K select  0   0:02  0.00% syslogd
    

    and my vmstat -i output

    interrupt                          total       rate
    irq18: ehci0 uhci5                     2          0
    irq19: uhci2 uhci4+               100715         46
    irq23: uhci3 ehci1                    62          0
    cpu0: timer                      4355325       1991
    irq256: em0:rx 0                   60430         27
    irq257: em0:tx 0                   68511         31
    irq258: em0:link                       2          0
    irq259: em1:rx 0                  103141         47
    irq260: em1:tx 0                   93182         42
    irq261: em1:link                       7          0
    cpu2: timer                      4355116       1991
    cpu1: timer                      4355114       1991
    cpu3: timer                      4355110       1991
    Total                           17846717       8160
    
    

    any help is greatly appreciated.


  • Netgate Administrator

    What version and install type of pfSense are you running?

    You could try this:
    https://forum.pfsense.org/index.php/topic,51468.msg285177.html#msg285177

    High PHP load can be caused by running something from the command prompt box in the webgui that never finishes.

    That would be solved by rebooting however.

    Steve



  • @stephenw10:

    What version and install type of pfSense are you running?

    You could try this:
    https://forum.pfsense.org/index.php/topic,51468.msg285177.html#msg285177

    High PHP load can be caused by running something from the command prompt box in the webgui that never finishes.

    That would be solved by rebooting however.

    Steve

    2.1 full install.

    I noticed that there were some devices on the administrative vlan that I didn't put there, so I disabled that vlan, and the php load disappeared. I then turned it back on and only set static mappings for the devices I do want on that vlan. I'm guessing someone had some device that was incorrectly configured that was causing this.


  • Netgate Administrator

    Hmm, interesting. Hard to see what it might have been that caused a high php load. That could have just been a symptom of course, something else actually triggering the php script.

    Steve