I searched a lot before posting this, but found no solution.
My problem is that when the piwik host is unreachable the page hangs for a long time.
For unreachable I mean that the connection does not get any packet back and timeouts.
To reproduce the issue I blocked piwik host with iptables on my client machine, making the packets to be dropped.
The problem does not happen if the piwik host replies with connection refused or other errors.
Is there any solution?