How to implement floating licenses in ASP.NET?

What would be a good way to limit your ASP.NET web application to serving only a certain number of concurrent users?

Some requirements:

  • The application requires a login (no need to worry about anonymous users).
  • Support for multiple servers (farm / load balancing).
  • The active user can be considered the same as the active session (not signed or not expired).
  • Additional logins should be deprived if the maximum number of concurrent users has been reached.
  • Accountability is needed (administrators should be able to see which of the active users).
  • Minimum overhead for each web request (especially avoiding costly trips to the database for each request).
  • The total number of concurrent users must be supported correctly, even if the web server freezes, disconnects from the network, or must be restarted.
  • Additional servers are available for host services (for example, application servers).
+5
source share
2 answers

You can use a global variable (static) and connect the logic to the Application_OnStart, Application_BeginRequest or Page_Load events. Take a look at this in more detail: http://dotnetperls.com/global-variables-aspnet

+2
source

To limit the number of concurrent users you must use,

<system.web>
      <applicationPool maxConcurrentRequestsPerCPU="12" maxConcurrentThreadsPerCPU="0" requestQueueLimit="5000"/>
</system.web>

http://blogs.msdn.com/b/rakkimk/archive/2009/07/08/iis7-improving-asp-net-performance-concurrent-requests-while-on-integrated-mode.aspx

0

All Articles