$ sudo strace -p 14645
strace: Process 14645 attached
restart_syscall(<... resuming interrupted restart_syscall ...>
On 17 Sep 2020, at 3:21 pm, Scott McConnell <scott.mc...@gmail.com> 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:
--
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 modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/3622efe1-62d3-4d07-99c9-74fac83541aen%40googlegroups.com.
<Screen Shot 2020-09-17 at 12.35.47 AM.png><Screen Shot 2020-09-17 at 12.37.42 AM.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/e43fccd6-091f-447d-a0e2-7c13051b52d9n%40googlegroups.com.
On 18 Sep 2020, at 10:03 am, Graham Dumpleton <graham.d...@gmail.com> wrote:
Based on what you have shown, I somewhat doubt you are using worker MPM, the fact that the process list shows a large number of Apache child worker processes would indicate that you are more likely using prefork MPM. That is, these processes.
<PastedGraphic-3.png>
If you are using worker MPM, then the MPM settings for that MPM would have to be bizarre to get that number of processes.It actually worries me a bit that you claim you couldn't find any MPM settings. Usually Apache would have defaults in the config files. Usually they would only be missing if they had been explicitly removed
A much bigger problem is why the Apache child worker processes are showing a resident memory size of 869M. This suggests something is severely wrong withyour server setup as they should not be getting to be that large.Only other thing can think of as to why seeing so many processes if using worker MPM is if for some reason htop is showing each thread as a separate entry. Linux used to do this decades ago, but these days only ever see tools like ps and top breaking out things as processes rather than threads. That wouldn't explain the process size though, which should not be that big unless something is setup wrong.The mod_wsgi daemon process in contrast are only 13M.
<PastedGraphic-4.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/aa1d7a4f-f085-4e37-9218-81ddb91d4655n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/Er3ApBv0lgQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/299A2E1B-5CF5-410C-A4D5-55077AEECD5F%40gmail.com.
On 19 Sep 2020, at 5:19 am, Scott McConnell <scott.mc...@gmail.com> wrote:If I run a single request on the slow URL, the response is ~2 sec. When a request is made on the slow URL, ~2.2 MB of data is fetched.
That data is stored as a session variable and processed. Fetching the data from the external API is very fast-- it's just the processing of that data that takes time.If I restart apache, this is what my Apache child worker processes look like:
<image.png>With a freshly start Apache, if I do a single request on the slow URL:
<image.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/CAMD48d1rQNUf-Ga5YqVHWLSfEs9Oa-ySY8T8gwH_%2BBm1FDrNog%40mail.gmail.com.