Ask AI says Aks AI works fine:

The Ask AI functionality associated with the Developer Community appears to be operational. Despite earlier reports during maintenance periods indicating that it might be unavailable, there are current instances and comments suggesting functionality has been restored. You are encouraged to verify this directly by accessing and testing the service 1 2.

😊

Try setting the Timeout property in %respone (instance %CSP.Ressponse class):

Can be set in the OnPreHTTP() method of a page in which case this changes the amount of time the CSP gateway will wait for a response from the server in seconds before it reports the 'Server is not responding' error message. This is useful if you know that this page is doing an expensive SQL query that will take a couple of minutes and you want to set the server response timeout on the CSP gateway to a minute and yet wait three minutes for this page to respond. It will just change the server response timeout for this page only. If not set the the CSP gateway uses its default timeout value specified in the CSP gateway configuration.

Unless your post is missing crucial code/info, the SQL update you posted is atomic and should work even with concurrent processes updating the same row. No need of %NOLOCK or retry (is that second update a retry?).
It will not be atomic if you use %NOLOCK.

If you want to use object code to update ProcessedCount, then:

Set obj=##class(Data.A).%OpenId(RowID,4)
Set obj.ProcessedCount=obj.ProcessedCount + 1
Set sc=obj.%Save()
; handle error here
Kill obj

I feel your post/code misses some info.

Also, what do you mean with "not working"?

 

I think that ^ZAUTHLOG cannot be set because the process executing the ZAUTHENTICATE code has no privilege/access to %SYS for writing. If you follow the @Lucas Fernandes suggestion to enable and check audit log you probably find a <PROTECT> error.

If you are using a test system (no production!), you can temporary add %All role to the CSPSystem user and try again.
Remember to remove the %All role after your debug the issue.

Note that before authentication the process running ZAUTHENTICATE has VERY limited capabilities (privileges).

In general I think the ZAUTHENTICATE  should check if it's called for the purpose you are implementing, something like:
 

If ServiceName="%Service_WebGateway" {
	If $isobject($get(%request)) {
		If (%request.Application="/ws/jarvis") {
			
			; your code here
			
		}
	}
}

You may also need/want to assign a role to the user:
Set Properties("Roles")="YourRequiredRole"

I'm afraid I don't have an answer, I use JDBC regularly (admittedly , not Postgres and NOT using %XDBC classes) and I've never seen this behavior.
If anyone wants to dive deeper in this issue, more information are required to analyze and maybe try to reproduce it, like:

"....rapid increase in memory consumption by the IRIS server" What process is consuming memory? 
What OS, Windows or Linux? If Linux, what flavor?
What Java version are you using?
What version of Postgres  JDBC driver are you using?

Last but to least, note that class %XDBC.Gateway says:
"FOR INTERNAL USE - do not invoke directly"

LoadPageDir() compiles the subdirectories as well if/when in the Web Application definition the setting "Web Settings: Recurse" is flagged (enabled). (It's flagged/enabled by default when creating a Web App)

How is Recurse setting set in your "/CSP/ourapp/" Web Application definition/configuration?

Note that the directory you pass to LoadPageDir is in fact the path of a Web Application, not the physical path on disk.