Hello,
I have server (1 cup adn 1gb ram) with a django app, served with daphne and a redis server for django channels.
Then I have a managed database (postgres) which is used in django app.
My application is a very simple web browser quiz game, but when the game start all the user need to request the same information ( or almost the same) in a very short period of time. I have an approximated request of 44 for user. (80% are static files)
User plays in teams of 7-9 players, so I have a plan to implement the game a staggered start. So every second 7-9 user request the start of the game, so if I have 60 teams the game will start staggered along one minute.
Do you think that this is a good strategy to minify the load on my server?
In the other hand I have planned to make this upgrades:
Use a space to server static files.
Use a managed redis database from DO.
May update my server to 2cpu or 4 cpu with 4 workers of daphne.
What do you think of these upgrades will be worth it?
** Some date:
Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
Your staggered start strategy can certainly help in spreading the load over a period of time, effectively mitigating server stress during peak loads. However, hardware upgrades will also enhance overall performance and handle traffic more efficiently. Here’s a little bit of insight into your upcoming upgrade plans:
Overall, your planned upgrades seem logical and may significantly improve the performance and responsiveness of your Django application. I would suggest monitoring your servers to understand better what works and what doesn’t for your specific use case.
For detailed documentation on scaling and optimising your servers, check out this link.
Hope that this helps!
Your staggered start strategy is a good approach to reduce the load on your server, as it distributes the requests over time, preventing all users from hitting the server simultaneously. This can help manage CPU and memory usage effectively for your setup. Below are considerations and evaluations of your planned upgrades:
Using a Space to Serve Static Files Offloading static files to a DigitalOcean Space or similar object storage service is highly recommended. Serving static files directly from your server consumes resources that could otherwise be used for dynamic requests. Spaces are optimized for such use cases and will improve your server’s performance while reducing latency for static file delivery.
Using a Managed Redis Database Moving to a managed Redis database can be beneficial if your current server’s Redis usage is close to its resource limits. Managed Redis ensures high availability, scalability, and performance. It will also reduce the burden on your application server, which can focus solely on running your Django app and Daphne.
Upgrading to a Higher CPU Server Upgrading to a 2-CPU or 4-CPU server with additional workers for Daphne will allow your server to handle more concurrent requests. If your application is already running at 40% CPU usage with 60 users, this upgrade is worthwhile if you anticipate scaling up the number of teams or users significantly.
Staggered Game Start This is a highly effective strategy, especially for scenarios like yours where many users request similar information simultaneously. By staggering the start times, you distribute the load evenly over time, minimizing resource contention.
Cost vs. Benefit
Additional Suggestions
Your current strategy, coupled with these planned upgrades, provides a solid foundation for scaling your application efficiently while managing costs.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.