Peak is 125,000 per minute. I'm really not sure about the 5XXs, the ELB is 
reporting them but I don't see too many in the apache logs. Seems to be 
502s or 503s. They're definitely lessened with more instances.

On Monday, February 17, 2020 at 9:26:40 PM UTC-7, Jason Garber wrote:
>
> Hello,
>
> What does the math say at peak times?  100,000,000 is a lot in a day, and 
> it would not take much disturbance to spike requests.
>
> I assume the clients are not slow?  Hanging clients consume a valuable 
> thread.  We use nginx buffering request/response to mitigate that and free 
> up thread as soon as possible.
>
> Keep in mind python gil will bottleneck threads if your processes are at 
> all cpu bound...  I might consider more processes and less threads per 
> process.  
>
> Any pattern around when you get 5xx errors?   Can you spin up 20 extra 
> instances for an hour to see if that cures them?
>
> Just some thoughts...
> Jason
>
>
>
>
>
>
> On Mon, Feb 17, 2020, 9:13 PM Andrew Charles <[email protected] 
> <javascript:>> wrote:
>
>> Ubuntu 18.04.04
>> Apache 2.4.29 (event)
>> mod_wsgi 4.5.17
>> Python 3.6.8
>> Django 2.2.10
>>
>> WSGIScriptAlias / ...wsgi.py
>> WSGIDaemonProcess name processes=8 threads=30 queue-timeout=45 socket-
>> timeout=60 request-timeout=60 inactivity-timeout=0 startup-timeout=45 
>> deadlock-timeout=60 graceful-timeout=15 eviction-timeout=0 python-path
>> =...base/ python-home=...virtualenv/
>> WSGIProcessGroup name
>>
>>
>> AWS ec2 c5.xlarge 4 CPUs 8GB Mem (ASG autoscaling between 4 and 10 
>> instances) behind an ELB
>> Averaging 100,000,000 requests per day (107 mil today)
>>
>> We have a few django api endpoints that are very simple, which only hit a 
>> local or separate redis cache, no db hits. We relay data to firehose but 
>> use django-q to offload those tasks. Requests take around 200ms but a fair 
>> number are 400-500ms. The ELB reports the average as 60ms. Each instances 
>> uses between 4-5GB mem. I've been trying to get more performance out of our 
>> instances and reduce our 5XXs. I previously tried 3 processes and the 
>> default (15) threads. I've been researching the best ways to change 
>> settings but it seems like it's unique to every setup and there's no easy 
>> rules to follow. I'm looking for suggestions or at least someone to tell me 
>> I'm on the right track.
>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/modwsgi/f7e65e6b-8975-4292-ba05-1e347945a6d1%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/modwsgi/f7e65e6b-8975-4292-ba05-1e347945a6d1%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/c0d7db6d-44fe-445f-9dbd-af7445c3d66c%40googlegroups.com.

Reply via email to