My Django app is not using the total RAM available. I’ve tested on both Apache and Nginx servers. I have 8 CPUs, app is using 8 CPUs, but it is not using more than 2.68GB out of available 64GB RAM.
App is unable to take the load of more than 100 concurrent users.
Memory alone is almost never the issue.
It’s more likely that you’re not creating enough “worker” processes to handle a large number of requests.
How are you running Django within your servers? Are you using uWSGI or gunicorn (or something else)? Look in the docs for all components of your stack to see what options are available for managing the number of workers.
Also verify that your web server is configured to support more than 100 concurrent connections. (I don’t remember the defaults, but they’re worth verifying.)
You may also need to verify that your database will accept more than 100 concurrent connections from those workers. (If your database is limited to 100, it doesn’t matter how many workers you have - the excess won’t be able to connect.)
If you’re really maxing out 8 CPUs, then you may need to start looking at other architectural changes. (That’s a big topic, and not one easily covered in a forum such as this.)
Thank you @KenWhitesell Actually, my app is configured within docker and we’re using uWSGI. Tried load balancing too but it is not using the available memory. Can you suggest any thing which helps me to resolve this.
Going back to your original message:
How are you determining this? What are the symptoms? Is this “100” a hard limit or a soft one? (A hard limit is that 100 users always works, 101 users always fail. A soft limit would be sometimes 100 works, sometimes 103 works, sometimes even 105 works - and sometimes, all of those fail.)
You need to look at all components of your architecture.
The web server, uWSGI, Postgres - look for every setting that affects the number of connections at each step. Follow the CPU utilization patterns. Look at IO queue lengths.
If it’s a hard limit, it’s going to be some configuration settings. If it’s a soft limit, it may still be a configuration setting, but it may also be a resource limitation somewhere in the stack. If the latter - look at everything.