Live data from Hacker News

Another reason why Docker containers may be slow

hackernoon.com

51–60 of 72 posts

Re: Another reason why Docker containers may be slow

#51
post #22

Earlier quoted context omitted.

And deploy it...where? AWS, Azure, GCP and virtually all other providers have first class Docker and Kubernetes support. You can barely even host a Solaris VM anywhere today.

That would by Joyent [0] the makers of SmartOS (Basically, Open Source Solaris). Their Triton cloud product uses SmartOS under the hood. [0] - https://www.joyent.com/smartos

So your solution is 1 vendor? Doesn’t seem too realistic.

Re: Another reason why Docker containers may be slow

#52
post #5

on osx, i know for a fact Docker for OSX is pretty darn slow due to its way they handle filesystem. but using Dinghy greatly helped sped everything up due to it using nfs. just in case anyone wanted to know.

Newer versions of docker have been much better, but now it just eats up a ton of ram. The ram setting in prefs doesn’t seem to actually limit it at all.

Re: Another reason why Docker containers may be slow

#53

Earlier quoted context omitted.

Hmm. I'm definitely not an expert in hypervisor implementations but I would guess that it should not proxy any calls to the host kernel...

But as fadvise can reliably only be implemented in the host kernel, the one in hypervisor is basically a noop.

In the case under discussion, the dontneed fadvise would tell the guest kernel page cache to discard written data after write. So it is useful without the host kernel knowing about it.

Re: Another reason why Docker containers may be slow

#55
post #43
post #32

Earlier quoted context omitted.

If your VM call to `fadvise` is not calling the underlying host kernel operation, is it even working?

VM certainly does "call underlying host kernel operation", it just does so indirectly — the guest userspace calls fadvise(), kernel implementation of fadvise() asks the virtio disk driver to perform particular read/writes, the virtio driver asks underlying kernel disk driver to read/write individual disk sectors (without knowing, that they are related to specific file in guest filesystem). This specific bug was cause…

Thanks for explanation. I've seen the damage of KSMD as well.

Re: Another reason why Docker containers may be slow

#57
One time we observed a dramatic drop-off in performance from one of our services after a certain day that week. I looked at recent releases and saw it perfectly coincided with one.

I asked the engineer in question to investigate, but after looking he said, "It's nothing I could be doing."

So I sat with him and used git-bisect to prove to him it was his commit: he had added trace logging within a couple of tight loops in the hottest parts of the code base. I smiled.

"But it's trace. That's disabled in production. It can't be that," he said. But we had already proven it was that commit, and the only thing that changed was additional logging.

Long story short, the logging library was filtering calls by level just before actually writing, rather than as close as possible to the call site—a design bug, for sure.

I had him swap out the library everywhere it was being used.

Moral: logging is not free.

Re: Another reason why Docker containers may be slow

#58

One time we observed a dramatic drop-off in performance from one of our services after a certain day that week. I looked at recent releases and saw it perfectly coincided with one. I asked the engineer in question to investigate, but after looking he said, "It's nothing I could be doing." So I sat with him and used git-bisect to prove to him it was his commit: he had added trace logging within a couple of tight loops…

Logging is never free. Either you add additional compile time cost to remove it, or you add at the very least a single if and/or method call at runtime.

It's not easy problem to solve. The best I've come up with so far, is using a decorator in conjunction with a DI framework that supports it. It's still only a wrap around method calls, but it enables completely turning off logging in production, and enable it when it is needed without making a special build, or wasting resources during normal execution.

Re: Another reason why Docker containers may be slow

#60
post #22

Earlier quoted context omitted.

And deploy it...where? AWS, Azure, GCP and virtually all other providers have first class Docker and Kubernetes support. You can barely even host a Solaris VM anywhere today.

That would by Joyent [0] the makers of SmartOS (Basically, Open Source Solaris). Their Triton cloud product uses SmartOS under the hood. [0] - https://www.joyent.com/smartos

They're not exactly competitive:

https://www.joyent.com/pricing/cloud/compute

https://www.digitalocean.com/pricing/

Post reply on HN