docker inspect super slow
Perhaps related to #336, same error message, but different instance state I think.
Have a 4 instance cluster and after running for a bit more than a week started getting: "CannotInspectContainerError: Could not transition to inspecting; timed out after waiting 30s" on more and more of the 100 or so jobs we fire off onto it every 15 minutes.
Like @hridyeshpant we are running with fluentd, our /etc/ecs/ecs.config contains:
ECS_CLUSTER=macc ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","syslog","fluentd"] ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=30m ECS_LOGLEVEL=debug
and following @samuelkarp 's suggestion looked at output of sudo pvs, sudo vgs, sudo lvs, and dmesg. Here is one instance's output:
sudo pvs PV VG Fmt Attr PSize PFree /dev/sdcz1 docker lvm2 a-- 122.00g 73.00g
sudo vgs VG #PV #LV #SN Attr VSize VFree docker 1 1 0 wz--n- 122.00g 73.00g
sudo lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert docker-pool docker twi-aot--- 48.75g 36.02 34.30
dmesg | tail [673487.849517] eth0: renamed from veth98edcf6 [673487.868610] IPv6: ADDRCONF(NETDEV_CHANGE): veth23e82a9: link becomes ready [673487.871874] docker0: port 5(veth23e82a9) entered forwarding state [673487.874562] docker0: port 5(veth23e82a9) entered forwarding state [673493.056010] vethdcc70ca: renamed from eth0 [673493.088930] docker0: port 3(vetha95c7e2) entered disabled state [673493.096257] docker0: port 3(vetha95c7e2) entered disabled state [673493.104796] device vetha95c7e2 left promiscuous mode [673493.107668] docker0: port 3(vetha95c7e2) entered disabled state [673493.232087] XFS (dm-5): Unmounting Filesystem
The other 3 instances were the same except for the lvs output: docker-pool docker twi-aot--- 70.20g 54.45 49.48 docker-pool docker twi-aot--- 48.75g 19.14 7.56 docker-pool docker twi-aot--- 48.75g 41.53 31.85
So seems there is not a space issue (maybe I'm interpreting this output wrong?)
What else to look at to figure out what is slowing docker down so?
Hi @workybee,
Can you tell me:
- Which AMI are you using?
- What is the Docker version and agent version?
- Have you set any Docker daemon options (in
/etc/sysconfig/dockerand/etc/sysconfig/docker-storage)?
I'd also recommend looking at the IOPS consumed on your EBS volumes to see if you might be running into an exhausted credit balance.
Thanks, Sam
Ooops, sorry -
AMI == amzn-ami-2015.09.g-amazon-ecs-optimized (ami-33b48a59) ecs-agent == Amazon ECS Agent - v1.8.2 (64205ac) docker == Docker version 1.9.1, build a34a1d5/1.9.1
Have not set any Docker daemon options, so have the defaults from the AMI.
I have bumped the storage to 122GB of additional storage in the launch configuration used by the auto scaling group.
Our tasks do minimal I/O, just the logging output and the EBS loads look to be below 8MB/sec for both read and write and the other metrics are also low compared to the IOPS setting of 366 / 3000 I think.
Happy to provide more details, no rush, I'll be back at this come Monday (PDT == UTC-0700)
For what it might be worth, even "docker ps" is often, but not always, slow, taking between 0m0.091s and 2m49.639s though it is usually 20 seconds or more. We are only running 3 to 8 jobs per instance, though they don't last long so there may be lots of meta-data being generated, if was perfectly balanced would be 27 jobs per instance every 15 minutes but some jobs are slower, some faster, extreme slowness seems to cluster up on one instance but has moved around some. All these were newly launched instances as of 3 days ago, sudo lvs output now shows lots of space: LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert docker-pool docker twi-aot--- 48.75g 12.63 4.89
Hmmm, after running the "sudo lvs" command to get the free space reported above, now the "docker ps" runs fast every time (0m0.039s, not seeing more than 0.10s for several minutes) Neither ecs-agent nor the docker daemon have been restarted.
@samuelkarp - ping Anything else I can do to help understand what is happening?
@workybee Can you check if the newly launched instances you referred to are still using the 2015.09g AMI? We released the 2016.03.a AMI a few weeks back with a fix that to auto-extend the metadata LV as needed. If you aren't already using the newer AMI, I would suggest you use that if possible and report back if your issues persist.
My 4 instances are all using: AMI ID amzn-ami-2015.09.g-amazon-ecs-optimized (ami-33b48a59)
What could I look at to determine the need for extending the metadata LV?
I will rotate my instances onto the 2016.03.a AMI and let you know how things go.
Things with the new AMI (2016.03.a) look good, have had no "CannotInspectContainerError.*" errors so far, but might take a week to occur.
@workybee I am closing this issue for now. Please feel free to reopen this or create a new issue if you run into this again.
It has been a week+1day on the new AMI (2016.03.a) and not seen this again. You beat me to closing this issue. ;-) Thanks for the fix to whomever made (2016.03.a).