Project

General

Profile

Actions

Bug #3932

closed

Captive portal with greater than 9000 permanent MAC addresses causes timeout in loading CP

Added by Jeremy Porter over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Captive Portal
Target version:
-
Start date:
10/13/2014
Due date:
01/05/2015
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
All
Affected Architecture:
All

Description

When using captive portal, with all users become permanently learned after enough users have authenticated the system will run out of memory attempting to parse the config.xml.
Attempting to make changes to the config becomes impossible as the php process will crash.

Storing mac addresses in a sqlite database, will prevent the parsing from running out of memory.

Actions #1

Updated by Chris Buechler over 9 years ago

  • Target version changed from 2.2 to 2.3
  • Affected Version changed from 2.1.x to All

How big are the resulting configs there? I'm not running PHP out of memory after throwing 9000 randomly-generated MACs in the passthrough list. Though the config is pretty bare outside the MAC list, it's a total of a bit under 500 KB config file. My <descr> fields are all blank, that might be enough to push it over the edge.

During boot, it sits there during boot at "Starting captive portal..." for roughly 15 minutes on an older i7 CPU VM.

Definitely more than we're going to get into for 2.2 given it's an extraordinarily rare edge case, will take some effort to fix, and we're too short on time.

I only tried on 2.2, haven't done any testing on previous releases.

Actions #2

Updated by Jim Thompson over 9 years ago

  • Assignee set to Ermal Luçi
  • Priority changed from Low to Normal
  • Target version changed from 2.3 to 2.2

Ermal suggests that if /cf/conf/use_xmlreader exists, that a faster parser will be used in 2.2.

Please re-test. Ermal will also look at speeding up loading of passthrough MACs.

Target set back to 2.2

Actions #3

Updated by Ermal Luçi over 9 years ago

The loading should be faster.

Actions #4

Updated by Chris Buechler over 9 years ago

  • Status changed from New to Confirmed

I committed a change last night to shorten the <descr> text, which helps slightly, but still nothing works at 9000 MAC passthrough entries.

With an updated test case where the <descr> is filled out with the same text used on a real system with auto-add MAC passthrough, this fails pretty miserably. That takes the config up from about 500K to just over 1 MB. CP fails to start, after waiting for 15 minutes at "Starting zone" and failing with:

Maximum execution time of 900 seconds exceeded in /etc/inc/captiveportal.inc on line 1448

It fails the same way whether or not use_xmlreader is set.

Everything other than CP continues to work very well, and even management of CP works well. The huge table of MACs on services_captiveportal_mac.php fully loads in under 10 seconds.

Given time constraints on 2.2, and the high risk of introducing breakage when doing major performance improvements, we're not going to be able to make vast improvements here in 2.2. A work around for the one system where this is an issue is probably our best near-term bet. Adding a cron job to trim the list of the oldest entries and keep it to X length should work around.

I'll discuss options here with Ermal.

Actions #5

Updated by Jim Thompson over 9 years ago

Could we try what Jeremy asked for?

Actions #6

Updated by Chris Buechler over 9 years ago

  • Subject changed from Captive portal with greater than 9000 permanent MAC addresses causes out of memory when loading config.xml to Captive portal with greater than 9000 permanent MAC addresses causes timeout in loading CP
  • Target version changed from 2.2 to 2.2.1

2.2 doesn't run out of memory doing this, so the problem as it existed in earlier versions is gone (probably with the switch to php-fpm). It's just so slow in some part of the processing that it hits the 15 minute time limit on execution. It's not in the config parsing portion though, it'd be more or less equally slow with any back end. We'll review in more detail post-2.2, in the mean time we can get them a script to trim the list.

Actions #7

Updated by Jim Thompson over 9 years ago

  • Due date set to 01/05/2015
  • Target version changed from 2.2.1 to 2.2

Target version set back to 2.2.

The issue is that it's slow.

I made an assignment yesterday. I'm restoring it now.

Actions #8

Updated by Jim Thompson over 9 years ago

  • Target version changed from 2.2 to 2.2.1
Actions #9

Updated by Ermal Luçi over 9 years ago

  • Status changed from Confirmed to Feedback

I pushed some fixes related to this that impacted even 2.2
Normally on a capable machine for this it should be ok.

The only problem might be the max execution timeout which can be controlled differently.

Actions #10

Updated by Ermal Luçi over 9 years ago

  • Target version changed from 2.2.1 to 2.2

This should be resolved properly now.

Actions #11

Updated by Jim Thompson over 9 years ago

  • Target version changed from 2.2 to 2.2.1
Actions #12

Updated by Chris Buechler about 9 years ago

  • Target version changed from 2.2.1 to 2.2.2
Actions #13

Updated by Chris Buechler about 9 years ago

  • Target version changed from 2.2.2 to 2.2.3
Actions #14

Updated by Chris Buechler almost 9 years ago

  • Target version changed from 2.2.3 to 2.3
Actions #15

Updated by Jim Thompson over 8 years ago

  • Assignee changed from Ermal Luçi to Matthew Smith

reassigned to mgsmith.

Actions #16

Updated by Jim Thompson over 8 years ago

bump

as much as I dislike cRaptive portals, this needs to be fixed.

Actions #17

Updated by Jim Thompson over 8 years ago

  • Status changed from Feedback to Assigned
Actions #18

Updated by Jim Thompson about 8 years ago

  • Assignee changed from Matthew Smith to Renato Botelho
  • Target version changed from 2.3 to 2.4.0
Actions #19

Updated by Renato Botelho over 6 years ago

  • Target version changed from 2.4.0 to 2.4.1

It really needs to be re-engineered

Actions #20

Updated by Jim Pingle over 6 years ago

  • Target version changed from 2.4.1 to 2.4.2
Actions #21

Updated by Jim Pingle over 6 years ago

  • Target version changed from 2.4.2 to 2.4.3
Actions #22

Updated by Anonymous about 6 years ago

  • Status changed from Assigned to Closed

It is unreasonable to keep kicking this down the road to target_version++ Closing and recording it for future consideration.

Actions #23

Updated by Jim Pingle about 6 years ago

  • Target version deleted (2.4.3)
Actions

Also available in: Atom PDF