Why "Too many open files" error is occurred while opening a webpage with polipo installed on OS X 10.11.4?
This is a quick fix answer. If you know which configurations caused this problem please post your answer 

I didn't find out why this error occurs, but I solve the problem every time this error appears by running this command:

$ brew services restart polipo
Stopping `polipo`... (might take a while)
==&gt; Successfully stopped `polipo` (label: homebrew.mxcl.polipo)
==&gt; Successfully started `polipo` (label: homebrew.mxcl.polipo)


After restarting polipo instance, that error disappears.

NOTE: This command should be executed OUT of a tmux session. In a tmux session it will not work:

$ brew services restart polipo
~/Library/LaunchAgents/homebrew.mxcl.polipo.plist: Operation not permitted
==&gt; Successfully started `polipo` (label: homebrew.mxcl.polipo)


If you are running such a session, detach the session with control+b (or any prefix key combination you set) and then press d. Now run that command.

THE BEST ALTERNATIVE: I used reattach-to-user-namespace to restart polipo service directly from tmux session:

$ brew install reattach-to-user-namespace


then brew services will work.

UPDATE: I found that my local polipo cache size is enough large:

$ du -d0 -h /usr/local/var/cache/polipo
13.8G    /usr/local/var/cache/polipo


There is a "purge" function that is explained here:


  The behavior of the -x flag is controlled by three configuration variables. The variable diskCacheUnlinkTime specifies the time during which an on-disk entry should remain unused before it is eligible for removal; it defaults to 32 days.


So I stopped polipo daemon with brew services:

$ brew services stop polipo
$ polipo -x
$ brew services start polipo


Now the size of local cache is reduced:

$ du -d0 -h /usr/local/var/cache/polipo
2.1G    /usr/local/var/cache/polipo


And it seems that the error is gone.