[Gluster-users] Atomic file updates
Tom Munro Glass
tom at tmgcon.com
Wed Feb 12 21:02:01 UTC 2014
I'm not currently a Gluster user but I'm hoping it's the answer to a
problem I'm working on.
I manage a private web site that is basically a reporting tool for
equipment located at several hundred sites. Each site regularly uploads
zipped XML files to a cloud based server and this also provides a web
interface to the data using apache/PHP. The problem I need to solve is
that with a single server disk I/O has become a bottleneck.
The plan is to use a load balancer and multiple web servers with a
4-node Gluster volume behind to store the data. Data would be replicated
over 2 nodes.
The uploaded files are stored and then unzipped ready for reading by the
web interface code. Each file is unzipped into a temporary file and then
renamed, e.g.
file1.xml.zip --unzip--> uniquename.tmp --rename--> file1.xml
Use of the rename function makes these updates atomic.
How can I achieve atomic updates in this way using a Gluster volume? My
understanding is that renaming a file on a Gluster volume causes a link
file to be created and that clearly wouldn't be appropriate where there
are frequent updates.
I could use flock, exclusive for writing and shared for reading, but too
many reading processes could potentially block writing.
Any advice will be much appreciated.
Tom
More information about the Gluster-users
mailing list