I have mobile web services written in PHP. Ant it is running on Apache Linux. Suddenly since yesterday our server became too slow. We found the reason that there are many continuous connection is coming to our server. Which is engaging bandwidth and making server slow.

We have asked hosting provider GoDaddy to restrict some country from firewall but it is not suggested by them. I have tried with htaccess but it doesnt work. What is the idle solution for this?

Recommended Answers

All 4 Replies

You need to blacklist the source of the pings in your iptables configuration files. This will block all connection attempts by those sources. Read the iptables man pages for more information.

How about a reverse proxy or a Load Balancer on ther front end with your Web server on the back end. ICMPs are easily dropped at the proxy or LB while all web traffic is simply passed internally. Thus reducing load on the Web Server

What Linux Distro are you using? There are different settings available to set connection and session timeouts. You could, say, set a timeout to 600 seconds (10 minutes) and have the countdown for each connected session restart when the users intreracts with the web service. Therefore only active users would remain connected.

In Ubuntu, for example, there is a default 30 or 60 second tcp timeout - you can use a similar configuration for closing waste connections.

Thanks all for your answers. We finally got solution from "dosarrest". Any ping on server will be first passed to dosarresr and it will only redirect valid ping to our server and all spamm ping will be aborted. Though its costly but its working like a charm. Our website is faster than before. It may help someone who is comming to this thread for their problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.