Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    CP enabled = CPU usage goes to 100% and seemingly beyond with

    Scheduled Pinned Locked Moved Captive Portal
    18 Posts 7 Posters 7.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Justinw
      last edited by

      The box this is currently on is using snapshot 12/28/2006, its running freeradius and captive portal sends its request to freeradius.  At first everything works fine, the login page appears, the username and password is entered, and valid users pass and are redirected to the indicated page.  After CP has been running about 5 min, and has 8-10 processes going, CPU usage goes through the roof.  The machine it runs on is a 1.5 AMD Duron CPU w/ 256 M ram.  I wonder if I need a tougher box, if there is an error in the code, or if I have misconfigured my CP.  Maximum concurrent connections is currently set to 2, any suggestions would be greatly appreciated!

      1 Reply Last reply Reply Quote 0
      • S
        sullrich
        last edited by

        What process goes to 100%?

        1 Reply Last reply Reply Quote 0
        • J
          Justinw
          last edited by

          This is the last reading from top before it died:

          last pid:  3238;  load averages:  1.11,  0.97,  0.46    up 0+00:04:34  10:49:10
          47 processes:  1 running, 46 sleeping
          CPU states: 19.2% user,  0.0% nice, 18.8% system,  1.5% interrupt, 60.5% idle
          Mem: 31M Active, 4088K Inact, 30M Wired, 676K Cache, 25M Buf, 113M Free
          Swap: 1024M Total, 13M Used, 1011M Free, 1% Inuse

          PID USERNAME  THR PRI NICE  SIZE    RES STATE    TIME  WCPU COMMAND
          3236 root        1  -8    0 21324K 17384K piperd  0:00 29.00% php
            926 proxy      1  4    0 15052K  9600K kqread  0:02  0.00% squid
            605 root        1  4    0  3568K  1736K kqread  0:01  0.00% lighttpd
            946 proxy      1  -4    0  1736K  680K msgwai  0:00  0.00% diskd-daemon
            932 proxy      1  -8    0  1256K  364K piperd  0:00  0.00% unlinkd
          1784 root        1  96    0  2432K  1452K RUN      0:00  0.00% top
          1209 root        1 116  20  3244K  1592K select  0:00  0.00% radiusd
          1584 root        1  96    0  5744K  2288K select  0:00  0.00% sshd
            545 nobody      1  96    0  1408K  532K select  0:00  0.00% dnsmasq
            727 dhcpd      1  96    0  2460K  1104K select  0:00  0.00% dhcpd
            165 root        1  96    0  1440K  600K select  0:00  0.00% syslogd
          1115 root        1  8  20  1740K  600K wait    0:00  0.00% sh
            820 _ntp        1  96    0  1340K  624K select  0:00  0.00% ntpd
            515 root        1  8    0 13172K    0K wait    0:00  0.00% <php>533 root        1  8    0 13172K    0K wait    0:00  0.00% <php>934 root        1  8  20  1272K  408K nanslp  0:00  0.00% check_reload_st
            959 root        1  8    0  1712K    0K wait    0:00  0.00%</php></php>

          And in the gui under system CPU usage shows as 100% to the wall, but when I turn off captive protal the problem goes away.

          1 Reply Last reply Reply Quote 0
          • S
            sullrich
            last edited by

            Wait until it happens again then get a top reading.  This reading shows nothing wrong:

            60.5% idle

            1 Reply Last reply Reply Quote 0
            • J
              Justinw
              last edited by

              Still hasn't crashed since the last post, there are often 10-15 users hitting it though, and I do have an ip address on the pass through ip in both directions, it is so they can follow a link to a sign up page where there information is entered and checked against a master database.    I don't know that th I'm running top right now though, I'll give you the reading when it crashes again

              1 Reply Last reply Reply Quote 0
              • J
                Justinw
                last edited by

                This is the latest, this time it didnt' kill my ssh session, but it won't respond to additionall ssh or web gui requests, it looks like something is causing the swap partition to overflow, 856M used isn't what I would call normal anyways…

                last pid: 39981;  load averages:  0.20,  2.09,  2.40      up 0+01:57:48  12:50:25
                206 processes: 103 running, 93 sleeping, 6 zombie, 4 lock
                CPU states:  1.9% user,  0.0% nice,  2.6% system,  0.7% interrupt, 94.8% idle
                Mem: 123M Active, 16M Inact, 40M Wired, 448K Cache, 28M Buf, 564K Free
                Swap: 1024M Total, 856M Used, 168M Free, 83% Inuse, 600K In, 700K Out

                PID USERNAME PRI NICE  SIZE    RES STATE    TIME    CPU COMMAND

                I tried doing a control c to break the top session and gain access to the command line again, it worked but its about a full minute delay for the commands I type to appear on the screen.  My best guess is the swap is the problem, but I'm not sure what about the captive portal is filling it up,  I did see that before it crashed a whole bunch of php commands were executed and the res state changed after about 2 sec to pfault.  I tried and garner more information on the next run w/ it.

                Update: before I rebooted the box, I got a ps -A off and here is what I got (deleted several entries that are irrevalant from the top to shorten the post):

                14088  ??  RL    0:15.10 /usr/local/sbin/lighttpd -f /var/etc/lighty-CaptivePort
                39303  ??  S      0:00.39 /usr/local/bin/php -f /etc/rc.prunecaptiveportal
                39505  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39521  ??  Z      0:00.54 <defunct>39542  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                39557  ??  RL    0:00.48 /usr/local/bin/php /usr/local/captiveportal/index.php
                39572  ??  I      0:00.00 cron: running job (cron)
                39578  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                39600  ??  RL    0:00.53 /usr/local/bin/php /usr/local/captiveportal/index.php
                39601  ??  RL    0:00.53 /usr/local/bin/php /usr/local/captiveportal/index.php
                39611  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                39617  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                39634  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                39635  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                39640  ??  RL    0:00.49 /usr/local/bin/php /usr/local/captiveportal/index.php
                39644  ??  I      0:00.50 /usr/local/bin/php -f /etc/rc.banner
                39645  ??  I      0:00.01 grep WAN
                39652  ??  RL    0:00.49 /usr/local/bin/php /usr/local/captiveportal/index.php
                39655  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                39669  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                39671  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                39673  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39677  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                39678  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                39689  ??  Z      0:00.52 <defunct>39692  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                39695  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39703  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39709  ??  RL    0:00.44 /usr/local/bin/php /usr/local/captiveportal/index.php
                39713  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39718  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                39723  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39731  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39734  ??  RL    0:00.48 /usr/local/bin/php /usr/local/captiveportal/index.php
                39736  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39738  ??  I      0:00.00 cron: running job (cron)
                39739  ??  I      0:00.00 cron: running job (cron)
                39740  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                39741  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                39745  ??  S      0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39746  ??  RL    0:00.48 /usr/local/bin/php /usr/local/captiveportal/index.php
                39747  ??  IWN    0:00.00 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                39748  ??  RL    0:00.47 /usr/local/bin/php /usr/local/captiveportal/index.php
                39749  ??  RL    0:00.49 /usr/local/bin/php /usr/local/captiveportal/index.php
                39750  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                39751  ??  IN    0:00.01 /bin/sh /etc/ping_hosts.sh
                39752  ??  RL    0:00.44 /usr/local/bin/php /usr/local/captiveportal/index.php
                39753  ??  RL    0:00.44 /usr/local/bin/php /usr/local/captiveportal/index.php
                39754  ??  S      0:00.46 /usr/local/bin/php /usr/local/captiveportal/index.php
                39756  ??  RL    0:00.41 /usr/local/bin/php /usr/local/captiveportal/index.php
                39759  ??  RL    0:00.36 /usr/local/bin/php /usr/local/captiveportal/index.php
                39761  ??  DL    0:00.32 /usr/local/bin/php /usr/local/captiveportal/index.php
                39765  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                39771  ??  RL    0:00.37 /usr/local/bin/php /usr/local/captiveportal/index.php
                39775  ??  RNL    0:00.01 awk { print $1 }
                39787  ??  RL    0:00.31 /usr/local/bin/php /usr/local/captiveportal/index.php
                39789  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                39790  ??  RL    0:00.45 /usr/local/bin/php -f /etc/rc.banner
                39791  ??  I      0:00.01 grep WAN
                39794  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                39800  ??  IWN    0:00.00 /bin/sh /etc/ping_hosts.sh
                39805  ??  L      0:00.40 /usr/local/bin/php /usr/local/captiveportal/index.php
                39809  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                39811  ??  RL    0:00.43 /usr/local/bin/php /usr/local/captiveportal/index.php
                39816  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                39818  ??  I      0:00.00 cron: running job (cron)
                39819  ??  I      0:00.00 cron: running job (cron)
                39820  ??  RNL    0:00.03 /bin/ps awwux
                39821  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                39823  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                39824  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                39825  ??  RL    0:00.26 /usr/local/bin/php /usr/local/captiveportal/index.php
                39826  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                39828  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                39829  ??  RNL    0:00.01 grep ping_hosts.sh
                39830  ??  IN    0:00.01 grep -v grep
                39831  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                39833  ??  IN    0:00.00 wc -l
                39845  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                39847  ??  RL    0:00.40 /usr/local/bin/php /usr/local/captiveportal/index.php
                39849  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                39852  ??  RL    0:00.21 /usr/local/bin/php /usr/local/captiveportal/index.php
                39854  ??  IN    0:00.01 /bin/sh /etc/ping_hosts.sh
                39855  ??  RL    0:00.33 /usr/local/bin/php /usr/local/captiveportal/index.php
                39858  ??  RL    0:00.19 /usr/local/bin/php /usr/local/captiveportal/index.php
                39861  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                39863  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                39864  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                39868  ??  RL    0:00.26 /usr/local/bin/php -f /etc/rc.banner
                39869  ??  I      0:00.01 grep WAN
                39882  ??  RL    0:00.28 /usr/local/bin/php /usr/local/captiveportal/index.php
                39886  ??  I      0:00.00 cron: running job (cron)
                39887  ??  I      0:00.00 cron: running job (cron)
                39889  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                39891  ??  IWN    0:00.00 /bin/sh /etc/ping_hosts.sh
                39892  ??  RL    0:00.18 /usr/local/bin/php /usr/local/captiveportal/index.php
                39894  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                39897  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39902  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                39903  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                39904  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39908  ??  RL    0:00.15 /usr/local/bin/php /usr/local/captiveportal/index.php
                39909  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39912  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39913  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                39916  ??  RNL    0:00.01 grep -v grep
                39918  ??  IN    0:00.00 wc -l
                39919  ??  RL    0:00.21 /usr/local/bin/php /usr/local/captiveportal/index.php
                39920  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39924  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39927  ??  RL    0:00.13 /usr/local/bin/php /usr/local/captiveportal/index.php
                39928  ??  RL    0:00.15 /usr/local/bin/php /usr/local/captiveportal/index.php
                39931  ??  IN    0:00.01 /bin/sh /etc/ping_hosts.sh
                39936  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                39949  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                39952  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                39954  ??  RNL    0:00.01 sh -c echo sleeping > /tmp/check_reload_status
                39957  ??  L      0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                39968  ??  RL    0:00.15 /usr/local/bin/php /usr/local/captiveportal/index.php
                39969  ??  RNL    0:00.00 /bin/sh /var/db/rrd/updaterrd.sh
                39974  ??  RL    0:00.09 /usr/local/bin/php /usr/local/captiveportal/index.php
                39978  ??  I      0:00.00 cron: running job (cron)
                39979  ??  I      0:00.00 cron: running job (cron)
                39984  ??  RL    0:00.10 /usr/local/bin/php -f /etc/rc.banner
                39985  ??  I      0:00.01 grep WAN
                39986  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                39987  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                39988  ??  RL    0:00.08 /usr/local/bin/php /usr/local/captiveportal/index.php
                40002  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                40004  ??  RLs    0:00.01 /usr/sbin/sshd -R
                40005  ??  IWN    0:00.00 /bin/sh /etc/ping_hosts.sh
                40006  ??  RNL    0:00.01 /bin/sh /etc/ping_hosts.sh
                40007  ??  RNL    0:00.00 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                40008  ??  RLs    0:00.01 /usr/sbin/sshd -R
                40009  ??  RLs    0:00.01 /usr/sbin/sshd -R
                40010  ??  RLs    0:00.01 /usr/sbin/sshd -R
                40012  ??  RLs    0:00.01 /usr/sbin/sshd -R
                40013  ??  RNL    0:00.00 /usr/local/sbin/check_reload_status
                40014  ??  IW    0:00.00 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                40015  ??  RNL    0:00.00 /bin/ps awwux
                40016  ??  RL    0:00.01 ps awux
                40017  ??  DL    0:00.00 grep squid -D
                40018  ??  DL    0:00.00 grep -v grep
                40019  ??  RNL    0:00.00 /bin/sh /etc/ping_hosts.sh
                40020  ??  RNL    0:00.00 /bin/sh /etc/ping_hosts.sh
                40021  ??  I      0:00.00 wc -l
                40022  ??  RL    0:00.01 sh -c /sbin/ping -c 1 -t 1 192.168.104.178 > /dev/null
                40023  ??  RL    0:00.00 sh -c /sbin/ifconfig -l
                40024  ??  RNL    0:00.00 wc -l
                40025  ??  RL    0:00.00 awk { print $1 }
                40027  ??  LLs    0:00.00 sshd: [accepted] (sshd)
                40028  ??  RL    0:00.00 sh -c /sbin/ipfw -T list 10022 2>/dev/null
                40029  ??  RL    0:00.01 /usr/local/bin/php -f /etc/rc.banner
                40030  ??  D      0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                40031  ??  RL    0:00.00 sshd: [accepted] (sshd)
                40032  ??  RL    0:00.00 sshd: [accepted] (sshd)
                40033  ??  RL    0:00.00 /usr/sbin/sshd
                40034  ??  R      0:00.00 /usr/local/sbin/lighttpd -f /var/etc/lighty-CaptivePort
                40035  ??  RL    0:00.00 /usr/sbin/sshd
                1005  v0  IWs    0:00.00 login [pam] (login)
                1007  v0  IW    0:00.00 -sh (sh)
                1009  v0  IW+    0:00.00 /bin/sh /etc/rc.initial
                  211 con- IW    0:00.00 dhclient: vr0 [priv] (dhclient)
                  291 con- S      0:00.26 /usr/sbin/tcpdump -l -n -e -ttt -i pflog0
                  292 con- S      0:00.08 logger -t pf -p local0.info
                  795 con- SW    0:00.00 ntpd: ntp engine (ntpd)
                  909 con- I      0:00.17 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                  932 con- IWN    0:00.00 /usr/local/sbin/check_reload_status
                  938 con- IWN    0:00.00 /usr/local/sbin/check_reload_status
                3591  p0  IWs    0:00.00 -sh (sh)
                3592  p0  IW    0:00.00 /bin/sh /etc/rc.initial
                3607  p0  IW+    0:00.00 /usr/local/bin/bash
                7565  p1  IWs    0:00.00 -sh (sh)
                7567  p1  IW    0:00.00 /bin/sh /etc/rc.initial
                7585  p1  IW    0:00.00 /usr/local/bin/bash
                40026  p1  R+    0:00.01 ps -A
                16411  p2  IWs    0:00.00 -sh (sh)
                16412  p2  IW+    0:00.00 /bin/sh /etc/rc.initial
                39876  p2  RL+    0:00.26 /usr/local/bin/php -f /etc/rc.banner</defunct></defunct>

                So that is what is filling up the swap, why so many are starting, I'm not sure, shouldn't that be prevented by the max connections? 
                Is there possibly something wrong with the index.php that is causing it to spam itself a billion times?

                1 Reply Last reply Reply Quote 0
                • J
                  Justinw
                  last edited by

                  Here is the code that I gave to the server for the login page via the gui:

                  
                  <title>Sign In Page</title>
                  
                  **OnNetNow Sign-In**
                  
                  <form method="post" action="$PORTAL_ACTION$">
                  
                  | 
                  
                  |     
                  
                  ### Sign In
                  
                               |               
                  
                             |
                  | 
                  	<label for="auth_user">**UserName**</label> 
                  
                  	<label for="auth_pass">**Password**</label>  	
                  
                                       | 
                  
                  #### Instructions:
                  
                  This page allows for user authentication for web services. Please enter the 
                  		username and password from the sign-up process, then click "continue" to login.
                  
                  [Sign up here](http://signupageaddress.net:8000/?location=44 "Sign-up Now!") if you have not already done so.
                  
                  Problems? 
                  
                  Call us
                  
                   |
                  
                         |
                  
                    © 2007, [Author](http://whateverpage.net "Contact the extremly suave author"), All Rights Reserved.
                  
                  </form>
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • S
                    sullrich
                    last edited by

                    @Justinw:

                    This is the latest, this time it didnt' kill my ssh session, but it won't respond to additionall ssh or web gui requests, it looks like something is causing the swap partition to overflow, 856M used isn't what I would call normal anyways…

                    last pid: 39981;  load averages:  0.20,  2.09,  2.40      up 0+01:57:48  12:50:25
                    206 processes: 103 running, 93 sleeping, 6 zombie, 4 lock
                    CPU states:  1.9% user,  0.0% nice,  2.6% system,  0.7% interrupt, 94.8% idle
                    Mem: 123M Active, 16M Inact, 40M Wired, 448K Cache, 28M Buf, 564K Free
                    Swap: 1024M Total, 856M Used, 168M Free, 83% Inuse, 600K In, 700K Out

                    PID USERNAME PRI NICE  SIZE    RES STATE    TIME    CPU COMMAND

                    I tried doing a control c to break the top session and gain access to the command line again, it worked but its about a full minute delay for the commands I type to appear on the screen.  My best guess is the swap is the problem, but I'm not sure what about the captive portal is filling it up,  I did see that before it crashed a whole bunch of php commands were executed and the res state changed after about 2 sec to pfault.  I tried and garner more information on the next run w/ it.

                    Update: before I rebooted the box, I got a ps -A off and here is what I got (deleted several entries that are irrevalant from the top to shorten the post):

                    14088  ??  RL    0:15.10 /usr/local/sbin/lighttpd -f /var/etc/lighty-CaptivePort
                    39303  ??  S      0:00.39 /usr/local/bin/php -f /etc/rc.prunecaptiveportal
                    39505  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39521  ??  Z      0:00.54 <defunct>39542  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39557  ??  RL    0:00.48 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39572  ??  I      0:00.00 cron: running job (cron)
                    39578  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                    39600  ??  RL    0:00.53 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39601  ??  RL    0:00.53 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39611  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39617  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                    39634  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39635  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39640  ??  RL    0:00.49 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39644  ??  I      0:00.50 /usr/local/bin/php -f /etc/rc.banner
                    39645  ??  I      0:00.01 grep WAN
                    39652  ??  RL    0:00.49 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39655  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39669  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39671  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39673  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39677  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39678  ??  RL    0:00.52 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39689  ??  Z      0:00.52 <defunct>39692  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39695  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39703  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39709  ??  RL    0:00.44 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39713  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39718  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39723  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39731  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39734  ??  RL    0:00.48 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39736  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39738  ??  I      0:00.00 cron: running job (cron)
                    39739  ??  I      0:00.00 cron: running job (cron)
                    39740  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                    39741  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                    39745  ??  S      0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39746  ??  RL    0:00.48 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39747  ??  IWN    0:00.00 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                    39748  ??  RL    0:00.47 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39749  ??  RL    0:00.49 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39750  ??  RL    0:00.50 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39751  ??  IN    0:00.01 /bin/sh /etc/ping_hosts.sh
                    39752  ??  RL    0:00.44 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39753  ??  RL    0:00.44 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39754  ??  S      0:00.46 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39756  ??  RL    0:00.41 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39759  ??  RL    0:00.36 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39761  ??  DL    0:00.32 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39765  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                    39771  ??  RL    0:00.37 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39775  ??  RNL    0:00.01 awk { print $1 }
                    39787  ??  RL    0:00.31 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39789  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39790  ??  RL    0:00.45 /usr/local/bin/php -f /etc/rc.banner
                    39791  ??  I      0:00.01 grep WAN
                    39794  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39800  ??  IWN    0:00.00 /bin/sh /etc/ping_hosts.sh
                    39805  ??  L      0:00.40 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39809  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39811  ??  RL    0:00.43 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39816  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39818  ??  I      0:00.00 cron: running job (cron)
                    39819  ??  I      0:00.00 cron: running job (cron)
                    39820  ??  RNL    0:00.03 /bin/ps awwux
                    39821  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39823  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39824  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39825  ??  RL    0:00.26 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39826  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                    39828  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                    39829  ??  RNL    0:00.01 grep ping_hosts.sh
                    39830  ??  IN    0:00.01 grep -v grep
                    39831  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39833  ??  IN    0:00.00 wc -l
                    39845  ??  RL    0:00.29 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39847  ??  RL    0:00.40 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39849  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                    39852  ??  RL    0:00.21 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39854  ??  IN    0:00.01 /bin/sh /etc/ping_hosts.sh
                    39855  ??  RL    0:00.33 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39858  ??  RL    0:00.19 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39861  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39863  ??  RL    0:00.30 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39864  ??  RL    0:00.27 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39868  ??  RL    0:00.26 /usr/local/bin/php -f /etc/rc.banner
                    39869  ??  I      0:00.01 grep WAN
                    39882  ??  RL    0:00.28 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39886  ??  I      0:00.00 cron: running job (cron)
                    39887  ??  I      0:00.00 cron: running job (cron)
                    39889  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39891  ??  IWN    0:00.00 /bin/sh /etc/ping_hosts.sh
                    39892  ??  RL    0:00.18 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39894  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39897  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39902  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                    39903  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                    39904  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39908  ??  RL    0:00.15 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39909  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39912  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39913  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39916  ??  RNL    0:00.01 grep -v grep
                    39918  ??  IN    0:00.00 wc -l
                    39919  ??  RL    0:00.21 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39920  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39924  ??  RL    0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39927  ??  RL    0:00.13 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39928  ??  RL    0:00.15 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39931  ??  IN    0:00.01 /bin/sh /etc/ping_hosts.sh
                    39936  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                    39949  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39952  ??  RL    0:00.17 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39954  ??  RNL    0:00.01 sh -c echo sleeping > /tmp/check_reload_status
                    39957  ??  L      0:00.16 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39968  ??  RL    0:00.15 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39969  ??  RNL    0:00.00 /bin/sh /var/db/rrd/updaterrd.sh
                    39974  ??  RL    0:00.09 /usr/local/bin/php /usr/local/captiveportal/index.php
                    39978  ??  I      0:00.00 cron: running job (cron)
                    39979  ??  I      0:00.00 cron: running job (cron)
                    39984  ??  RL    0:00.10 /usr/local/bin/php -f /etc/rc.banner
                    39985  ??  I      0:00.01 grep WAN
                    39986  ??  IWs    0:00.00 /bin/sh -c /usr/bin/getRadiusLists.sh
                    39987  ??  IWs    0:00.00 /bin/sh -c  /usr/bin/nice -n20 /etc/ping_hosts.sh
                    39988  ??  RL    0:00.08 /usr/local/bin/php /usr/local/captiveportal/index.php
                    40002  ??  IW    0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                    40004  ??  RLs    0:00.01 /usr/sbin/sshd -R
                    40005  ??  IWN    0:00.00 /bin/sh /etc/ping_hosts.sh
                    40006  ??  RNL    0:00.01 /bin/sh /etc/ping_hosts.sh
                    40007  ??  RNL    0:00.00 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                    40008  ??  RLs    0:00.01 /usr/sbin/sshd -R
                    40009  ??  RLs    0:00.01 /usr/sbin/sshd -R
                    40010  ??  RLs    0:00.01 /usr/sbin/sshd -R
                    40012  ??  RLs    0:00.01 /usr/sbin/sshd -R
                    40013  ??  RNL    0:00.00 /usr/local/sbin/check_reload_status
                    40014  ??  IW    0:00.00 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                    40015  ??  RNL    0:00.00 /bin/ps awwux
                    40016  ??  RL    0:00.01 ps awux
                    40017  ??  DL    0:00.00 grep squid -D
                    40018  ??  DL    0:00.00 grep -v grep
                    40019  ??  RNL    0:00.00 /bin/sh /etc/ping_hosts.sh
                    40020  ??  RNL    0:00.00 /bin/sh /etc/ping_hosts.sh
                    40021  ??  I      0:00.00 wc -l
                    40022  ??  RL    0:00.01 sh -c /sbin/ping -c 1 -t 1 192.168.104.178 > /dev/null
                    40023  ??  RL    0:00.00 sh -c /sbin/ifconfig -l
                    40024  ??  RNL    0:00.00 wc -l
                    40025  ??  RL    0:00.00 awk { print $1 }
                    40027  ??  LLs    0:00.00 sshd: [accepted] (sshd)
                    40028  ??  RL    0:00.00 sh -c /sbin/ipfw -T list 10022 2>/dev/null
                    40029  ??  RL    0:00.01 /usr/local/bin/php -f /etc/rc.banner
                    40030  ??  D      0:00.00 /bin/sh /usr/bin/getRadiusLists.sh
                    40031  ??  RL    0:00.00 sshd: [accepted] (sshd)
                    40032  ??  RL    0:00.00 sshd: [accepted] (sshd)
                    40033  ??  RL    0:00.00 /usr/sbin/sshd
                    40034  ??  R      0:00.00 /usr/local/sbin/lighttpd -f /var/etc/lighty-CaptivePort
                    40035  ??  RL    0:00.00 /usr/sbin/sshd
                    1005  v0  IWs    0:00.00 login [pam] (login)
                    1007  v0  IW    0:00.00 -sh (sh)
                    1009  v0  IW+    0:00.00 /bin/sh /etc/rc.initial
                      211 con- IW    0:00.00 dhclient: vr0 [priv] (dhclient)
                      291 con- S      0:00.26 /usr/sbin/tcpdump -l -n -e -ttt -i pflog0
                      292 con- S      0:00.08 logger -t pf -p local0.info
                      795 con- SW    0:00.00 ntpd: ntp engine (ntpd)
                      909 con- I      0:00.17 sh /usr/local/etc/rc.d/proxy_monitor.sh start
                      932 con- IWN    0:00.00 /usr/local/sbin/check_reload_status
                      938 con- IWN    0:00.00 /usr/local/sbin/check_reload_status
                    3591  p0  IWs    0:00.00 -sh (sh)
                    3592  p0  IW    0:00.00 /bin/sh /etc/rc.initial
                    3607  p0  IW+    0:00.00 /usr/local/bin/bash
                    7565  p1  IWs    0:00.00 -sh (sh)
                    7567  p1  IW    0:00.00 /bin/sh /etc/rc.initial
                    7585  p1  IW    0:00.00 /usr/local/bin/bash
                    40026  p1  R+    0:00.01 ps -A
                    16411  p2  IWs    0:00.00 -sh (sh)
                    16412  p2  IW+    0:00.00 /bin/sh /etc/rc.initial
                    39876  p2  RL+    0:00.26 /usr/local/bin/php -f /etc/rc.banner</defunct></defunct>

                    So that is what is filling up the swap, why so many are starting, I'm not sure, shouldn't that be prevented by the max connections? 
                    Is there possibly something wrong with the index.php that is causing it to spam itself a billion times?

                    Something is pounding your CP with new sessions… May want to locate the client in question.  Either that or limit the maximum connections per client further.

                    1 Reply Last reply Reply Quote 0
                    • I
                      Infected
                      last edited by

                      I had just the same problem some time ago. The solution was to close down Captive portal. After that CPU usage returned back to normal. (5-10%). The box was a firewall for a lan party with about 110 attendants. i can't post any info about the processes since the box is not online anymore but I had the same problem as Justinw.
                      Everything was deadly slow and there were loads of these "39542  ??  RL    0:00.51 /usr/local/bin/php /usr/local/captiveportal/index.php" php processes.
                      The cpu usage also went 100%

                      Edit: The version I am using is 1.0.1

                      1 Reply Last reply Reply Quote 0
                      • J
                        jeroen234
                        last edited by

                        1.0.1 is old use a snapshot like 06-02-2007

                        1 Reply Last reply Reply Quote 0
                        • J
                          Justinw
                          last edited by

                          When I made this post, the snapshot I was using was only 1-2 days old, I haven't been able to try it with more recent snapshots, but should be able to soon, let you know then what happens.

                          1 Reply Last reply Reply Quote 0
                          • D
                            doush
                            last edited by

                            Same problem occurs on a WRAP box when capitive portal is enabled on the OPT1 wireless interface without using RADIUS only the local user manager.

                            1 Reply Last reply Reply Quote 0
                            • H
                              hoba
                              last edited by

                              Anybody please test with the latest snapshot. Fastcgi was enabled for the CP webserver wich should speed things up.

                              1 Reply Last reply Reply Quote 0
                              • J
                                Justinw
                                last edited by

                                I've tested it, I also added an additional 512 ram to the server as well.  The usage still hits 100, but it hasn't crashed the server yet, and watching top, the 100% times are just spikes, not holding steady anymore.  No more than 5 requests or so get lined up in top before they all get cleared out.  Still pretty intense but seems to be working better. Thanks for the fix

                                1 Reply Last reply Reply Quote 0
                                • J
                                  Justinw
                                  last edited by

                                  Sullrich mentioned in the past also that he runs a setup with 5,000 users using the CP.  I'm running a lot less users (about 10-15 times less).  Anyone else that could advise on hardware specs for 250-500 users with a cp would be helpful.  Right now it may be somewhat skimpy 1.5 ghz duron with 768 ram. The CPU is pegged with 3-4 users hitting the CP.  Right now max concurrent connections is actually set to 1.  If I understand right this means a single user can only open 1 thread, and the max is open at once is either 4 or 16, not sure which?    If there are ways to optimize the portal that would be helpful to know about as well.  Thanks in advance.

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    simba5140
                                    last edited by

                                    I am having the same issue with a 3G Pentium with 2G of memory and 2G swap space. I have not had issues with the CP until today. CPU was 100% and swap space was totally consumed and the the system completely locked. After reboot the system would work for approximately 5 minutes and then reinitiate the same process. After man frustrating recycles, I disable CP completely. Any assistance will be greatly appreciated.

                                    Thanks,

                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      hoba
                                      last edited by

                                      Any abnormal traffic coming in through the CP enabled interface that is flooding the CP page? Also what does top report when it starts to freak out?

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        sullrich
                                        last edited by

                                        Also check the state tables.  How many states are active to the captive portal.

                                        I have found a lot of environments that have viruses and such that are making outbound port 80 connections that end up getting sent to the captive portal.  What this does is overwhelm the machine due to the amount of requests a second that some viruses attempt.

                                        If you find that clients are making too many requests a second limit the client connection count in the Captive Portal settings screen.

                                        1 Reply Last reply Reply Quote 0
                                        • First post
                                          Last post
                                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.