聆严 周 · Oct 13, 2022

Lisence usage suddenly spikes

Sometimes, our available license will drop and upon close inspection, it is caused by one or two users occupying 50 or so licenses, and we believe that if there were more, they were all gonna be used up. This occurs randomly. As is illustrated in the following figure.

Out cache version is 2016.1. It is serving a health care web application. Our web browsers are exclusively IE-11.

Product version: Caché 2016.1
$ZV: Cache for Windows (x86-64) 2016.2 (Build 736_0_16871U) Wed Dec 21 2016 09:38:49 EST
0 178
Discussion (6)2
Log in or sign up to continue

Normally, one user connecting from one ip address uses one license. However, if you have 25 or more simultaneous connections under one license, it starts considering each connection to be a different license. I believe this is to try to prevent people from cheating the license system.

I totally understand the reason why Intersystems control licenses like this. But here is just a humble suggestion. Please come up with a more rational algorithm. 25 per user is hardly enough for Web 2.0 or 3.0.  

And no one is trying to cheat, paying so much upfront. We're just following the practice of this era where reverse proxy, api gateways, virtualization are the norm.

Hi Mr. Zhou

As David already explained, license consumption will be increased dramatically once the threshold of 25 connections per user is exceeded. I.e, if there are 26 connections from one user account, 26 license units are used, instead of one, to handle that. 

Thus if the web application is widely used by a group of users, it might be useful to investigate why the one or two users used more than 25 connections. It may be caused by:

1. Wrong handling of web sessions from the web application. If it does not release or reuse previous sessions and keep creating new connections to the server in a short period, it may consume the license units quickly.

2. If 25 connections are not enough to handle all request. The application may need more Cache accounts to connect to the serve.

to get control over your situation you have 2 key methods:

  • $SYSTEM.License.MaxConnections() returns the maximum number of connections a user can make while consuming one license unit.
  • $SYSTEM.License.ConnectionCount() returns the number of connections currently associated with the given UserIdentifier. The range of return values is normally 0 through MAXCONNECTIONS. If the value exceeds MAXCONNECTIONS then more than the allowable number of concurrent connections were attempted for a given ID and the system has transitioned to a mode of one connection per license for this UserIdentifier.

So you have to check if your user has exhausted its available connections and block him.
It's anyhow quite interesting how these users are able to trigger so many connections.

Please keep in mind that even though the technical max connections is 25, you need to check the Terms Of Use for your arganization. Most are limited to 12 connected for one license usage.
Legally, you'd be in violation of license usage to have one source use > 12 connections.

Hint, this is also a question on the System Admin certification exam.