# Optimize attach volume on node

**URL:** <https://forums.suse.com/t/optimize-attach-volume-on-node/36479>\
**Category:** SUSE Storage\
**Created:** [December 16, 2021, 8:49am UTC](https://forums.suse.com/t/optimize-attach-volume-on-node/36479 "2021-12-16T08:49:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tseWmo](https://avatars.discourse-cdn.com/v4/letter/t/cdc98d/32.png) [@tseWmo](https://forums.suse.com/u/tseWmo)\
**Post date:** [December 16, 2021, 8:49am UTC](https://forums.suse.com/t/optimize-attach-volume-on-node/36479/1 "2021-12-16T08:49:04Z")

</div>

I have a use-case where I want to create and terminate a pod quite frequently and i’m investigating how to optimize that workflow.

So currently it take about ~20 seconds before the pod is up and running and most of that time is spent on waiting for attaching the volume on the node is finished. Without attaching the volume it takes about ~6-7 seconds to get the pod to running state.

Type Reason Age From Message

* * *

Normal Scheduled 20s default-scheduler Successfully assigned XXX to XXX  
Normal SuccessfulAttachVolume 10s attachdetach-controller AttachVolume.Attach succeeded for volume “XXX”  
Normal AddedInterface 3s multus Add eth0 [10.42.3.6/24] from cbr0  
Normal AddedInterface 2s multus Add net1 from XXX  
Normal Pulled 2s kubelet Container image “XXX” already present on machine  
Normal Created 2s kubelet Created container XXX  
Normal Started 2s kubelet Started container XXX

Is there any optimizations I could do to improve the attachment step?

It is not any amount of data on the volume (not yet though) so it is not related to [this fix](https://longhorn.io/kb/troubleshooting-volume-take-long-time-to-mount/). Which I already implemented.

Best regards  
Thomas

---

<div class="post-metadata">

**Author:** ![shuo-wu](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/shuo-wu/32/6426_2.png) [@shuo-wu](https://forums.suse.com/u/shuo-wu)\
**Post date:** [January 3, 2022, 2:50am UTC](https://forums.suse.com/t/optimize-attach-volume-on-node/36479/2 "2022-01-03T02:50:10Z")

</div>

To be honest, attaching a Longhorn volume would take 5 ~ 10 seconds. Besides, there are extra communication overheads between kubelet and Longhorn components that slow down the launching. It’s hard to decrease the whole flow greatly.
