Comment 91 for bug 1743249

Revision history for this message
Blake Rouse (blake-rouse) wrote : Re: Failed Deployment after timeout trying to retrieve grub cfg

Actually caching does make a difference. That method is not just caching the reading of a file, it caches the searching of the file based on the purpose, the reading of that file from disk (sure can be in kernel cache), the parsing of the template by tempita.

All of that is redudant work that is being done on every single request. Searching the filesystem and reading the file from cache is all syscalls even if they come from the kernel cache. Since MAAS is async based that means that coroutine will be placed on hold while we wait for the result to be loaded from the kernel into the memory of the process. That gives other coroutines time to do other things, which means that coroutine doesn't get to execute until others are done or blocked by there own async request.

Caching this information can greatly improve that by not requiring the coroutine to be pushed back into the eventloop while it is waiting for data from the kernel and without this change when the data comes back it still has to be processed by tempita which will take time and block the eventloop from completing other work.

So its not simply that we should use the kernel to cache reads from the disk there is a lot more involved here. We have noticed improvements with this change on systems that are being ran with large number of VM's because of the reduction of IO.