[Tutor] A further question about opening and closing files

Alan Gauld alan.gauld at btinternet.com
Thu Sep 10 18:17:26 CEST 2015


On 10/09/15 16:44, Laura Creighton wrote:
>> ..., if your game engine is running on a server shared by other users and
>> some of them are  running critical apps (think a businesses billing or

> We were talking about mobile devices ...

Ok, in that case I'd guess the client playing the game is only 
interested in the game so won't care about impact on other
processes.

> These days every business billing and accounting suite I know of --
> and we _make_ a bookkeeping suite, which we need to interface
> with many other things ....
>
> runs in its own VM and doesn't share with anybody.

But it does. The physical file system and its IO bus is still
shared by every VM and therefore by every app on every VM.
And when you do a flush you force the VM to write to the
physical IO bus. Even if the VM uses a virtual file system
(which is no good if you are sharing with other VMs in a
common database environment) it will almost certainly be
manifested as a physical file eventually. If you are lucky
the VM will defer flushes to the physical FS but that is
normally a configurable parameter.

One of the biggest problems facing modern data centres is
how to manage access to physical devices from virtual
environments. It is a very delicate balancing act and
very easy to get wrong. And where in the past a mistake
upset a handful of apps it now impacts hundreds. We
are still in early days with VM technology and the monitoring
tools are improving and the hardware architectures are
developing with parallel buses etc to avoid these
kinds of problems. But most of the data centres I
work with are still running at least 50% capacity
on pre VM-optimised servers.

> multiplayer games tend to run in their own VM as well, and too many
> users using the game can and does degrade performance.  But I don't
> think that having too many users flush their stream objects is a
> significant part of this problem,

Regular flushes hardly ever affect the program doing the
flushing. It's whatever is sharing the IO bus. Remember the
issue is the physical hardware bus not the software
environment. If you are writing to your own file system
over a segregated bus (and there are several technologies
for doing that (SAN, NAS, multiplexed buses etc etc)) then
its not usually an issue.

It's only if you are on a machine where you share a single IO
channel with other apps that problems can occur - for the
other apps.

However, I suspect we might now be getting a wee bit OT
for most readers on this list! So I will put my architect's
hat away again. :-)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list