Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assign priorities to incoming mdsip connections #2790

Open
vadim-at-te opened this issue Jun 12, 2024 · 1 comment
Open

assign priorities to incoming mdsip connections #2790

vadim-at-te opened this issue Jun 12, 2024 · 1 comment
Labels
feature Indicates new feature requests or implementations tool/mdsip Relates to one of the MDSplus over IP tools (mdsipd, mdsipsd, mdsip_server)

Comments

@vadim-at-te
Copy link

Affiliation
Tokamak Energy, 173 Brook Dr, Milton, Abingdon, UK

Description
We experience a serious problem where, due to a relative large traffic of mdsip clients trying to connect to MDSplus server, some connections failed. The most acute problem is that systems that write (tokamak plasma pulse) experimental raw data to MDSplus frequently fail to store data. Clearly, we'd like to assign high-priority to those client ip-addresses and/or usernames that are associated with servers writing experimental data to MDSplus and low-priority to mdsip clients that simply read data for analysis.

The desired behaviour is that in the event of too many mdsip connections, the (small number of) high priority clients are always successful at connecting and writing data and (the large number of) low priority read clients may have connection attempts fail.

the file /etc/mdsip.hosts looks like a config file where it could make sense to specify such prioritization per client ip and username

I will raise a separate issue about sporadic failures to connect to MDSplus server

Example
I am happy to write code as a contributor and submit it for a merge review if you point me in the right direction.

Otherwise, I don't have a pseudocode example but I have a user-experience example. I'd like to be able to assign linux process priority number or mdsplus-internal-equivalent in /etc/mdsip.hosts, like so:
#* | MAP_TO_LOCAL
dt100* | te.user PRIO 10
@192.168.2. | te.user PRIO 40

of course, it doesn't have to be in /etc/mdsip.hosts - it's the ultimate functionality that matters.

Additional context
We experience problems where, during experimental campaign, several diagnostic systems fail to write raw data to MDSplus due to failure to connect to the server. Our linux admin had increased the Network Interface Card bandwidth and monitored to verify that the total number of incoming tcp connection the the physical-linux-server where MDSplus server is installed, is well within the spec. So we don't believe this to be a matter of networking hardware. Other tcp-based services appear fine. We are logging the total number of mdsip processes on the server and it hovers at around 1500.

I had asked questions on this topic on MDSplus "discord" forum: https://discord.com/channels/935565750679273482/935565751513935955/1248285737045200949

@mwinkel-dev mwinkel-dev added feature Indicates new feature requests or implementations tool/mdsip Relates to one of the MDSplus over IP tools (mdsipd, mdsipsd, mdsip_server) labels Jun 13, 2024
@WhoBrokeTheBuild
Copy link
Contributor

So this is possible, however it requires a bit of a paradigm shift.
In order to have connections that are "prioritized", you want to have MDSip services listening on those ports ready to go. This is how I recommend you write all data, and avoid writing data over xinetd/systemd sockets altogether, to avoid any potential issues with failures to connect and data loss.
So for each diagnostic, you have an mdsip service waiting on a port, and each diagnostic is keyed into using a single mdsip service.

I know we talked about this before, but this is really the most standard mdsplus way to handle the issue.

If you want to try to give certain connections higher priority, you could make a second xinetd/systemd service that spawns connections with nice -20 on it, or something to that effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature requests or implementations tool/mdsip Relates to one of the MDSplus over IP tools (mdsipd, mdsipsd, mdsip_server)
Projects
None yet
Development

No branches or pull requests

3 participants