On 26 Oct 2023 at 15:35:42, Tim Allison <[email protected]> wrote: > return 503 if > requests > > Oops, 429, I'd guess? >
Yes, 429 would work. Request limits can fairly easily be implemented outside of Tika, but resource isolation is not, so having a solution for that as well would be very nice. > On Thu, Oct 26, 2023 at 9:33 AM Tim Allison <[email protected]> wrote: > > > > The flags -XX:MaxRAMPercentage or -XX:MaxRAM should do the trick, but > am investigating if they are enforced fast enough before the system OOM > kicks in. So far I would say that is not the case. > > > This SO (https://stackoverflow.com/questions/52495429/setting-xxmaxram) > > suggests that maxRAM is only a hint, not a strict enforcement. 😟 > > That is my experience as well. Should we allow users to specify a ulimit on the forked process? > > In my limited testing ulimit -m is also ignored, at least when running in a container. > > Alright, will do rate limiting upstream. > > I looked at the code a bit more, and we could allow configurations for > > number of concurrent tasks (return 503 if > requests?) at the Tika > > level. I haven't had a chance to figure out if we can do this more > > easily at the cxf level. > > Thanks!
