Solved

find out how many users are connected to a front end server

Posted on 2013-11-05
15
1,052 Views
Last Modified: 2013-11-26
is it possible to find out how many users are on each of my 4 front end servers?
i have four front end servers conencted to a sql back end server
the front end servers are on a load balancer.
however i cant tell exactly how many users are on each server
the front end servers provide a web front end for our portal through iis
i need to be able to find out if users are spread evenly over all servers
0
Comment
Question by:dougdog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
  • +2
15 Comments
 
LVL 8

Expert Comment

by:virtuadept
ID: 39624511
You could look at sysprocesses and group by hostname:

select hostname, count(*) 
from sys.sysprocesses
group by hostname

Open in new window


And that will tell you how many connections to the database you have per machine. That may not equal number of users depending on your your application is coded but it should still probably be roughly what you want.
0
 
LVL 6

Assisted Solution

by:RaithZ
RaithZ earned 250 total points
ID: 39624516
You can monitor active connections by using performance counters on each box.  See this link:

https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/86afd5ee-e183-4a5a-91fd-cf795289c34f.mspx?mfr=true
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 39624519
You can also use windows performance monitor to gather the counters. In performance monitor you can add the counter under web service/current connections.

http://stackoverflow.com/questions/567076/how-to-view-current-users-with-performance-monitor
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 8

Expert Comment

by:virtuadept
ID: 39624531
I should add that hostname in sysprocesses is provided by the client in the connection string and can be altered programatically so in some cases that may not actually be the host computer name.
0
 

Author Comment

by:dougdog
ID: 39624621
is this a batch file script

select hostname, count(*)
from sys.sysprocesses
group by hostname
0
 
LVL 8

Expert Comment

by:virtuadept
ID: 39624639
That is a SQL query for the database server. You could do it in a batch file I guess, if you use OSQL or SQLCMD command line clients for SQL. I am assuming we're talking about Microsoft SQL here. The other performance monitoring tools that others mentioned may work out better for you.
0
 

Author Comment

by:dougdog
ID: 39624719
not sure this is giving accurate results
seems very low numbers
0
 
LVL 6

Expert Comment

by:RaithZ
ID: 39624741
The SQL connection counts may not reflect the number of web users since the application may re-use existing connections for queries.  You would be better off checking it at the web servers itself rather than the database.
0
 

Author Comment

by:dougdog
ID: 39624758
the web current connections seems very low also
0
 

Author Comment

by:dougdog
ID: 39624761
the max count is 24 we have 100s using this app
0
 
LVL 1

Expert Comment

by:SsbMs
ID: 39624786
This script pulls Microsoft Lync 2010 connection information, such as the number of connections per Front End Server and number of unique users

http://blogs.technet.com/b/nexthop/archive/2011/03/22/scriptconnections.aspx

Good Luck..
0
 
LVL 8

Accepted Solution

by:
virtuadept earned 250 total points
ID: 39624790
If the web app is sharing connections to the database then the SQL query will not tell you how many users you have (that is what I was trying to hint in my first post that depending on how the app is coded, it may not be individual users). However, it should tell you roughly if load balancing is working or not, which was your question I thought. If you're not seeing any db connections from some of the web servers then you know they aren't getting users. If you need to know exact number of active users then you need to use the link provided above by RaithZ to set up connection monitoring on IIS on each of the web servers.
0
 
LVL 6

Expert Comment

by:RaithZ
ID: 39625510
Depending on the app also, your users may not be "connected" the entire time the app is being used, but only connect when the app needs to submit to request information.  Many web applications run in the browser and only connect back to the web server every so often.  Again this depends on how the application was coded or is made.
0
 

Author Comment

by:dougdog
ID: 39626668
does the lync scripts require powershell
cani run this on 2003
0
 
LVL 8

Expert Comment

by:virtuadept
ID: 39630247
I was thinking another approach for this, if you have control and source for the application, or if it already has a feature like this, is to log to a table on the database when users connect to the application, and then depending on how long the average user session is, you could get a pretty good estimate of how many are on using the connection log. And in your log, hostname should be one of the things logged, so you can group by hostname when getting counts. If the users have to perform some kind of log off or have some system enforced auto-log-out timer, that makes this a lot easier so you know for sure if they have not logged out yet that they are still an active. And obviously you need to write to the table when log out happens as well as log ins.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
move expression web site to a new server 13 109
How can i point a subdomain to directory? 5 44
Finding the IIS version 5 54
AD account Auto logoff 1 58
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question