Joerg Bruehe wrote:
Hi Mihai, all !


Mihai Tanasescu wrote:
Hello all,


I have a quite silly question I guess but it's been bugging me up recently.


A client has just acquired a SAN for his servers.
Between these servers he also has 2 mysql ones.

What would happen if I were to define a single shared disk on the SAN
and I place both Mysqls to work in the same directory on the SAN ?

If you do just this:
You would be asking for trouble - and you would get it.

(Assuming your operating systems can handle this - an operating system managing a file system, space allocation etc, has similar issues as a DBMS managing its data.)

What would be the purpose of such a setup ?
The MySQL way to use multiple machines is "scale out", which means you split your data across the servers (typically by application), or replication (master/slave setup).



[[...]]

Please explain if you had a similar curiosity in the past or
experimented (either with SAN, NFS, Group Filesystem, etc and same
installation/working directory for several Mysql instances)

The key to database performance is caching:
You want to reduce disk accesses, and would like to never wait for them (read ahead into cache, write behind). This goal is limited by your needs for stable storage (committed transactions must be logged, so that they can be reconstructed) if you use a transaction-oriented handler, but it is still a goal.

So you would love if your server could answer all queries from its cache, and just write the changes to disk at some convenient time.

If two servers follow this approach on a shared disk, ...
Figure yourself !


The only way to avoid such trouble would be to have servers which are aware of the situation and then add cross-server synchronization mechanisms to solve (or prevent) any conflicts. MySQL of course does this for parallel threads within the same server instance, but (by default) not across machines.
MySQL *can* do this if instructed, but that includes performance costs:
http://dev.mysql.com/doc/refman/5.0/en/external-locking.html

If you are aiming at increased availability, you can install MySQL servers on two machines and point them at shared data, but you would need some mechanism ("heartbeat") that prevents them from being active simultaneously (failover, primary/backup).


Jörg


Hello all,



Thank you for the help and explanations.


You're really great.


-
Mihai


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to