MySQL Forums
Forum List  »  MySQL & Storage

Re: MySQL + NAS(NFS) - Possible solution?
Posted by: JinNo Kim
Date: September 26, 2005 06:16AM

Thank you for the response, I may try to do this (after we get 5.1 up on another box and I start playing with partitioning :). I'm only seeing fopen calls in the myisam source, but it looks like it will be trivial to add '|O_DIRECT' the the calls to mi_open, so I may try my luck :)


More comments inline :)

Ingo Str�wing wrote:
> Difficult to say. I never did anything with
> O_DIRECT. But since the description seems to say
> that the application has to wait until the data
> are on disk, I don't believe that this would make
> things much faster.
>
>
> OTOH, I experienced quite often that I was wrong
> with such beliefs.
>
> What seems to be quite clear: This option must be
> disastrous for MyISAM performance. MyISAM writes
> every row (!) to the file system cache. With
> O_DIRECT it would have to wait for every row to
> travel the network and settle on disk.
>

I'm wondering if the overhead will really matter, through the dedicated link and their proprietary fs (WAFL), in general the NetApps is at least as fast as local disk, including NFS overhead. I think (not positive) that I've also read in another of their documents that they lie to the client OS and mark the write as complete as soon as it's committed to their NVRAM cache in certain circumstances (had to do with NFS mount options). Through the GigE link this should be insanely quick, I'd think.

>
> InnoDB should only write in pages, when they are
> evicted from its cache or at savepoints. And in
> most cases InnoDB should need to know that the
> stuff is on disk. So O_DIRECT makes sense here.
> (Still guessing, I'm no InnoDB guru).
>

I really am not sure, but since I found this it really feels right. The only real symptons to the blowup were the bursting context switches in vmstat (mentioned in passing in the Sun NFS+Oracle doc). I guess I'll need to play a bit to see.

>
> The only thing I wonder is why InnoDB would not
> use this for logging. I would expect the most
> benefit here. IMHO, every commit must be written
> to disk. So O_DIRECT should be good.
>

That was a bit confusing to me as well :) In this particular set of circumstances (assuming NFS logs), I'd think that would be far more importanat than the data files - unless the assumption was local disk for logs and NFS for the huge ibdata* data files. Which could also make sense from a storage perspective - lose the data and keep the logs when the mount goes down, replay transactions when mount returns.

>
> I would like to hear of your experiences if you
> find time to try this out.

I'll make sure I post the results. I thought it was telling that NetApps wrote the O_DIRECT implementation for Linux NFS, specifically mentioning DB files over the mount in the comments section. I may be reading too much into it, though. I'm excited to give it a try, but the quick fix would never be appropriate for mainstream use.

If (big if) it works, would there be any interest in something a little more appropriate for production? I was thinking of trying to either create a new config file or add sections to my.cnf that specify which databases are mounted O_DIRECT and which should not be - is this even pratical? What are your thoughts on the most practical implementation? Would there be any interest if it could aid other users with a NAS over NFS solution? Just kind of thinking outloud here - your thoughts and all the time giving good ideas are appreciated :)

Thanks,

-JNK

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL + NAS(NFS) - Possible solution?
September 26, 2005 06:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.