We noticed startup times of PacketFence got worse lately in large
environments.

Without having real time to investigate the issue (and it is _that_ bad
since you don't really need to restart in the middle of the day). My
instinct was: "it must be the inline mode and our regexp processing in
pf::util's parse_templates, this thing is replacing strings in larger
files lately.

When optimizing performance instinct is bad. I knew that.

I ran a profiler (the awesome Devel::NYTProf) on a service restart in
our lab (far from a large setup). Guess what is the top 3?

- 8s: 2s sleep between each process (to make sure it really died)
- 4.5s: start the daemons
- 4.16s: SQL queries related to violations.conf (including generating
triggers table)

8 seconds of sleep, really? We'll get to that for sure.

4.5s starting daemons, it's true we've been adding more and more daemons
under PacketFence's management lately..

4s building violations and triggers.. it's time to move the whole thing
out of flat files into the database.

But getting back to large environments, seeing the #2, I realize that
it's probably what got way slower... Remember bug #1363 anyone?

#1363: DHCPd slow startup
http://www.packetfence.org/bugs/view.php?id=1363

"Seen in inline mode when there's huge lease files (a lot of devices).
PacketFence can take up to 3 minutes to start due to the slow start up
of dhcpd."

Remembering this I decided to log the daemon startup time by default:
https://github.com/inverse-inc/packetfence/commit/d46055624745e1932b9b64d10d057fc4b22fe9fd

So we'll have good data from the slow-to-start environments soon.

Conclusion: instead of fixing regexp performance like I would've without
profiling we're now focused on several _real problems_. Like Knuth
famously said: "We should forget about small efficiencies, say about 97%
of the time: premature optimization is the root of all evil"

p.s.: oh and we might provide our own dhcpd package w/o the performance
problems in our repo pretty soon ;)
-- 
Olivier Bilodeau
obilod...@inverse.ca  ::  +1.514.447.4918 *115  ::  www.inverse.ca
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence
(www.packetfence.org)

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Packetfence-devel mailing list
Packetfence-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-devel

Reply via email to