add possibility to add a cpu/memory/concurrent request threshold for request timeout

Description

add possibility to add a cpu/memory/concurrent request threshold for request timeout

Activity

Show:
Michael Offner
August 26, 2020, 6:35 PM

ATM this can only be configured via en var

lucee.requesttimeout.memorythreshold // floating point number between 0 and 1

lucee.requesttimeout.cputhreshold // floating point number between 0 and 1

lucee.requesttimeout.concurrentuserthreshold // integer

Michael Offner
August 26, 2020, 7:36 PM

also the request timeout can be disabled via “lucee.requesttimeout“

Zac Spitzer
August 26, 2020, 7:50 PM

Samuel W. Knowlton
11 hours ago

If you can tell me what this change is exactly, I can document it. Is it that this previously required an environment setting but can now be set on a per-request basis (or just per-application basis?) If so, what exactly is the syntax to do this outside of an environment variable?

Does the threshold value reflect the percentage, i.e. a cpu threshold of .75 means a threshold of 75% CPU usage, at which point…what will happen? Additional requests will be queued? Or just that a single request can’t exceed this amount?

Zac Spitzer
8 hours ago
Edited

from my reading of the code, it’s still only from environment variables

after a request is running for 10s, it’s thread gets put to a lower priority

https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java#L317

on reaching timeout, if the three thresholds (concurrent/cpu & mem) are met (or not set, they default to 0 which is considered true), requests will be terminated

https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java#L303

but if the system is running below the thresholds it will allow requests to continue, rather than terminating them

https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java#L308

So, my rough understanding from reading the code is that if you set thresholds, you can potentially allow a dynamic timeout beyond the default timeout, if you have spare cpu/ram/ not too many users?

this all defaults to being enabled, you can disable this behaviour with the environment var lucee.requesttimeout which defaults to true

https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java#L271

https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java#L225

Fixed

Assignee

Michael Offner

Reporter

Michael Offner

Labels

Fix versions

Priority

New