This is my environment:

But my server often shows error messages like this:

Someone told me that this is related to my Apache optimization settings, Below are my current settings:
Apache 2.4.48:
Timeout 300
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 1000
StartServers 8
MaxSpareThreads 150
MinSpareThreads 50
ThreadsPerChild 25
MaxRequestWorkers 500
MaxConnectionsPerChild 500
Can someone tell me how to make optimal adjustments based on my environment?
Thank you!