What's new

[How-to] Adblock Plus filters right on router

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Thanks for your reply.

I am not sure I understand your question. Could you please elaborate?


I have been searching for the max connection reached resolution for a long time you provided the argument from a forum post. None of my searching or looking over other sites that worked with Privoxy turned this up. I am just trying to find out how you were able to find the possible solution. I thought I was a good hunter of locating solutions but you win the trophy on this.
 
I have been searching for the max connection reached resolution for a long time you provided the argument from a forum post. None of my searching or looking over other sites that worked with Privoxy turned this up. I am just trying to find out how you were able to find the possible solution. I thought I was a good hunter of locating solutions but you win the trophy on this.
Really nothing special: I did a Google search for the error message.

I only hope it will fix our problem.

Please post your findings when you try on your AC87.
 
In the S24privoxy file is where the service starts. There is a line for parameters that you can add it called ARGS:

Code:
ENABLED=yes
PROCS=privoxy
ARGS=""
PREARGS=""
DESC=$PROCS

....

I finally got a change to try it, but w/o success (I am still getting the max connection reached message).

However, I was not following your instructions, since my S24privoxy file has already an entry:
Code:
#!/bin/sh

ENABLED=yes
PROCS=privoxy
ARGS="/opt/etc/privoxy/config"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

. /opt/etc/init.d/rc.func


From what I understand the parameters are stored in this config file. So I thought, I could simply add "ulimit -s 2048" to it. It now looks like this:
Code:
confdir /opt/etc/privoxy
logdir /opt/var/log
filterfile default.filter
logfile privoxy
actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
actionsfile default.action   # Main actions file
actionsfile user.action
filterfile user.filter
listen-address  0.0.0.0:3128
toggle  1
enable-remote-toggle  1
enable-remote-http-toggle  0
enable-edit-actions 1
enforce-blocks 0
buffer-limit 4096
forwarded-connect-retries  0
accept-intercepted-requests 1
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 300
socket-timeout 300
ulimit -s 2048
#permit-access  192.168.1.0/24
debug   1    # show each GET/POST/CONNECT request
debug   4096 # Startup banner and warnings
debug   8192 # Errors - *we highly recommended enabling this*
#admin-address privoxy-admin@example.com
#proxy-info-url http://www.example.com/proxy-service.html

I crossed my fingers and rebooted the router, but to no avail - still getting the error messages.

Any help, please ??
 
ulimit is a command so this is how you would change is in the S24privoxy shell script:

#!/bin/sh

ENABLED=yes
PROCS=privoxy
ARGS="/opt/etc/privoxy/config"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

ulimit -s 2048

. /opt/etc/init.d/rc.func
 
Ronv42;

I updated the file per your instructions and it seems to be working:)

I have been burned too often with this 'router stuff', so I am not breaking out the champagne just yet. However, I am carefully optimistic that we have a winner here! (I have only done some brief testing.)

Have you tried it on your AC87 yet? I am very curious what your findings are. Please let me know.

Thanks for your help.
 
Yes I did it with my AC87 and it seems to be working now. I am testing with a single browser on my surface and doing some heavy testing. If successful I will update my wpad.dat file to use the AC87 vs. the N66U and all the computers on my home network will get the update automatically.

Ronv42;

I updated the file per your instructions and it seems to be working:)

I have been burned too often with this 'router stuff', so I am not breaking out the champagne just yet. However, I am carefully optimistic that we have a winner here! (I have only done some brief testing.)

Have you tried it on your AC87 yet? I am very curious what your findings are. Please let me know.

Thanks for your help.
 
Great to hear it seems to be working for you also!

....If successful I will update my wpad.dat file to use the AC87 vs. the N66U and all the computers on my home network will get the update automatically.
As you have probably figured already by my posts, I am a bloody noobie when it comes to this 'router stuff', but I like to learn more about.
Would you mind explaining your comment above? I changed the S24privoxy file. It seems you are changing a wpad.dat file instead.


Also, what do you mean by all computers on your LAN will get the update automatically?

Thank you for your patience with me!
 
What you did is correct for the ulimit on the router for Privoxy. Don't worry about my additional comments since it is an advanced method of configuring how browsers interact with proxies. Since I work in a large enterprise I usually bring down some of the management methods to my home network.


Great to hear it seems to be working for you also!


As you have probably figured already by my posts, I am a bloody noobie when it comes to this 'router stuff', but I like to learn more about.
Would you mind explaining your comment above? I changed the S24privoxy file. It seems you are changing a wpad.dat file instead.


Also, what do you mean by all computers on your LAN will get the update automatically?

Thank you for your patience with me!
 
can this be used with ac56u? my wife has been nagging me about the youtube ads on her android s4 and I dont have time to root it, so an adblock would be great!
 
can this be used with ac56u? my wife has been nagging me about the youtube ads on her android s4 and I dont have time to root it, so an adblock would be great!

Yes, if it has the latest Merlin f/w installed (378.51)
 
Ronv42;

I updated the file per your instructions and it seems to be working:)
.....

After a few short weeks of joy, I now keep getting the"maximum number of connections reached" message quite often again.
Ronv42 or anybody else: do you experience the same issue (again)?

(PS: In the meantime I have upgraded from AC56 to a AC87.)
 
surfing net and torrent will be heavy is it ok for this, like 40 users using ?

what is this maximum number of connections reached?
 
can this be used with ac56u? my wife has been nagging me about the youtube ads on her android s4 and I dont have time to root it, so an adblock would be great!
This works without root on Android, but you do need to install ex play store on each device
http://www.zenz-solutions.de/personalhttpproxy/
Has to be setup and then configured for each wifi or mobile network, and sometimes stops working - needs restart - not sure about youtube
 
surfing net and torrent will be heavy is it ok for this, like 40 users using ?
...?

No torrent of 'heavy surfing' in my case: I have limited the traffic going through privoxy to my mobile devices only. At any given time, there shouldn't be more than 2 or 3, likely less, accessing the internet at the same time

...

what is this maximum number of connections reached?
Other than it is the error message my browser display, I have no idea. I also do not know what this "ulimit -s 2048" exactly does. I wonder if changing the number to 1024 or 4096 would help.
I hope some knowledgeable members will jump in and can provide some guidance.
 
After a few short weeks of joy, I now keep getting the"maximum number of connections reached" message quite often again.
Ronv42 or anybody else: do you experience the same issue (again)?

(PS: In the meantime I have upgraded from AC56 to a AC87.)

I have only seen this condition once since I made the configuration change. If you are on a AC87 one thing I always disable due to some compatibility issues has been NAT Acceleration. If you go into LAN and then Switch settings you can disable it there and try to see if the issues go away.
 
I have only seen this condition once since I made the configuration change. If you are on a AC87 one thing I always disable due to some compatibility issues has been NAT Acceleration. If you go into LAN and then Switch settings you can disable it there and try to see if the issues go away.

Thanks for the tip. Mine was set to Auto. I have it now disabled. Let's see how things go.
 
No torrent of 'heavy surfing' in my case: I have limited the traffic going through privoxy to my mobile devices only. At any given time, there shouldn't be more than 2 or 3, likely less, accessing the internet at the same time

Other than it is the error message my browser display, I have no idea. I also do not know what this "ulimit -s 2048" exactly does. I wonder if changing the number to 1024 or 4096 would help.
I hope some knowledgeable members will jump in and can provide some guidance.

oh sad
 
Quick update: after disabling the NAT Acceleration, I still get the "maximum number of connections reached" message. It is hard to quantify, but it feels like it does not happen as often anymore - however, it is still rather annoying.


What I had not mentioned before is that I frequently get a "Network Connection Lost" in conjunction with the max. # error message. This is when I attempt to browse to a different page. I believe this is related to the privoxy set up, as the network connection to the web is verifiably not lost (other apps on this device access the web just fine, it's only the Safari iOS browser.)
I have experienced this problem on all the devices that are run through privoxy. They are are all iOS devices.


I am not sure where to go from there yet. I may explore other ad block solutions again.

What I really like on the ad blocking solution via privoxy is that:
- it uses AdblockPlus EasyList filters. These lists have been working very well on my PCs.
- I can define a range of IP addresses, rather than mandating it for all the devices on the LAN

I have not seen these features in any other adblock approaches that I came across on this forum. Please let me know if something like this is available.
 
Quick update: after disabling the NAT Acceleration, I still get the "maximum number of connections reached" message. It is hard to quantify, but it feels like it does not happen as often anymore - however, it is still rather annoying.
Hi waffles,

I'm not sure why you think setting "ulimit -s" will fix this problem. "ulimit -s" changes the size of the system stack (so you're making it smaller!) Googling that error message suggests it's coming from privoxy and is caused by the "max-client-connections" parameter (http://www.privoxy.org/user-manual/config.html).

The obvious thing to start with would be to change the value of this parameter in the config file. The man page suggests that this can't be increased beyond the system's maximum number of file descriptors (and possibly the value set when privoxy was compiled!).

As well as max-client-connections you might have to change the number of system file descriptors with something like "ulimit -n 2048".

Good luck.

UPDATE: I've just found the link you posted earlier regarding the "ulimit -s", so now I understand why it was being suggested. I'd think it would be easy to check whether you were hitting that problem by using something like "free" or "top" to check whether all of the router's memory had been used up.
 
Last edited:
Hi Collin;

Thanks for chiming in.

I could use a bit more hand holding here, please.

...... I've just found the link you posted earlier regarding the "ulimit -s", so now I understand why it was being suggested. .....

* I am not quite clear: are you still suggesting I replace the parameter "ulimit -s 2048" with "ulimit -n 2048"?

......I'd think it would be easy to check whether you were hitting that problem by using something like "free" or "top" to check whether all of the router's memory had been used up.

* How would I do this?
(As an aside, I am not sure it is a router memory problem. Usually, if I force-close/relaunch the browser on my iOS device, the error message does not come back until a bit later.
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top