-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
API: Extremely Poor Docker Resource Utilization Efficiency #2730
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
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. |
Here is the issue. The importation process must have no errors no matter how many times it's run. The data must be valid. |
Can someone open issues to fix the
|
How can we make the home page load faster? |
There is a serious flaw in the design of Talawa Admin.
This can cause XSS errors. It's also not clear how authorization is handled in this heterogeneous scenario. To get around the issue, the API and Admin servers need to run on the same IP address. This is not practical. The apps will often reside on separate devices. The solution seems to be only allowing connections to the API from the Admin app and not web clients. Web clients should only talk to the web app. Is this a best practice? What is advisable? |
Maybe we can use lazy loading. |
@palisadoes |
|
@palisadoes mongo db data importaion error can be solved . Previously i have solved that issue it is related to it is not able to connect the mongo outside the docker enviroment . I will again then make a pr for this issue. |
@palisadoes @vasujain275 @varshith257 can you tell me the requirement why this much entry point for init mongo is there inside the compose file this much entry point is really important always in my case it is showing error .If you tell the requirments what our exact requirment then i can try different process this much entry point and init mongo.sh scripts are creating issue . We can modify some coding style to work it as accurate. It is very confusing.And for replica set docker provides some commands for this feature.It is really helpful for further. |
@palisadoes it is failing due to window writing style which is not supportable in unix we have to fix this . found some soultion regarding this before running the script we have to convert it to its compatiable version. |
Please work with @prayanshchh and @VanshikaSabharwal on the solution via slack. |
Yes @palisadoes i saw that this 2 below errors and solved them
Previous Error while accessing Before and After Code(talawa-api) ->
Previous Error: Before and After Code(talawa-api): Before and After Code(talawa-admin): Result:
Previous Error while trying to access api from admin: |
@palisadoes @prayanshchh I also found this that when i went inside the docker mongo image i saw that repl set is created and the names of db are imported but not the data from sample data. The data inside venues is empty for some reason . |
@palisadoes
|
@palisadoes If we can fix the data import which i think @prayanshchh is doing somewhere and have a consistent docker compose file either |
|
@prayanshchh @VanshikaSabharwal is the data import problem is for windows line style ending.And in any part do you need any help? |
no the problem was with duplicate key error, error was when we run import command when data is already present. We just have to clean db before every import |
the bigger issue is that even with data present in db, login is still not working, trying to debug that. |
@prayanshchh did you try to actually go inside the mongo container and see if there is data on not? |
yes I shared you ss in slack |
The server is working now, but the other.mp4 |
@palisadoes as this issue is related to docker efficiency if this feature is checked and working properly on other system so can i unassign my self from this issue? because i am not able to contribute on new issue . |
Closing |
Thanks |
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: