How long do these ships stay at anchor outside of the Port?

Container ships that transport consumer goods only spend about 2 days inside the Port of Vancouver.

But a significant number of bulk cargo ships (grain and coal) regularly stay at anchor for anywhere from 10 days to 2 or more months.