Our Moodle is version 3.8, Apache 2.4.8, PHP 7.2 and MySQL 5.7, We use rotating disc HDD only.
I encountered the same problem with a large number of error message "Invalid Login Token" at error log file as below:
[Mon Jul 12 23:36:16 2021] [notice] [client M] moodle.yyyy.xxx [client M] https://moodle.yyyy.xxx Invalid Login Token: 180020 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
I have already rise the MaxRequestWorkers in MPM directive to 800 but it is unfortunate that the error message of "Invalid Login Token" persists for less than 100 online users.
<IfModule mpm_worker_module>
ServerLimit 25
StartServers 3
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 32
MaxRequestWorkers 800
MaxConnectionsPerChild 10000
</IfModule>
The apache2buddy result is listed as below:
[ OK ] Current Apache Process Count is 3, including the parent PID.
Your server's physical RAM: 105588 MB
Remaining Memory after other services considered: 92033 MB
MySQL Detected => Using 13490.16 MB of memory
Largest Apache process (by memory): 525 MB
[root@moodle ~]# ps -ylC httpd --sort:rss
S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD
S 0 14455 1 0 80 0 20432 137436 poll_s ? 00:00:24 httpd
S 2 1239 14455 0 80 0 277820 826450 pipe_w ? 00:00:53 httpd
S 2 339 14455 0 80 0 305512 832082 pipe_w ? 00:00:53 httpd
It is strange that the Apache process is as large as 525MB and the apache process count is so small. This makes the calculated MaxRequestWorkers value becomes very small.
Please advise what causes the error message "Invalid Login Token". How can I minimize the apache process size and increase the Apache Process Count? Thank you very much.