When you say "load test", do you mean totally overload the server way beyond
the realistic amount of traffic you would ever expect to get? :-)
In other words, are you running tests like:
ab -c 15 -n 1000000000 http://mysite <http://mysite/>
or:
siege -c 15 -t 120s http://mysite <http://mysite/>
which is just throwing as many requests as absolutely possible at Apache?
This is only going to likely cause Apache to choke up as you are putting it
into an overload state, made worse by number of server processes. It is the
wrong way of evaluating how much load your server can realistically take.
What is the real number of requests/sec you would expect to ever receive?
Does every URL handler take 1 second to response, or are response times across
the site varied?
What are the Apache MPM settings you have set? Since using prefork MPM, what do
you have set for:
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 1
MaxSpareServers 10
MaxRequestWorkers 250
MaxConnectionsPerChild 0
</IfModule>
Do you have:
WSGIRestrictEmbedded On
set in Apache configuration (outside of VirtualHost)?
And finally, do you have any performance monitoring in use, or at least have a
backend metrics database/service where could report metrics?
Graham
> On 17 Sep 2020, at 3:21 pm, Scott McConnell <[email protected]>
> wrote:
>
> Hello, I am using apache/mod_wsgi to serve a processor/ajax heavy Django
> application on an Ubuntu 16.04 machine. The app is working with low traffic
> on https (~1 sec response time), but I'm running into a bottleneck during
> load testing.
>
> During a load test (15 concurrent requestors) response time becomes ~6 sec,
> but CPU utilization peaks at 30% according to CloudWatch. I am using an EC2
> instance and I've been continually increasing the size with no effect (now
> using c5.xlarge).
>
> The strange part is my htop output... one process is taking the majority of
> the CPU time, whereas the wsgi daemon processes don't seem to take on any
> tasks. This culprit process starts after I restart the server and never dies
> until the server is stopped.
>
> This was the output when I tried tracing the process:
> $ sudo strace -p 14645
>
> strace: Process 14645 attached
>
> restart_syscall(<... resuming interrupted restart_syscall ...>
>
>
> Below are some htop screenshots, and I pasted my config at the bottom.
>
> When sorted by CPU utilization:
>
> <Screen Shot 2020-09-17 at 12.37.42 AM.png>
>
> then all the way at the bottom are my daemon processes named wsws:
>
> <Screen Shot 2020-09-17 at 12.35.47 AM.png>
>
> Here is my mysite.com.conf:
>
> <VirtualHost *:80>
>
> ServerAdmin webmaster@localhost
> ServerName mysite.com
> ServerAlias www.mysite.com
> DocumentRoot /var/www/html
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
> LogLevel info
>
> <Directory /home/ubuntu/myrepo/mysite/static>
> Require all granted
> </Directory>
>
> <Directory /home/ubuntu/myrepo/mysite/mysite>
> <Files wsgi.py>
> Require all granted
> </Files>
> </Directory>
>
>
> WSGIDaemonProcess mysite python-path=/home/ubuntu/myrepo/mysite
> python-home=/home/ubuntu/myrepo/venv processes=25 threads=1 display-name=wsws
> request-timeout=60 inactivity-timeout=600
> WSGIProcessGroup mysite
> WSGIScriptAlias / /home/ubuntu/myrepo/mysite/mysite/wsgi.py
> WSGIApplicationGroup %{GLOBAL}
>
> RewriteEngine on
> RewriteCond %{SERVER_NAME} =www.mysite.com [OR]
> RewriteCond %{SERVER_NAME} =mysite.com
> RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}
> [END,NE,R=permanent]
>
> </VirtualHost>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/3622efe1-62d3-4d07-99c9-74fac83541aen%40googlegroups.com
>
> <https://groups.google.com/d/msgid/modwsgi/3622efe1-62d3-4d07-99c9-74fac83541aen%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <Screen Shot 2020-09-17 at 12.35.47 AM.png><Screen Shot 2020-09-17 at
> 12.37.42 AM.png>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/modwsgi/85AEF860-056D-413D-9EB2-38663B70AAE8%40gmail.com.