A
A
alekssamos2019-11-03 13:25:13
Apache HTTP Server
alekssamos, 2019-11-03 13:25:13

Increase concurrent apache connections?

I have an image recognition service.
One request takes 10 seconds.
When several thousand people log in at the same time, the server crashes.
Error: [mpm_prefork:error] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
And it doesn't work anymore after that. Restart helps.
I put a big number in there.
Made through /etc/cron.hourly
/etc/init.d/apache2 restart
Let's see what happens.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Kitaev, 2019-11-03
@deliro

Properly use normal nginx or Caddy

V
Vitaly Karasik, 2019-11-03
@vitaly_il1

Though the server still can digest on power.

How is this known? Do you have CPU/RAM monitoring?
Raising Apache limits is not difficult, but in order to understand what and how to raise, you need monitoring metrics and Apache messages when it falls.

X
XEHKOK, 2019-11-04
@XEHKOK

It's not entirely clear what your server is doing with prefork loads.
Alternatively, you can use worker or event.
An example worker is:
The Multiprocessor Module (MPM) implements a hybrid multiprocessor multithreaded server. By using threads to serve requests, it can serve a large number of requests with fewer system resources than a process-based server. However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.
The most important directives used to control this MPM are ThreadsPerChild which controls the number of threads spawned by each child process and MaxRequestWorkers which controls the maximum total number of threads that can be started.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question