Skip to content
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

docker-compose重启服务时间太长,这是什么原因 #11720

Closed
Handikang opened this issue Apr 12, 2024 · 9 comments
Closed

docker-compose重启服务时间太长,这是什么原因 #11720

Handikang opened this issue Apr 12, 2024 · 9 comments

Comments

@Handikang
Copy link

如图片所示,下面的服务重启需要很久,据我所知docker应该在一分钟内就完成所有的重启动作。
image
下面是我系统的基本信息
image

@glours
Copy link
Contributor

glours commented Apr 12, 2024

Hey @Handikang
if the translation was correct, your issue is the time Compose is taking to start one of your service, right? (please, next time, try to post your issue in english, it's easier for everyone engage with this product both users and maintainers 🙏 )
If so there is no time guarantee about container startup time, depending on what is done during its boot process it can take a while to be considered as started, for example maybe your mysql database is taking more time to seed its data?

By the way you're using an old version of the docker engine v20.10.10 maybe you could also try the latest v26.0.0?

Can you give us more details? Such as the compose file composition?

@Handikang
Copy link
Author

I used the same Docker engine on other computers and restarted the service quickly, so I don't think it's a problem with my service. This problem has been bothering me for a long time

@glours
Copy link
Contributor

glours commented Apr 12, 2024

@Handikang I understand you frustration here but without more information I won't be able to help you

@ndeloof
Copy link
Contributor

ndeloof commented Apr 15, 2024

Please use docker inspect to capture container state when you see it stuck in this "restarting" state.
Do you have depends_on relations between services ?

@Handikang
Copy link
Author

@ndeloof ,当我使用docker inspect的时候,没有任何反应

@Handikang
Copy link
Author

服务之间是有依赖关系的

@Handikang
Copy link
Author

image

@ndeloof
Copy link
Contributor

ndeloof commented Apr 15, 2024

Please use english for issue reports, as already requested.

@ndeloof
Copy link
Contributor

ndeloof commented Apr 15, 2024

if docker inspect hangs, as it seems according to your screenshot, then you have an issue with your docker engine. Issue is not related to compose. Please check engine logs for any reported error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants