mercredi 28 février 2018

Is there a limit to the resources allocated to child processes in windows?

I've programmed an asp.net application for displaying data from a manufacturing machine in real time in client browsers on a LAN. It relies on a separate C# web socket server application that continuously fetches data from the machine and sends it the client browser. When a client connects, the web socket application spawns a child process to serve the client. Each child process uses a separate port to communicate with its client. Each spawned process has two threads, one for listening for the disconnect message from the browser and another which executes in an infinite loop, constantly polling the manufacturing machine for data and sending it to the client as often as it can. All servers run on a windows 10 PC.

I've noticed that the rate at which data is displayed slows down with increasing numbers of clients. This effect was more pronounced with an earlier version of the web socket server that spawned threads instead of processes to serve the clients (which is why I changed it to use processes instead). When I look at the web socket server processes in Task Manager, I notice that their network utilization goes down with more clients (from 0.9 Mbps with one client to 0.7 Mbps with two), although their memory usage stays the same.

I suspect the problem is some limitation on the resources allocated to child processes spawned from the same parent. The reason I believe this is that when I start up separate web socket server instances manually (instead of having them spawned by a process) and then connect clients to them there is no slow down. I would like to know why the slowdown is occurring, and if there is a way to fix it.




Aucun commentaire:

Enregistrer un commentaire