How to use JobServer properly to have a certains amount of IRIS processes available amongs multiple Apache nodes ?
I use cspa24.so Apache module to connect to IRIS. I have notified that idle Apache processes will always result in connections being kept open to the IRIS server, and thus some amount of IRIS processes being kept alive (and dedicated to those apache processes) because of those connections.
Eg: if I have 50 idle Apache processes, I will have 50 IRIS processes being kept alive in IRIS even if there is no client connection being made at that time.
It's even worse with multiple Apache nodes and a load balancer. 4 Apache nodes will result in 4 x 50 = 200 processes being used and reserved for Apache alone (even with client 0 connections). Apache tends to always create more Apache nodes than needed (for possible incoming connections), which results in more IRIS processes being use that needed as well.
I understand this feature might be useful to have a certain amount of IRIS processes available for possible incoming requests but my plan is to use the JobServer instead. The spare processes would be available for any Apache node (or IRIS itself), without the need of CSP gateway to do it by maintaining connections. Is that possible ? (eg: using some settings).
I could set MinSpareServers/MaxSpareServers to something really low, but this mean Apache itself will have very little headroom in case of incoming requests. Additionally, Apache will still reserve/use "too much" IRIS processes after lot of requests as it will take few minutes to cooldown (eg: Apache processes going from 100 to 0). From what I remember, Apache kill one child process per second and per node.
I am aware of the NSD which explicitly kept some amount of connections to IRIS server and thus some amount of IRIS processes alive as well (regardless of the amount of Apache processes). I want to know if there is an alternative.
EDIT:
one of the major downside of NSD (if we ignore the complex setup) is that you have to specify a certain amount of process for each Apache node and it can't be reused between nodes. So if you have 8 apache nodes and allow 256 clients, this gives 8 x 256 = 2048 IRIS processes (which is quite a lot). Reducing the amount is possible (eg: 8x128) but then you have the risk to be to little especially if apache nodes are not perfectly balanced (eg : load balancer might be IP based). It would be good to specify to reserve 1024 IRIS processes globally, available for all nodes.
Would this work : move the NSD outside the apache nodes (which is Linux based) and move it to IRIS server (Windows) ?
So instead of 8 Apache nodes, with 8 NSD processes for each, I would have 8 apache nodes and a 1 NSD process at IRIS server ?
Then I could set NSD to use (and maintain) 1024 IRIS processes, regardless what is set in Apache.
Now the question is what to set in Minimum/Maximum Server Connections ?It's currently set to 255/256
Comments
Hi,
I'm not sure if it helps, but I use to switch off the "KeepAlive" parameter in the ApplicationAccess to avoid all the apache sessions to by Busy instead of Idle.
I think this will affect mostly outside network connections, what I described is about the internal connections being held between Apache and IRIS Server, through CSP Gateway.
Internal connections, exactly what I'm talking about. CSP Gateway doesn't free the connection to the internal Apache, and Apache ends out with no spare workers so it can't server any more pages. So we ended up deciding to switch the KeepAlive to "Never"
But this is my experience, yours might be different :)
Hi Norman did you try to set "maximum connections" parameter in gateway settings? https://docs.intersystems.com/iris20261/csp/docbook/DocBook.UI.Page.cls?KEY=GCGI_oper_config#GCGI_config_parms_cspgateway
There is also "no activity timeout" setting https://docs.intersystems.com/iris20261/csp/docbook/DocBook.UI.Page.cls…
EDIT :my answer below refer "Maximum Server Connections" while you probably talked about "Maximum Connections". AFAIK "Maximum Connections" is for accepting client connections, how can it prevent maintaining connections to server ?
I have set Minimum Server Connections = 1 (before it was 3) and Maximum Server Connections = 256 but it does not seems to make a difference.
When used with NSD, I set Min = 255 and Max = 256 (I don't remember why you need 1 spare connection)
Setting No Activity Timeout to 5 (the minimum possible) and checking Apply timeout to all connections also make very little difference.
In System Status, the Idle time / Timeout column will goes to something like 67/5, then 70/5 and so on (increasing every seconds and showing timeout is exceeded) but it does not close the connection at all.
Apache server and IRIS have been restarted.