* netfilter/dansguardian/polipo slow
@ 2008-09-14 14:49 Doug Kehn
2008-09-16 18:27 ` Grant Taylor
0 siblings, 1 reply; 3+ messages in thread
From: Doug Kehn @ 2008-09-14 14:49 UTC (permalink / raw)
To: netfilter; +Cc: rdkehn
Hi All,
I have an AMCC PPC-440 based board running Monta Vista Linux 2.6.18, dansguardian 2.9.8.5, and polipo 1.0.4. dansguardian is used for URL and content filtering. polipo is serving as the http proxy. The iptables rule to redirect port 80 packets to dansguardian is:
iptables -t nat -A PREROUTING -d ! 192.168.2.0/255.255.255.0 -i br0 \
-p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3129
All components are functioning properly. However, web page load times are 3 to 4 times slower with this rule in place than without. I suspected the delay was with dansguardian/polipo. Then, I left the rule in place and configured the browser's http proxy settings for 192.168.2.1/3129. Page load times decreased dramatically. Packets were still traversing dansguardian/polipo as URL/content filtering rules still worked as expected. I also changed the PREROUTING policy from ACCEPT to DROP. After doing this, I could no longer browse the internet (or communicate with the board). I'm pretty sure the PREROUTING chain is being traversed; the rule is just not matching.
It appears (???) the delay is only observed when the rule matches. I tried different variants of the rule to see if writing the rule in different ways produced different results. For example,
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 \
-j REDIRECT --to-ports 3129
All rule variations resulted in the same increased page load times.
Unfortunately, updating the kernel and/or configuring the browser's http proxy settings aren't allowable options. 8( Does anyone have any information, comments suggestions, tips, or tricks?
Thanks,
...doug
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: netfilter/dansguardian/polipo slow
2008-09-14 14:49 netfilter/dansguardian/polipo slow Doug Kehn
@ 2008-09-16 18:27 ` Grant Taylor
2008-09-16 21:56 ` Brian Austin - Standard Universal
0 siblings, 1 reply; 3+ messages in thread
From: Grant Taylor @ 2008-09-16 18:27 UTC (permalink / raw)
To: Mail List - Netfilter
On 09/14/08 09:49, Doug Kehn wrote:
> I have an AMCC PPC-440 based board running Monta Vista Linux 2.6.18,
> dansguardian 2.9.8.5, and polipo 1.0.4. dansguardian is used for URL
> and content filtering. polipo is serving as the http proxy. The
> iptables rule to redirect port 80 packets to dansguardian is:
I take it that DansGuardian is talking to Polipo and clients are talking
(via redirect) to DansGuardian?
> All components are functioning properly. However, web page load
> times are 3 to 4 times slower with this rule in place than without.
> I suspected the delay was with dansguardian/polipo. Then, I left the
> rule in place and configured the browser's http proxy settings for
> 192.168.2.1/3129. Page load times decreased dramatically. Packets
> were still traversing dansguardian/polipo as URL/content filtering
> rules still worked as expected. I also changed the PREROUTING policy
> from ACCEPT to DROP. After doing this, I could no longer browse the
> internet (or communicate with the board). I'm pretty sure the
> PREROUTING chain is being traversed; the rule is just not matching.
>
> It appears (???) the delay is only observed when the rule matches. I
> tried different variants of the rule to see if writing the rule in
> different ways produced different results. For example,
>
> All rule variations resulted in the same increased page load times.
This is as I would expect. If you write the rules differently and
compare the output of iptables-save you will see the rules are
translated to the same thing in kernel.
> Unfortunately, updating the kernel and/or configuring the browser's
> http proxy settings aren't allowable options. 8( Does anyone have
> any information, comments suggestions, tips, or tricks?
Try using a different caching proxy behind DansGuardian to cache the
filtered content rather than having DansGuardian filter all content each
and every time someone requests it.
If memory recalls, DansGuardian has to talk to an upstream proxy so, you
will most likely end up with a proxy on both sides of DansGuardian, with
at least the one behind it being a caching proxy.
Grant. . . .
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: netfilter/dansguardian/polipo slow
2008-09-16 18:27 ` Grant Taylor
@ 2008-09-16 21:56 ` Brian Austin - Standard Universal
0 siblings, 0 replies; 3+ messages in thread
From: Brian Austin - Standard Universal @ 2008-09-16 21:56 UTC (permalink / raw)
To: Grant Taylor; +Cc: Mail List - Netfilter
Grant Taylor wrote:
> On 09/14/08 09:49, Doug Kehn wrote:
>> I have an AMCC PPC-440 based board running Monta Vista Linux 2.6.18,
>> dansguardian 2.9.8.5, and polipo 1.0.4. dansguardian is used for URL
>> and content filtering. polipo is serving as the http proxy. The
>> iptables rule to redirect port 80 packets to dansguardian is:
>
> I take it that DansGuardian is talking to Polipo and clients are
> talking (via redirect) to DansGuardian?
>
>> All components are functioning properly. However, web page load
>> times are 3 to 4 times slower with this rule in place than without. I
>> suspected the delay was with dansguardian/polipo. Then, I left the
>> rule in place and configured the browser's http proxy settings for
>> 192.168.2.1/3129. Page load times decreased dramatically. Packets
>> were still traversing dansguardian/polipo as URL/content filtering
>> rules still worked as expected. I also changed the PREROUTING policy
>> from ACCEPT to DROP. After doing this, I could no longer browse the
>> internet (or communicate with the board). I'm pretty sure the
>> PREROUTING chain is being traversed; the rule is just not matching.
> >
>> It appears (???) the delay is only observed when the rule matches. I
>> tried different variants of the rule to see if writing the rule in
>> different ways produced different results. For example,
>>
>> All rule variations resulted in the same increased page load times.
>
> This is as I would expect. If you write the rules differently and
> compare the output of iptables-save you will see the rules are
> translated to the same thing in kernel.
>
>> Unfortunately, updating the kernel and/or configuring the browser's
>> http proxy settings aren't allowable options. 8( Does anyone have
>> any information, comments suggestions, tips, or tricks?
>
> Try using a different caching proxy behind DansGuardian to cache the
> filtered content rather than having DansGuardian filter all content
> each and every time someone requests it.
>
> If memory recalls, DansGuardian has to talk to an upstream proxy so,
> you will most likely end up with a proxy on both sides of
> DansGuardian, with at least the one behind it being a caching proxy.
>
>
>
> Grant. . . .
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
one subtle performance hit can be dns.
client requests dns, asks proxy, proxy has to look up dns.. I fixed this
in my site by installing bind on the proxy machine, and having it as the
forwarder for the rest of the network.
probably unrelated...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-16 21:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-14 14:49 netfilter/dansguardian/polipo slow Doug Kehn
2008-09-16 18:27 ` Grant Taylor
2008-09-16 21:56 ` Brian Austin - Standard Universal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox