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

    502 Bad Gateway in Web GUI at 1500+ Captive Portal Users – Need Tuning Suggestions

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 3 Posters 28 Views 3 Watching
    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.
    • I Offline
      iamsumesh
      last edited by iamsumesh

      We are encountering a “502 Bad Gateway (nginx)” error in the Web GUI whenever the captive portal user count exceeds approximately 1,500. Under normal load conditions (below 1,000 users), the system operates without issues.

      We are able to temporarily regain access by using the “Restart PHP-FPM” option, but the same issue reoccurs after some time.

      We seek your guidance on fine-tuning the configuration to support higher loads (2,000+ users).

      Server Details:

      Version: pfSense CE 2.7.2-RELEASE (amd64)
      
      CPU: Intel® Xeon® Gold 5318Y @ 2.10GHz, 96 CPUs (2 packages × 24 cores × 2 threads), AES-NI enabled, QAT disabled
      
      RAM: 128 GB
      
      Storage: 1 TB HDD
      
      W 1 Reply Last reply Reply Quote 0
      • stephenw10S Online
        stephenw10 Netgate Administrator
        last edited by

        What do you see logged when that happens?

        Check the Monitoring Graphs for memory usage vs CP users.

        I would try bumping the PHP memory limit in Sys > Adv > Misc and see if that changes the time it takes to fail. Start by doubling it.

        That hardware is massively overpowered for almost all deployments. What throughput does/can it pass?

        I 1 Reply Last reply Reply Quote 0
        • I Offline
          iamsumesh @stephenw10
          last edited by iamsumesh

          @stephenw10 Thanks for the suggestion. Memory limit increased to 3072.
          This system has 10 Gbps.

          1 Reply Last reply Reply Quote 0
          • W Offline
            wazim4u @iamsumesh
            last edited by wazim4u

            @iamsumesh This issue is present in version 2.7 of pfSense. It seems the transition from IPFW to PF in the 2.7.x branch might be causing problems, or it may be related to the underlying operating system (FreeBSD). Even if you double the CPU and RAM, it will not work. Enabling the captive portal in 2.7.2 directed most traffic to CPU0, causing it to overload and crash the entire system.

            You could try upgrading to version 2.8.1 to see if it resolves the issue (I have not personally tested this yet). However, version 2.7.2 will not work; I have already reported this problem.

            https://forum.netgate.com/post/1151842

            1 Reply Last reply Reply Quote 0
            • stephenw10S Online
              stephenw10 Netgate Administrator
              last edited by

              This? https://redmine.pfsense.org/issues/15262

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