In Linux you can set a ulimit by user, processes and or memory
Whenever a service from SB is requested, it will create a process in the AR Server (triggered through remoteaction.sh). What I would like to achieve is enter parameters inside the remoteaction.sh script such that I can limit the usage for each process that is triggered. As each service creates 1 process, when you have say 20-30 services requested you will have 20-30 processes running simultaneously. I just want to limit the memory usage for each of those processes to counteract the performance impact. Somewhat similar to how you can limit the arserverd process or the tomcat process.
The remoteaction.sh is a script calling a java process so it should be possible to add -Xms -Xmx parameters to the JAVA_OPTS inside the script. Have you tried that on a testbox?
Edit: Be aware that setting xmx might cause outofmemory errors if it is to low, so it might break functionality.
You can put a wrapper around the sh or modify the sh with a case or if statement that’s does the following
Pcount=ps -C remoteaction.sh --no-headers | wc -l
If the Pcount > 20 you can wait or do something else. The issue is that when ARS shells out it doesn’t wait for a response. So you’re going to create a blackhole of things not being processed and I don’t think that is your intention. going down that path, you’ll have to think of what to do with every situation and have the code process it and you’ll have to have a way to cross check that something didn’t get overlooked, it can become a burden. I think your intention is to create a queue and process them FIFO, ideally if the code could just stay open, look for something to process, process it, wait 5 seconds and repeat, then you’d only have one process running at any given time. You can use the above command to monitor that it is running and continue to restart and you can put this in your startup on your server as well, so it is maintenance free.
personally I wouldn’t mess with the xmx as that could make it not function at all and that doesn’t fix the number of processes running. Please make sure you test in a nonprod environment.
Appologies for typos I’m mobile!