0

I want to know how many connections there are active to my site wich is on a shared hosting account.

The hosting provider is using cPanel and I can access it through ssh.

The problem is if I run the command:

netstat -tuna | wc -l

It returns a wild 2555 connection count, but when I go to google analytics and access the real time section, there are only 15-20 users active.

My question is are those 2555 connections to my site, or to the server as a whole regardless the user I am using to run the command. (I don't have root access).

  • Well if you look at the output of `netstat -tuna` (without wc -l) you'll see that it displays all active TCP (-t) and UDP (-u) sockets - even the ones which are listening (-a). Google analytics of course shows only the incoming HTTP-connections (only TCP ports 80 or 443). – vstm Dec 09 '14 at 09:18

1 Answers1

3

Your netstat command is showing the all connection of your server NOT only Apache connection, If you want to check only Apache connection. You will have to user following command.

netstat -anp |grep 80 |wc -l

But with the above command you will get total numbers of Apache connection. Your site is hosted on shared server and due to that you can not check your site connection.

To check our site connection your will have to assign dedicated IP to your site and use that IP in above command to check your site Apache connection

netstat -anp |grep 80 |grep 1.1.1.1 | wc -l

Thanks

24x7servermanagement
  • 2,520
  • 1
  • 13
  • 11