cancel
Showing results for 
Search instead for 
Did you mean: 

DI-server session ID is in use

lars_jnsson
Active Participant
0 Kudos

Hi all!

In a web solution, we have now skipped using DI-api since there are too many crashes in the DI-api.

After switching to use DI-server instead, our web services now runs much better.

* But sometimes we are getting an error in the connection: Session ID is in use. This happens maybe once a day.

* Sometimes the DI-server "goes insane": returns error complaining about the message being sent, but there is nothing wrong with the message. After restarting DI-server service it works again. Now we are restarting the service every 24 hours.

How does the session mechanism work in DI-server? Why am I getting the session id is in use?

This is how I interact with DI-server:

* at startup of webservice I make a login connection and receives a session id. This session id is then used in all calls to DI-server, except:

* when DI-server returns "Invalid session ID" I make a new connection and stores the new session id for use in the subsequent calls

In DI-server configuration I haven't changed the default values of MinDataConnections (2) and MaxDataConnections (100).

In IIS I have setup the application pool to have max 1 worker process. It would be interesting to increase this number to get a higher throughput.

B1 version is 8.82 PL10.

Regards

Lars

Accepted Solutions (1)

Accepted Solutions (1)

maik_delly
Active Contributor
0 Kudos

Hi Lars,

the error "Session ID is in use" normally means that this Session ID is used for a transaction in progress. Apart from that lately there were some issues with DI Server which are fixed in current patchlevels ( db locks resulting in DIS crash, memory leaks ...  not sure for 8.82 ).

In general your approach to get a global Session ID is working but in my experience it is better to get a Session ID for every transaction / chain of transactions. In your case I would strongly suggest to do so because web usually means concurrent actions -> resulting in your error.

Configuration you usually don't need to touch. IIS app pool you can leave with 1 worker process - this is in my experience good enough for a heavy usage environment.

regards,

Maik

lars_jnsson
Active Participant
0 Kudos

Hi Maik!

Thanks for your reply.

You confirm my suspision about the session id. Yes, I'll try with a new session for each atomic operation. That was actually what we did with the DI-API. I just thought that we could gain some performance by reusing the session. But you're right, it must be two concurrent calls that causes this error.

Do you know what the settings Min/Max/DataConnections mean? Is it concurrent connections?

Does each connection require a separate license? How does this correlate to the number of CPUs on the server (they require one license per core)?

Regards

Lars

(experienced in DI-API and UI-API but newbe in DI-Server)

maik_delly
Active Contributor
0 Kudos

Hi Lars,

from SDK Help :

MaxDataConnections. Determines the maximum concurrent connections (default: 100).

MinDataConnections. Determines the minimum concurrent connections (default: 2).

You don't need a license per connection - but per CPU that you want to use. This actually means that an highend server with a lot of CPUs ( cores ) also needs a lot of DIS licenses.

I don't know your requirement / usage scenario but in my experience 1 or 2 licenses or good enough also for heavy usage ( 40+ user creating all marketing documents through DIS + all warehouse transactions ).

The getting of SessionID  ( login / logout ) is really no perfomance killer - but make sure to logout ( I recall every session needs ~40 mb memory ).

regards,

Maik

lars_jnsson
Active Participant
0 Kudos

Hello Maik, thanks for your response!

I reward you with a correct answer for this.

Regards

Lars

Answers (0)