Number of concurrent users

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is there a reliable way to place a 'number of concurrent users' limit in
vb.net applications?

Thanks

Regards
 
On the database side or the app side. IMHO, if it's database, then the
answer is probably no. Not without a lot of work that would be scetchy at
best.

As far as the app, then it depends on the deployment.

There are many ways to limit it on a server depending on if it's a web
service, ASP.NET app or desktop. Let me know which and I can be of more
help.

Cheers,

BIll
 
desktop. thanks.

Regards

William Ryan said:
On the database side or the app side. IMHO, if it's database, then the
answer is probably no. Not without a lot of work that would be scetchy at
best.

As far as the app, then it depends on the deployment.

There are many ways to limit it on a server depending on if it's a web
service, ASP.NET app or desktop. Let me know which and I can be of more
help.

Cheers,

BIll
 
If you are using a server based database then there are ways to do this. You
would need to set the client name within the database connection string and
then enumerate the number of connections from the database with the
specified client name.

Alternatively, if you are connecting to a shared server, you could install a
service process on the server that your client can connect to to determine
the number of active users at any given time but you would need to be sure
to be able to catch when clients dissapear without announcing departure -
such as switching off a computer without a proper close of the program.

Another option is to control the number of software installations that can
be made but this will not work if you are looking to control concurrent
users rather than total users.

Can you elaborate on the configuration for your software?
 
This is not that hard to do in either the application or the server (at
least with SQL Server).
On the server, get into SQL Enterprise Manager and right click on the
selected server icon in the explorer window on the left. Choose
Properties|Connections. Set the maximum number of concurrent user
connections here. 0 = no limit (but it's really limited by the number of
licenses if you've installed SQL Server using this licensing scheme).
On the client, you can do a SELECT on master..SysProcesses. This table
keeps track of every running process. You'll find lots of columns there to
check including "program_name" or "hostname" "nt_username" and others that
can be counted up for instances of your application running.

hth
--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Bill:

If you set maximum connections at the server level, won't that place a limit
on concurrent connections for everything that's running on the server?

I didn't think of the sysprocesses before, I had attempted a similar method
with sp_who2 but that turned out the be the wrong approach (or I just
couldn't figure it out). I'm guessing that if you query on this by
program_name and them check for positive CPU usage, that means a live
connection?

Anyway, you've given me some cool things to think about...gotta go give it a
try.

Thanks again,

Bill
 
Right--everything that gets connected would be limited. It's a great way to
test your "server too busy" exception handling routines. ;)
Good luck.

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top