Mobile app version of vmapp.org
Login or Join
Pierce454

: How to find concurrent number of session per second? As a web-server hosting an application for a client, which is high-volume or transaction server, I am required to find out "number of concurrent

@Pierce454

Posted in: #ConcurrentUsers #Connections #Load #Performance

As a web-server hosting an application for a client, which is high-volume or transaction server, I am required to find out "number of concurrent connections" currently in use by the server. This is required for a solution e.g NGFW, or WAF that is based upon this metric.

Can I run some script or built-in plugin to find this number? I need solution for Apache as well as IIS.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Pierce454

1 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

What you can do is run your website on a server that you have full back-end access to (such as a dedicated server) and enter the shell and see how many times the server program is running from a system monitor program. Since I use linux, I'll explain for that OS which is what half the servers run on anyway.

option 1

I have a setup in which apache is the server and run in prefork mode which is basically one instance of the apache app (named httpd).

When the server is running, in the shell, you can use the command TOP to get a live text-based version of what apps are running as well as the CPU and memory usage of each app.

Use the > and < key to sort the values until you see a bunch of lines in which the command is httpd. That will tell you how many apache processes (httpd) are ready to serve user requests. Now look at the percentage of CPU usage next to each. For each one where the CPU percent is high, that process is used up and the next user that wants access will use the next process and so on. That is one way you can get an idea as to how many concurrent connections are being processed per second.

option 2

Figure out what port your server listens to for managing website requests. This would normally be port 80 for HTTP and I believe port 443 for HTTPS.

I cannot remember the complete command off-hand for linux, but there is one you can enter that shows you at that moment how many connections are in use

In the unix command line type:

lsof | grep TCP | grep httpd


Then you'll see all your apache processes. along with a keyword in brackets at the end of each line. LISTEN means the process is ready for a new connection and ESTABLISHED means the connection is made, and anything else... you can safely assume the process is used for a connection.

I'm not sure if any of these work as good for the other apache modes except for prefork, but this should be a starting point for you for real-time capturing of number of concurrent connections per request for information.

As for per-second, the best you can do is write a script that calls the above command then determines how many concurrent connections there are per command execution and does that a few times or so per second, and which ever count is the highest can be considered the number of connections per second.

idea for IIS

If you're looking for a solution for IIS, it may be more difficult because linux offers a-lot of unix programs specifically for managing internet and Windows is a bit behind the game. For IIS, I'd contact microsoft to see if they have some sort of command-line utility that reports the number of connections to the computer through port 80 (http) or 443 (https) and then write a script to extract the relevant information.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme