Real-Time Measurement and Control

Showing results for 
Search instead for 
Did you mean: 

Application Webserver crashes on SOM9651

Go to solution



I have got a problem using the application web service on SOM9651.


I can publish the webservice and run the module in stand alone application. The module works normal for 3-4 hours. Afterwards the application webserver does not response. If I try to access the webserver with a browser I will get a time out without any response. The RT-application works normal. I can access the som via WebDav, after the error occured.


I am using Labview 2016.

The Web Service communicates with the real time application by using shared variables. Since I am using the programmatical access I cannot locate an error reading and writing the variables.


Trying to increase the number of requests to crash the applicatoin webservice early did not work out. I tried to change the hardware and to reinstall the SOM951, but this did not work out. After the crash I can access the module via WebDav, in WebDav I will receive an error if I am looking for the published webservices.


I also changed the log file to level=3, without getting new information.


ErrorLog /var/local/natinst/log/ApplicationWebServer.log, backup=1, size=10K, level=3


I checked the log files error.log and applicationwebserver.log located in:



Increasing the number of workers to 20 in the Config (NIWebAppServer.conf) file did not change the behaviour.


We have some test environment to test our sofware. The testcycle repeads every 0.5 seconds. In this case it is just sending and receiving data.


CPU load is normally at 30% per core, in peaks it is up to 50%.


How can I locate the problem? 



Thank you.


kind regards



0 Kudos
Message 1 of 8

Application WebServer Config File:


# NI Web Application server configuration file.
# for Linux RT run-mode
# Global Directives
#ErrorLog /var/local/natinst/log/ApplicationWebServer.log, backup=1, size=10K, level=3
ErrorLog /var/local/natinst/log/ApplicationWebServer.log, backup=1, size=10K

LoadModulePath "/usr/local/natinst/share/NIWebServer"

LoadModule niConfModule mod_niconf
NI.Conf.DefaultsStore /etc/natinst
NI.Conf.LoadINI NIWebAppServer.ini

LoadModule niSessionManagerModule mod_nisessmgr
LoadModule niAuthModule mod_niauth
LoadModule EspModule mod_niesp
LoadModule WSRuntime mod_niws

<NI.Conf.IfAnyHost SSLEnabled>
LoadModule niSslInitModule mod_nissl
LoadModule sslModule mod_ssl


# Directives that apply to the default server
NI.ServerName "NI Application Web Server"
InactivityTimeout 60
LimitRequestBody 10000000
LimitRequestForm 10000000
LimitUrl 1024
ThreadStack 64K
# Number of connections
WorkerLimit 20

DocumentRoot /var/local/natinst/www
TypesConfig /etc/natinst/mime.types

# Pipeline Definition
SetConnector netConnector

AddHandler niAuthHandler
AddHandler WSRuntime
AddHandler fileHandler ""

AddOutputFilter chunkFilter


0 Kudos
Message 2 of 8

Attached is the API error via WebDav after crash

0 Kudos
Message 3 of 8

Errors from NIApplicationWebServerLog (Log level 3):


>>>>>>>>>> Receive content packet 64640, len 156 (conn 735) >>>>>>>>>>
GET /PPWebService/Session?Alive=TRUE HTTP/1.1
Accept: */*
Accept-Language: DE
Content-Type: text/plain
User-Agent: Labview

<<<<<<<<<< End Receive packet, conn 735
appweb: 3: Use endpoint: :8081
appweb: 3: In moduleMatch()

appweb: 3: In moduleMatch()

appweb: 3: Select route "default-*:8081" target "run"
appweb: 3: Select handler: "WSRuntime" for "/PPWebService/Session"
appweb: 3: Select output filter: "chunkFilter"
appweb: Error: No free workers. Increase ThreadLimit. (Count 20 of 20)


The execution time of the vi at the webservice is average about 50ms and even more. If i put the same vi in while loop in the real time application the execution takes about 1 ms. Why is the execution time for the application webserver much longer?




0 Kudos
Message 4 of 8
Accepted by topic author sofarocker23



The Application WebService can be attached to the executable. If the WebService is included in the executable the communication can be done via global Variables. 


If the Application WebService is used as stand alone application the communication to real-time can be done using SVE. For some reason the execution of access to SVE is much slower then in real-time environment. 


For communication with RT application, it is better to include the WebService in the RtExe.


0 Kudos
Message 5 of 8

Hello, I have a very similar problem. My cRIO is fine for several hours or days and eventually I get the "No free workers" error and the Web Server stops replying. I'm requesting data from the Web Server every second and the VI that is getting called has multiple Network Shared Variables. 

My Web Server is included in my RT executable. If I understand your solution correctly, it looks like you solved the problem by getting rid of Network Shared Variables in your Web Server and using Global Variables instead. Is this correct?

Please let me know. Any help you can provide is very much appreciated!

0 Kudos
Message 6 of 8



The problem was solved by including the webserver into the real time application.


General there is the possibility to execute the webserver as standalone application or to include the webserver in your real time application. 


If the webserver is included, there is no need for shared variables, you can use global vars instead. The webserver was a lot more stable, than the standalone webserver. The included webserver is more difficult to debug.


Check the properties for your real-time application to include the web server.



0 Kudos
Message 7 of 8

Thanks sofarocker. My Web Server was already included in the executable and I was experiencing the same issue you described.


My Web Server VIs use NSVs and I was wondering if during your troubleshooting you had a scenario where your Web Server was included in your executable, you still had NSVs in your VIs, and you were still seeing the issue. The reason I ask is because, for me, the issue does not occur for several days and I was hoping not to have to wait weeks to know if the issue was resolved.


Please let me know, thank you in advance!

0 Kudos
Message 8 of 8