Polling and FreeBSD

In a default pfSense configuration, any time a NIC needs attention, it generates an interrupt. In some instances, rather than having to deal with heavy interrupt load, alternative methods improve performance. An alternative to interrupt-driven operation in FreeBSD is using device polling. This stops interrupts from being generated and polls the devices a set number of times per second. This value is kern.hz, which is 1000 by default on pfSense full installations, with 100 as the default on embedded and any hardware automatically detected as VMware.

The general consensus in the FreeBSD community used to be that polling is faster, and performance testing proved this. This comes from back in the FreeBSD 4.x days. It’s still ingrained in a lot of BSD people’s heads as being faster, but that’s just not true anymore for firewall scenarios. Polling in FreeBSD 5.x through -CURRENT all have some serious issues in firewall deployments. It always drastically lowers network throughput on pfSense and all other FreeBSD 5.x, 6.x, and -CURRENT systems.

The only reason I would suggest using polling at this time is if your hardware runs at its maximum capacity frequently, because an overloaded pfSense install is completely unresponsive on all management interfaces – the console, SSH, and webGUI. The better solution is to size your hardware adequately for the amount of throughput you require, and don’t push your hardware past its capacity.

Share this Post:

6 Responses to “Polling and FreeBSD”

  1. Anders Says:

    Have you also done some testes with jump frames / MTU ?

  2. Chris Buechler Says:

    I assume you mean jumbo frames. No, I have not had a chance to test with jumbo frames yet, though I plan to do so in the future. That’s not applicable to the vast majority of our installs, so it’s not a high priority for me right now.

  3. dalex Says:

    While speed for internet is still adequate, it’s becoming a problem with WIFI. Imagine all 6 (30 Mbit/s capable) links from my home’s roof asking ftp from the server down. The server is capable of supplying the load, but the pfsense router will choke! This is with plain routing, no NAT.

  4. Chris Buechler Says:

    6 * 30 Mb is only 180 Mb, a Pentium III can handle that kind of load with good NIC’s, and have power to spare. Routing only is measurably faster than without NAT.

    If you’re choking at 180 Mb, not using polling, and using good NIC’s (Intel preferred, and definitely not something like Realtek) your hardware is undersized.

  5. Erwin Says:

    Is this also true in 2013 for an Alix wrapboard? I am running the latest Pfsense (2.0.3) and I am seeing a lot of CPU power being used for device polling, however trying to disable device polling resulted in a unresponsive firewall.

  6. Chris Buechler Says:

    At this time, polling is not recommended at all.

Please don’t post technical questions or off-topic comments. It is far more likely that your questions and concerns will be addressed effectively through one of our support channels.

Leave a Reply