Discussion
· Aug 3, 2022

Check amount of connections left on Community Edition

I am aware that we have 5 License Units on Community Edition. But I have issues figuring out how it's working.

I have Community Edition

USER>write $system.License.KeyCustomerName()
InterSystems IRIS Community

Freshly started system, only terminal session open, so, only one license units used, and 4 left. As expected

USER>write $system.License.LUConsumed()
1
USER>write $system.License.LUAvailable()
4

Quote from documentation - $SYSTEM.License.MaxConnections() returns the maximum number of connections a user can make while consuming one license unit. 

USER>write $system.License.MaxConnections()
25

It says 25 connections, let's try using them, and start a few background jobs (Running ^Integrity as a background job this way, was not a good idea though, as it run into endless loop and took 100% of CPU)

USER>zn "%SYS" 

%SYS>for i=1:1 { Job ^Integrity::0 Quit:'$Test  write !,$ZChild } 

21694
21695
21696
21697

So, I got only 4 child processes, well, in sum we have 5 connections only, not 25 as MaxConnections says, check the License Units, stays the same

%SYS>w $system.License.LUConsumed()
1
%SYS>write $system.License.LUAvailable()
4

Looks like I have some space left, but not exactly. So, looks like this user (irisowner in case of docker, it uses system user) does not have any access, anymore

$ docker exec -it iris iris session iris
<LICENSE LIMIT EXCEEDED>

I tried, to login as another user, and wanted to switch off Operation System login

But, it did not work, I keep getting <LICENSE LIMIT EXCEEDED> error

So, I stopped one of the background jobs, so, I'll get some place for irisowner. And now I got username prompt. This is not what I would expect at all. Why is that user affect at all.

irisowner@352dab0e513d:/opt/irisapp$ iris session iris 
Node: 352dab0e513d, Instance: IRIS 

Username:

Then I decided to login as another user, for this time as _SYSTEM, and check how many background jobs I can run

%SYS>for i=1:1 { Job ^Integrity::0 Quit:'$Test  write !,$ZChild } 

%SYS>write $username
_SYSTEM

looks like, no space left, at all. we have the first session, 4 jobs with ^Integrity, -1 killed, and one more session already under _SYSTEM, so, only 5 connections again

%SYS>write $system.License.LUAvailable()
4
%SYS>w $system.License.LUConsumed()
1

License Units, keeps, saying the same, that I still have some place

 

Ok, let's try another way. We have python out of the box. Let's try it

irisowner@352dab0e513d:/opt/irisapp$ /usr/irissys/bin/irispython
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import iris
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/irissys/lib/python/iris.py", line 14, in <module>
    from pythonint import *
ImportError: IrisStart failed: IRIS_LICENSE (-20)
>>>

Nope, no way.

So, I decided to free one connection, and try python again

>>> import iris
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/irissys/lib/python/iris.py", line 14, in <module>
    from pythonint import *
ImportError: IrisStart failed: IRIS_ACCESSDENIED (-15)

That was completely unexpected again, so. I was just tried to import library, it was not supposed to fail even if no licenses left. Well, that happens because, default configuration does not permit it at all (%Service_Callin not enabled), kind of weird.

Am, I'm doing something wrong? How to get real numbers and usage from $SYSTEM.License, I found nothing close to what I would expect. License Usage keeps saying, that I have some more license units available, but, it is not so.

From what I see, that. It does not matter how many License units available, only 5 connections, no matter which user is using it will be available, and there is no way to monitor it.

%SYS>w $system.License.ConnectionCount("_SYSTEM")
0
%SYS>w $system.License.ConnectionCount("irisowner")
0
Discussion (16)4
Log in or sign up to continue

To my experience, it is a 5 CONNECTIONS limit overruling the whole licensing code.
implemented in the most restrictive way you can think of.
My bypass was to apply for a demo license (container) and non-castrated image.
It's evident to me that the Community License is just for ****** censored ******
not for adult applications.   
I feel  - not amused (brit.) - about this company. @Andreas Dieckow 
*edited*

Found one more thing. Kind of a useful new feature LOAD DATA. But why does it use external java and consumes so precious connections? So, I get issues like this.

08/03/2022 18:50:52 - INFO: Running SQL Statement: Loading file sample_file.csv:
LOAD BULK %NOJOURN DATA FROM FILE '/home/irisowner/taxi/data/sample_file.csv' INTO NYTaxi.RowRides (VendorID,tpep_pickup_datetime,tpep_dropoff_datetime,passenger_count,trip_distance,RatecodeID,store_and_fwd_flag,PULocationID,DOLocationID,payment_type,fare_amount,extra,mta_tax,tip_amount,tolls_amount,improvement_surcharge,total_amount) USING '{ "from": {"file": {"columnseparator":",", "header": true } } }'
08/03/2022 18:50:52 - INFO: Preparing Loading file sample_file.csv - OK
08/03/2022 18:51:53 - ERROR: Error executing Loading file sample_file.csv: ERROR #5023: Remote Gateway Error: Connection cannot be established
08/03/2022 18:51:53 - INFO: Finished loading NYTaxi.RowRides in 60.28s

And there one another issue, which I often see, when using external languages. The connection waits is 60 seconds, and fails, why it does not fail fast? It already knows that there are no licenses/connections left, what is the reason of wait?

Yes, I get it. I just don't get why I spend my connections on something, that I don't expect to spend. I'm too limited. How many connections, any of the processes may consume? I have no idea how to know it.

Well, yes I see, it's a Community Edition. But how I can be so sure, that the licensed version, will work another way?  There is a limit of 25 connections, and if someway, in the background it will create more connections than left, It will consume 25 license units at once, and it's exactly what I would not want to get in production. I need expected behavior. And this is not expected at all.

well, looks so, but there are no methods, which will return available connections.

Anyway, another point of my post, is that it's not enough at all. Only 5 connections and you almost have no control over usage, you can spend all connections too fast. For instance, I'm using DBeaver, and when it connects, it uses 3 workers, and utilize 3 connections. When I develop Django application, I have to be sure, to run in single thread mode, or, it will use all connections too fast. Any development in any language, will get own limits as well. And sometime, you may get some unexpected issues, like with LOAD DATA, you may think, yep, it's just a SQL query, which can be executed in your process, so, no extra connections will be used, but it's wrong. And you always should keep in mind, that you may quickly get into limit. You connected to DBveaver, have one terminal, SMP, something else, and you decided to compile your code in VSCode, nope, no place for it. You have to disconnect DBeaver or, find another way to free connections.

Community Edition: Connection and Core increase

 

The Community Edition is free, and the defined limits are making this possible. The community Edition is using the core-based license model (as opposed to a user-based license model). Core based licenses are not counting users and therefor do not enforce a maximum number of users. To maintain the free nature of the Community Edition InterSystems initially specified the following restrictions:

 

Max Number of concurrent connections:      5

Max Number of Cores:                                  8

Max Size of all databases:                            20GB (which includes system databases)

 

The Community Edition is a combination of a core-based and a single-user license. The single-user license is restricted to 5 concurrent connections.

 

InterSystems is in the process of increasing the limits to:

 

Max Number of concurrent connections:      8

Max Number of Cores:                                  20

Max Size of all databases:                            20GB (which includes system databases)

 

We will announce availability soon with 2022.2 as the target.

 

Community Edition: Licensing

 

InterSystems licenses are defined in the Terms and Conditions. The Terms and Conditions specify what the capabilities and the limitations for each license type are.

The license key applies limits of how the product can be used technically, but that is not the license (which is always defined by the Terms and Conditions). Not everything can be enforced as desired and sometimes historic reasons enforce higher values that today’s Terms and Conditions specify.

 

For regular user-based IRIS licenses, a license unit allows for multiple connections.  The technical maximum for concurrent connections per license unit is currently 25, but the Terms and Conditions set that limit to 12, which is the maximum number an application is allowed to use by default.