2

Fresh install of Debian 8. After running my web server for a few minutes/hours, Apache2 stops working. I always get the error "Scoreboard is full, not at MaxRequestWorkers" from Apache2 error.log.

This workaround works for me, however - I do not want to change MPM mode to prefork. So is there any other solution to this? Like upgrading the Apache2 version? I'm relatively new to Linux/Debian, so I'm not sure what to do exactly whatsoever.

AndOr
  • 113
  • 1
  • 5
Hillcow
  • 121
  • 1
  • 5

1 Answers1

2

This was a bug in apache for mpm-event and mpm-worker, that you may still be experiencing:

https://bz.apache.org/bugzilla/show_bug.cgi?id=53555

The bug is in the scaling up & down of the number of server processes.

The real 'fix' is in place in more recent versions I think, but you can easily work-around this problem by following the advice from ScottE in Comment12 in the bugzilla report. In it, he says: "...If we set MinSpareThreads and MaxSpareThreads equal to MaxRequestWorkers (so Apache doesn't attempt to scale down processes), the issue goes away (as expected, but validates (maybe?) this has to do with Apache scale-down). ..."

(added my emphasis)

I have had success so far with this issue by setting MaxSpareThreads = MaxRequestWorkers. AND by understanding the relationship between workers, threads, servers, and such. The latter is very important. The basic directives needed for the event MPM are simple. The way to scale your service is to set the above two values to the number of client connections you want to support. Everything else will just work. See: http://httpd.apache.org/docs/2.2/mod/worker.html

IMHO: If your goal is to have apache scale the number of "server" processes based on need, then perhaps you shouldn't be using either event or worker models. Calculate the number of client connections you want to allow, then configure them to be always available. Otherwise, update your apache, or configure the workaround as above and live with it.

Good luck!

AndOr
  • 113
  • 1
  • 5
  • I have tried this suggestion, with MaxRequestWorkers = ServerLimit = MinSpareThreads = MaxSpsareThreads = 400 and it does not fix Apache's behavior. Apache simply does not make use of the tons and tons of RAM I have available. – S. Imp Jan 10 '20 at 22:32
  • 2
    This thread is about fixing a scaling bug - nothing to do with using RAM. If you are seeing the "scoreboard if full..." message, then you might have this problem. If you want apache to use more RAM, set these counts to higher values AND understand the MPMs. The prefork vs others memory models will make a gigantic difference in memory usage. Read up on MPM variants. – AndOr Jan 12 '20 at 00:38
  • Hi, Im on apache 2.4.46 and still got this problem, with worker threads being tied up with "G" status ( Gracefully Finishing ) threads. they never finish and dont even seem to exist anymore, the pid does not exist anymore, i know its not php related through elimination. eventually my score board (apache status) just gets full. i will try this. – Hayden Thring Jan 25 '22 at 20:03
  • https://serverfault.com/questions/1084635/apache-mpm-workers-stuck-in-g-gracefully-finishing-growing-scoreboard-is-fu/1084642#1084642 – Hayden Thring Jan 25 '22 at 20:03