-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: Extremely Poor Docker Resource Utilization Efficiency #2730
Comments
can u please assign, I want to work on this issue but I will need guidance |
This mostly related of reducing docker image size |
Diffrent ways to approach this issue 1. Multi-Stage Builds Installing dependencies and building the application in the first stage. 2. Optimizing Base Images Baseline Image (Full Node.js): ~900 MB 3. Using Compression Tools please suggest a method that doesn't impact comaptibility with codebase |
Please investigate the best solution and propose it after testing on your system. It's not just RAM, but also ways to reduce the CPU overhead. |
alright sir |
The main problem I found with the API is that we have to run it in dev mode in the production Docker environment because our build process for the Talawa API is broken, so we can't use npm run start. If we resolve the build issue, we can drastically improve performance and security of the docker container. I think @varshith257 also tried to solve the build process issue a few months back, any upadates on that? |
Would this PR by @adithyanotfound provide any insights? |
@vasujain275 Why do you say the build process is broken? Can you create an issue for someone else to try to fix it? |
Yes this helps, I will start my work on this in two days, have got end sem exams |
am unassigning myself from the issue due to lack of progress |
@palisadoes plz assign me |
@palisadoes what is the load average if the api runs without docker means what is the performance . I need this because i will only focus to improve to docker performance.If not then i have to use profiler to measure what is the exact issue is it related to docker container or in code sue unOptimized query. |
@palisadoes for now i have done limits it cpu and memory usage . Also added the multistage build and used one light weight image . But i think this will handle upto a specific user . But To handle it effectivly can i use kubernatives or any other services to handle the load . So it will scale the pods if load increase and reduce the cpu usage and improve the performance.If not does the vps server where the container is hosted can it provides this mechanism. And one doubt is how i give more load to this api because at the time of testing l am the only user . |
|
Build related issue means i don't get means u are saying about unnecessary node modules or something like this are in build at the time of building the docker image there which are causing the issue. I need futher calrity. And in above u commented u are not able to run npm run start it is working fine because api service is starting |
OK. |
@palisadoes i run a load test on the server with docker and with out docker on the configuration of duration of 30 sec and 2 req/sec and found means total of 60 request will be made in 30 sec in this scenerio both have equal successRate . But when i run the same test for same duration but with different request rate like 5 req/sec means 150 request in 30 sec got the result of slightly better performance of server with out docker . But the thing is server can't handle 150 request in 30 sec as many of request is under processing and not completed the request out of this only 40 request is successful.And if u want run the docker on low end service for a small user base like in 60 sec it makes 50 to 60 (considerable factor like medicore device 4gb of ram and 4core ) it will handle the request easily if talwa-api will reduce its cpu excessive task and if we limit the cpu usage also it will handle but some slowness will be there in this scenerio. What u say? |
@PurnenduMIshra129th please coordinate with @vasujain275 There appears to be multiple causes. The application is clearly over using resources. Here is additional information. |
@vasujain275 yes u are correct build process is broken . After build it is not working properly . Also when i try to run npm run prod it is not running gives multiple error. U have any thoughts on this ? should we have use import instead of require. |
@palisadoes is there anything I can help with? |
We need to focus on the app performance which is causing docker to appear to be slow. @PurnenduMIshra129th the bare minimum need to to be done to get the demo instance usable on the cloud server. Please coordinate with @vasujain275 |
@vasujain275 @PurnenduMIshra129th What's the status? |
|
@palisadoes @varshith257 If you provide some guidance then i can give give a try |
The guidance is clearly defined in the issue. |
@palisadoes let me first setup the goDaddy server on my machine. |
You can't. You don't have access to the server in question and it's current configuration. You need login access to do so. This is what needs to be done. |
@palisadoesi think i need some credentials to login into server ? Can i get the credentials so that i can try?My steps would be first i will create docker image in production enviroment then i will set its limit to get minimum performance.If applicable then i can see any other changes that will be helpful |
Send me your SSH public key and the username you require in slack. |
@palisadoes I think deployment is done of what @vasujain275 has shared to me and just left with replacing the dev image with prod image and then we are good to go i guess so far |
@gautam-divyanshu i have now access to server so trying to what to do ? Not much of idea of this. |
@palisadoes @varshith257 yes it running on server but i can see that still its memory limit is set to full .. see the screen shot |
These are fundamental questions to get the app running. |
@palisadoes currently the docker is running on server . But the i can see limit is not set there for now it talawa-api have access to all ram and cpu the system have . So we have to set the limit in its compose file and deploy again. also For now i can see load is also not too high .once we update the limit in api side then we can run the admin . For Now as load is not more so we can run Talawa-admin. But it is better to first set the resource limit on both side then we can deploy this. And after we deploy both of this we can benchmark this as said by @varshith257 . And i did not check the sample DB reloading and updating the develop branch.
|
Can i work on this issue @palisadoes @varshith257 ? So that it will be solved fast. |
That means the docker file in develop is configured in a suboptimal way. It's probably true in Admin too. |
@palisadoes Yes .it is true |
|
@palisadoes ok i will do |
|
@palisadoes ok i will contact her in slack |
I had previously made a PR that optimized the admin for production, but I can’t find the changes in the codebase. Were they reverted or overwritten? |
I'm sorry this happened. There are a lot of moving pieces to manage, and I missed this. |
@palisadoes No worries! I’ll reapply the changes and open a new PR shortly. |
@palisadoes @adithyanotfound can you tell what are the changes or in which file it was |
@palisadoes to start the talawa-api in server only we have to start the container or after that is there anything we have to do? |
@VanshikaSabharwal and I managed to setup the API on the server using the development environment. We created a Please coordinate with her. We need better online documentation on this too. |
Ideally, we should be using production and not develop instances for the API and Admin on the server. Please try to get that working. |
@palisadoes ok will complete that soon. |
Describe the bug
We run a demonstration instance of Talawa-API on a GoDaddy VPS server running Ubuntu. It has the following resources:
Other information:
The purpose of this issue is to find ways to tune all Talawa-API Dockerfile and app configurations to lower its CPU and RAM utilization by at least 75%
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Actual behavior
Screenshots
Additional details
Add any other context or screenshots about the feature request here.
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship
The text was updated successfully, but these errors were encountered: