Too many parallel requests

I am seeing the error languagetool/LanguageToolHttpHandler.java at master · languagetool-org/languagetool · GitHub on a self-hosted LT instance.

Generally I have loads of CPU capacity left over but limited on memory. Is there a setting I can adjust or does it indicate that I need more memory?

FTR still haven’t managed to integrate Sentry into LanguageTool :-/

Have you tried increasing maxCheckThreads and/or maxWorkQueueSize?

I left all of this to defaults I think. My server.properties contains

maxTextLength=50000
cacheSize=3000
# 1. If you use one or more of English, French, German, Spanish, download ngram data from
# http://languagetool.org/download/ngram-data/ (English: en, French: fr, German: de, Spanish: es)
# 2. Unzip the ngram data files. If you have downloaded English and German, the content of this
# directory would be sub directories named „de“ and „en“.
#languageModel=/home/languagetool/ngram-data
pipelineCaching=true
maxPipelinePoolSize=500
pipelineExpireTimeInSeconds=3600
pipelinePrewarming=true
# maxCheckThreads=6 and maxWorkQueueSize=100 are good values for a server
# with 8 cores. For more cores, increase these values accordingly, e.g. double the number for
# 16 instead of 8 cores.
maxCheckThreads=3
maxWorkQueueSize=50

Unless your server has only 4 cores, it probably makes sense to increase maxCheckThreads. Maybe to the number of CPU cores.

Not sure really how many cores I have, since this is on a PaaS. Will try to find out. But the rule of thumb is “# CPU cores - 1” ?

Any advice for the rule of thumb on the maxCheckThreads based on the number of available CPU cores?

No advice, but try the number of CPU cores x1 or x2.

OK thank you. I will play with the setting a bit :slight_smile:

is there a way to pass in maxCheckThreads as a startup parameter?

Not on the command line, but you can set it in the properties file which you pass via e.g. --config server.properties.

yeah the issue is that we are building the images separate of the deployment. so the idea is to be able to use the same image regardless of the CPU count.