https://redmine.pfsense.org/https://redmine.pfsense.org/favicon.ico?16780521162021-07-29T11:58:30ZpfSense bugtrackerpfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=552932021-07-29T11:58:30ZJim Pingle
<ul><li><strong>Assignee</strong> set to <i>Jim Pingle</i></li><li><strong>Target version</strong> set to <i>2.6.0</i></li><li><strong>Plus Target Version</strong> set to <i>21.09</i></li></ul><p>A quick look at the code tells me this is likely the same root cause as what is making the IPsec status and apply process slow, which I'm in the middle of fixing already. I'll take a look at this when I finish up what I'm doing with IPsec.</p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=553342021-07-30T14:40:10ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Feedback</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="Cache gw status for rules. Fixes #12174 Don't fetch a new gateway status for every rule. Fetch i..." href="https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/87011dce1fe88ad48c098d6b6804add53cf64084">87011dce1fe88ad48c098d6b6804add53cf64084</a>.</p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=553772021-08-02T14:39:18Zlufte grof
<ul><li><strong>File</strong> <a href="/attachments/3791">guiconfig.inc_02AUG2021.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3791/guiconfig.inc_02AUG2021.patch">guiconfig.inc_02AUG2021.patch</a> added</li><li><strong>File</strong> <a href="/attachments/3794">firewall_rules.php_02AUG2021.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3794/firewall_rules.php_02AUG2021.patch">firewall_rules.php_02AUG2021.patch</a> added</li></ul><p>Jim Pingle wrote in <a href="#note-2">#note-2</a>:</p>
<blockquote>
<p>Applied in changeset <a class="changeset" title="Cache gw status for rules. Fixes #12174 Don't fetch a new gateway status for every rule. Fetch i..." href="https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/87011dce1fe88ad48c098d6b6804add53cf64084">87011dce1fe88ad48c098d6b6804add53cf64084</a>.</p>
</blockquote>
<p>Hi, Jim. Appreciate the quick turnaround. Unfortunately, that patch still didn't get the page load times down to a usable level.</p>
<p>For testing I used an interface consisting of a set of 75 rules, 49 of which have gateways defined.</p>
<ul>
<li>v21.05 time to load was ~37 seconds.</li>
</ul>
<ul>
<li>changeset 87011dce1fe88ad48c098d6b6804add53cf64084 time to load was ~21 seconds.</li>
</ul>
<ul>
<li>I cobbled together a patch that gets the same page to load in ~3 seconds.</li>
</ul>
<p>I'm only just learning how you've got the code organized, so there is bound to be something about this that doesn't conform to your standards. Though, is there anything inherently wrong with this approach (attached)?</p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=553782021-08-02T14:49:10ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>In Progress</i></li></ul><p>The main problems with that are:</p>
<ul>
<li>You're moving too much of that logic onto the page and out of the include file. Could maybe be split into two functions in guiconfig.inc, but it should stay in there one way or another</li>
<li>You've lost a bit of validation to ensure things like the gateways in the config are actually defined/are an array. Not every configuration has a gateway config and the "after" code here is making some faulty assumptions</li>
</ul>
<p>Either way, this should be submitted as a PR on github which allows for much better collaboration: <a class="external" href="https://docs.netgate.com/pfsense/en/latest/development/pull-request.html">https://docs.netgate.com/pfsense/en/latest/development/pull-request.html</a></p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=553862021-08-02T17:01:38Zlufte grof
<ul></ul><p>Ok, I'll work on a PR.</p>
<p>I took what you said and applied it. My latest doesn't touch guiconfig.inc. Instead, firewall_rules.php keeps an array of gateway popup content for each encountered gateway, and only calls the gateway_info_popup() function the first time it encounters each unique gateway. And, it's even faster.</p>
<p>But I'll work on that PR and submit it there.</p>
<p>Thanks.</p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=553902021-08-02T18:29:50Zlufte grof
<ul></ul><p><a class="external" href="https://github.com/pfsense/pfsense/pull/4535">https://github.com/pfsense/pfsense/pull/4535</a></p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=554122021-08-04T07:53:21ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Pull Request Review</i></li></ul> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=555782021-08-10T09:01:54ZRenato Botelhorenato@netgate.com
<ul><li><strong>Status</strong> changed from <i>Pull Request Review</i> to <i>Feedback</i></li></ul><p>PR has been merged. Thanks!</p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=560322021-08-26T12:02:41ZJim Pingle
<ul><li><strong>Subject</strong> changed from <i>firewall_rules.php is slow to load</i> to <i>Firewall rule tabs load slowly when many rules on the tab utilize gateways</i></li></ul><p>Updating subject for release notes.</p> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=569952021-10-27T11:58:20ZJim Pingle
<ul><li><strong>Plus Target Version</strong> changed from <i>21.09</i> to <i>22.01</i></li></ul> pfSense - Bug #12174: Firewall rule tabs load slowly when many rules on the tab utilize gatewayshttps://redmine.pfsense.org/issues/12174?journal_id=585792022-01-25T12:31:19ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li></ul><p>This seems to be working fine here.</p>