- Total Requests per Second (RPS):
- Run #1: Low RPS, likely due to minimal concurrent users.
- Run #2: Steady increase in RPS, reaching around 200 requests per second.
- Run #3: Further increase, stabilizing around 800–900 requests per second.
- Run #4: Peaks at approximately 1,000 requests per second. Notably, no failures occurred across all runs, indicating strong stability and load-handling capacity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Optimizing Nginx and Python Configuration with Load Testing: A Case Study | |
Objective | |
The goal of this experiment was to determine how many concurrent users and requests per second a modest server configuration could handle with a basic Nginx and Python web application setup. The server in question has 1 GB RAM and a 2000 MHz single-core CPU, hosted on Linode. | |
Initial Setup | |
We started with a high-performance Nginx server capable of handling 10,000 requests per second for static content. For dynamic content, we configured Nginx to route requests to a Python web application. The web application simulates both CPU-bound tasks and a database operation with a total processing time of approximately 20 milliseconds per request, giving the backend the ability to serve at most 50 requests per second. | |
The backend Python application was served by a single instance initially, and Nginx was configured to proxy requests to this backend: | |
nginx |
This post is targetted towards Celery beginners. It discusses different ways to run Celery.
- Using celery with a single module
- Using celery with multiple modules.
- Using celery with multiple modules split across packages.
You should have Celery and Redis installed. We will use Redis as our broker.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question.objects.values('question_text').annotate(cnt=Count('question_text')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question.objects.annotate(avg_votes=Avg('choice__votes')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Choice.objects.aggregate(avg=Avg('votes')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Choice.objects.aggregate(num_votes=Sum('votes')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question.objects.annotate(num_votes=Sum('choice__votes')).filter(num_votes__isnull=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question.objects.annotate(num_votes=Sum('choice__votes')).filter(num_votes__isnull=False).order_by('num_votes')[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question.objects.annotate(num_votes=Sum('choice__votes')).filter(num_votes__isnull=False).order_by('-num_votes')[0] |
NewerOlder