Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firewall: slow load on logs web page for empty interfaces #672

Closed
fichtner opened this issue Jan 16, 2016 · 2 comments
Closed

firewall: slow load on logs web page for empty interfaces #672

fichtner opened this issue Jan 16, 2016 · 2 comments
Assignees
Labels
bug Production bug
Milestone

Comments

@fichtner
Copy link
Member

via: https://forum.opnsense.org/index.php?topic=2010.0

@fichtner fichtner added the bug Production bug label Jan 16, 2016
@fichtner fichtner added this to the 16.1 milestone Jan 16, 2016
@fraenki
Copy link
Member

fraenki commented Jan 20, 2016

Excuse me if this is not related, but searching the firewall log is incredibly slow for me. I've collected some data:

Firewall->Log Files->Normal View
~3 seconds

Filter: Interface (i.e. WAN or LAN)
between 5 and 40 seconds (depending on the interface)

Filter: Destination IP Address (i.e. 8.8.8.8)
~110 seconds

Filter: Interface AND Destination IP Address (i.e. WAN and 8.8.8.8)
~120 seconds

Filter: Destination Port (i.e. 500)
~100 seconds

During the search my machine is mostly idle with noticable system load:

last pid: 51214;  load averages:  0.46,  0.25,  0.22                  up 26+23:25:24  15:28:53
231 processes: 6 running, 190 sleeping, 35 waiting
CPU:  8.9% user,  0.0% nice, 15.9% system,  1.8% interrupt, 73.4% idle
Mem: 36M Active, 280M Inact, 412M Wired, 856K Cache, 612M Buf, 7143M Free
Swap: 

  PID USERNAME   PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
   11 root       155 ki31     0K    64K CPU3    3 633.2H 100.00% idle{idle: cpu3}
   11 root       155 ki31     0K    64K CPU0    0 624.4H 100.00% idle{idle: cpu0}
   11 root       155 ki31     0K    64K RUN     1 632.0H  98.29% idle{idle: cpu1}
   11 root       155 ki31     0K    64K CPU2    2 630.8H  96.19% idle{idle: cpu2}
59241 root        73    0   190M 93788K CPU3    3   1:46   4.88% php-cgi
# clog /var/log/filter.log | wc -l
   37946

And gstat does show only some minor disk access. So I'm wondering why searching the logs is sooo slow.

@fichtner fichtner modified the milestones: 16.7, 16.1 Feb 4, 2016
@fichtner fichtner added the help wanted Contributor missing / timeout label Feb 4, 2016
@fichtner fichtner removed the help wanted Contributor missing / timeout label Feb 16, 2016
@fichtner fichtner self-assigned this Feb 16, 2016
@AdSchellevis
Copy link
Member

firewall log parsing is really messy here.... eventually this should be trashed in favour of something new and remove all the call loops and obscure code around it, but not today.

The slowdown in parsing for this case is very likely caused by convert_real_interface_to_friendly_descr() being called on every line.... moved it out of the loop.
At my end this is about 10 times faster on a search without results (worst case scenario).

fichtner pushed a commit that referenced this issue May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

3 participants