Hi I have a problem where I already set up a $5 basic droplet for frontend and $84 CPU-intensive droplet for backend.
Unfortunately, only 4 people can process the function in the backend at the same time. The rest will cause error. My backend is heavy as it is heavy on writing the results on images.
Plus, when I view “htop” in the Droplet when running 1 function in the web, all 4 CPU is at 100% and the CPU percentage reach 400%. And it won’t go down even after the process is completed.
May I know if any of you had faced this problem before?
Is the root cause the Droplet itself or can you provide me a guidance to find the root cause. How do I optimized CPU in my droplet? Or please suggest me a good way to solve this matter.
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
The issue you’re experiencing with high CPU usage and limited concurrent processing capacity on your backend server could be due to several factors. To address this problem effectively, it’s important to systematically identify the root cause and then explore optimization strategies. Here’s a structured approach:
Identifying the Root Cause
Code Profiling and Optimization:
Concurrency and Parallel Processing:
Resource Leaks:
Dependency and Library Check:
Server Configuration:
Optimization Strategies
Load Balancing:
Scaling Up or Out:
Caching:
Optimized Image Processing:
Monitoring Tools:
htop
,nmon
, or even more sophisticated monitoring solutions can provide insights into real-time performance.Additional Considerations