Lucas,

Log that you provided spans from March 19th 09:35 to March 20th 14:43.

Depending on moments when application was unavailable you need to look in different records of csp.log

For example,

1) Exception caught in f:csp: c0000005:4600
c0000005 is the code for an access violation.

I would advise to you to try installing latest release version of CSP Gateway, or if this error still appears there, contact InterSystems Worldwide Response Center to fix this error.

2) CSP application closed the connection before sending a complete response

This is most likely something with the code of the page "/csp/erp/system/lib/filtro.csp". It started to write some answer back and then closed the connection, for example process terminated itself with halt

3) Configuration Error: Insufficient space in the configuration buffer
Configuration block Size: 126397; Size of configuration block to insert: 55114; Space available: 68611 (Consider setting CONFIG_BUFFER_SIZE=112K (or higher) in the [SYSTEM] section of CSP.ini)

This message is self-explanatory

4) Failed to connect to 'csp' - Reason: -8 (Server busy: Gateway's configured limits exceeded) (No Retry)

CSP Gateway can limit number of total connections to server and connections per session that it makes to Caché. See parameters "Maximum Server Connections" and "Maximum Connections per Session" here.

Generally for IIS-specifics read section "Microsoft IIS All Versions" of CSP Gateway configuration guide. And for general configuration of CSP Gateway -- chapter "CSP Gateway Operation and Configuration".

Quoting doc: "Name indirection, argument indirection, and XECUTE commands that appear within a procedure are not executed within the scope of the procedure."

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

Consider method:

Class Test.test [ Abstract ]
{

ClassMethod ind()
{
    kill info

    set active = 1
    set i="active"
    set @i = "global scope"
    break
}

}

Output:

USER>do ##class(Test.test).ind()

 break }
 ^
<BREAK>zind+5^Test.test.1
USER 2d1>w

active="global scope"
<Private variables>
active=1
i="active"

Notice private variables and public variables.

I'm getting following error, running your program on Caché 2017.2.2:

USER>do ^test
This FTP server is anonymous only.

And it works OK once I change Connect to be anonymous:

If 'ftp.Connect(host,"anonymous","",port) Write ftp.ReturnMessage,! Quit sc

Output:

USER>do ^test
Ftp server messsage:
Features:
 EPRT
 EPSV
 MDTM
 PASV
 REST STREAM
 SIZE
 TVFS
End
Mode now: Binary
Length of file received: 524288

Can you connect to speedtest.tele2.net from the same server, but not from Caché? Maybe access via port 21 is blocked by your firewall?

a) I think no, performance will not improve if you have nine SQLGateways.

SQLGateway ODBC connection is established in each process.

So each separate Caché process has each own connection to the SQLServer.

b) As to the SQLGateway performance. I think first thing you need to check is how SQLServer itself handles these nine queries being run simultaneusly. If it's fast, and slow only via SQLGateway connection, then it makes sense to look into if something can be configured on SQLGateway / Caché side.

Tuan,

$.TotalSteps seem to work OK in curl:

C:\utl>curl -i -X POST -H "Content-Type: application/json" http://localhost:52774/api/docdb/v1/USER/db/TestDB
HTTP/1.1 201 Created
...

{"content":{"Name":"TestDB","Class":"ISC.DM.TestDB","properties":[{"Name":"%%OID","Type":"%Library.RawString"},{"Name":"%Concurrency","Type":"%Library.RawString"},{"Name":"%Doc","Type":"%Library.DynamicAbstractObject"},{"Name":"%DocumentId","Type":"%Library.Integer"},{"Name":"%LastModified","Type":"%Library.UTC"}]}}


C:\utl>curl -i -X POST -H "Content-Type: application/json" http://localhost:52774/api/docdb/v1/USER/prop/TestDB/TotalSteps?type=%Integer&path=$.TotalSteps
HTTP/1.1 201 Created
...

{"content":{"Name":"TotalSteps","Type":"%Library.Integer"}}

What error do you get?

No, it's not safe to use %NOLOCK on INSERT query.

Doc says following:

%NOLOCK ... should only be used when a single user/process is updating the database. 

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

If you use INSERT with %NOLOCK, then some other process might UPDATE partially inserted row.

Rows inserted as follows:
a) Save inserted row (fill Data global)
b) File index values for inserted row (fill Index global)

Imagine there are two parallel processes A and B. A inserts row with %NOLOCK. B updates the same row without %NOLOCK.

t1) A saves row, filling Data global
t2) B updates the same row, overwriting the value in Data global
t3) B fills Index global with values corresponding to new data of row
t4) A fills Index global with values corresponding to old data of row (as of Insert time)

Now you have row in the table with wrong indices.

Also, please notice that if there is inheritance in classes -- E.g. Sample.Employee inherits from Sample.Person. Then storing row in Data global is at least two SETs, so you might end up with corrupted row, not only wrong index. Also filing index records is not atomic. Each index record is separate SET.

So, I would not recommend to use %NOLOCK. There is one possible use case for %NOLOCK -- bulk-loading data, but there should be only one process accessing the data while loading.

Daniel,

in the guide https://community.intersystems.com/post/k-means-clustering-iris-dataset Niyaz connects to the InterSystems IRIS using user 'dev' and password '123'. Did you change that to user/password that exists on your system?

Access Denied error usually means incorrect credentials or lack of required privileges.

You can try to enable Audit in IRIS (Management Portal -> System Administration -> Security -> Auditing). Then enable LoginFailure and Protect events (Auditing -> Configure System Events).

Then reproduce the error and check audit (Auditing -> View Audit Database). If LoginFailure or Protect events appeared -- click on Details, they might give some hints of why you are getting "Access Denied".