Re: experimantal question about md's
Hello @all, hello Oliver, thnak you for your reply. No i do not try to solve a real problem. It was hypothetically, an idea, not more not less. I have this written in my first posting. And for me, it is a logical dependency that the ram get paged to the swap if there is not enough RAM for all processes and in-memory data. I think my question is answered good enough. Thanks for all. greetings Michael 2008/9/29 Oliver Fromme <[EMAIL PROTECTED]> > Michael Schuh wrote: > > Clearly the Writeprocess of writeing data to an mirror is totally ended, > as > > all mirrordevices are written. > > But for the read the kernel uses the faster device..and there it > could > > be an advantage.i m thinking. > > And yes i think it could be an advantage, if the RAMed mirror is very > fast, > > we have only to wait > > for the first initialization, all the ongoing reads go to the ramdisk, > all > > writes goes to both devices. > > I think it would be completely sufficient to use a normal > device and let the kernel cache the data. This is much > better because the kernel dynamically adapts the cache > size to the workload and memory requirements. > > If you use an unusual asymmetric mirror setupt with a > physical disk and a memory disk (swap-backed), the machine > will have to start paging as soon as the requirements of > your processes grow beyond what's available. This will > be very slow, of course. > > For example (a little bit simplified): Say there's a spike > in web accesses so you get many processes that want to > allocate memory. If you run out of free memory, the kernel > will drop some pages that contain cached data and re-use > them. If the cached data is used later, the kernel will > re-read it from the disk. On the other hand, if you use > a memory disk, you effectively reduce the amount of memory > available by the size of that disk. If a process wants > to allocate memory now, the kernel can't simply drop any > pages used by the memory disk -- it has to write them to > the swap area first. It is obvious that the performance > is worse. > > And of course, the kernel will still try to cache the file > system data (the VFS code doesn't care that the file system > is on a gmirror with one half on a memory disk). So the > cache and the memory disk fight for RAM at the same time. > Basically you would be wasting RAM and losing performance. > > > if i have enough ram in the box, it is possible to say: Hi kernel use > plase > > 8 Gigs of ram for buffering > > the directory abc on the disk directaccesABC ??? i think not. > > The kernel will basically use all available RAM for > caching and buffering. This works especially well for > static web content. There are a few sysctl variables > to influence the behaviour, but it's usually better not > to touch them. > > I get the impression that you're trying to solve a problem > that doesn't exist. If you think you _do_ have a problem, > please provide some evidence, such as output from iostat, > gstat, vmstat and so on. > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. > Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: > secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- > chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart > > FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd > > "C++ is to C as Lung Cancer is to Lung." >-- Thomas Funke > -- === m i c h a e l - s c h u h . n e t === Michael Schuh Postfach 10 21 52 66021 Saarbrücken phone: 0681/8319664 mobil: 0177/9738644 @: m i c h a e l . s c h u h @ g m a i l . c o m === Ust-ID: DE251072318 === ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: experimantal question about md's
On Mon, 29 Sep 2008 10:36:46 +0200 "Michael Schuh" <[EMAIL PROTECTED]> wrote: > so we have a webserver (par example) at this mirror it has very good > speed for the file-access > (ok i know in allmost cases is not the disk the bottleneck, and if we > could doing caching...) > at the above examle it is not really important if the write process > needs a second or two longer, > but by millions of requests it could be interseting to read the data > very fast.. That's exactly the case in which caching will work best. FreeBSD's integrated cache/VM system would keep such pages in memory even at the expense of writing other user data to swap. When I suggested a swap-backed device I was forgetting that malloc backed devices use memory that won't be paged, so there may be an advantage, but I think it would be the opposite to what you want. What it would do is keep rarely used file data in memory even if there's a better use for the memory elsewhere, so you would be trading performance for better worst-case latency. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: experimantal question about md's
Michael Schuh wrote: > Clearly the Writeprocess of writeing data to an mirror is totally ended, as > all mirrordevices are written. > But for the read the kernel uses the faster device..and there it could > be an advantage.i m thinking. > And yes i think it could be an advantage, if the RAMed mirror is very fast, > we have only to wait > for the first initialization, all the ongoing reads go to the ramdisk, all > writes goes to both devices. I think it would be completely sufficient to use a normal device and let the kernel cache the data. This is much better because the kernel dynamically adapts the cache size to the workload and memory requirements. If you use an unusual asymmetric mirror setupt with a physical disk and a memory disk (swap-backed), the machine will have to start paging as soon as the requirements of your processes grow beyond what's available. This will be very slow, of course. For example (a little bit simplified): Say there's a spike in web accesses so you get many processes that want to allocate memory. If you run out of free memory, the kernel will drop some pages that contain cached data and re-use them. If the cached data is used later, the kernel will re-read it from the disk. On the other hand, if you use a memory disk, you effectively reduce the amount of memory available by the size of that disk. If a process wants to allocate memory now, the kernel can't simply drop any pages used by the memory disk -- it has to write them to the swap area first. It is obvious that the performance is worse. And of course, the kernel will still try to cache the file system data (the VFS code doesn't care that the file system is on a gmirror with one half on a memory disk). So the cache and the memory disk fight for RAM at the same time. Basically you would be wasting RAM and losing performance. > if i have enough ram in the box, it is possible to say: Hi kernel use plase > 8 Gigs of ram for buffering > the directory abc on the disk directaccesABC ??? i think not. The kernel will basically use all available RAM for caching and buffering. This works especially well for static web content. There are a few sysctl variables to influence the behaviour, but it's usually better not to touch them. I get the impression that you're trying to solve a problem that doesn't exist. If you think you _do_ have a problem, please provide some evidence, such as output from iostat, gstat, vmstat and so on. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "C++ is to C as Lung Cancer is to Lung." -- Thomas Funke ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: experimantal question about md's
Hi, thank you for your answer. Clearly the Writeprocess of writeing data to an mirror is totally ended, as all mirrordevices are written. But for the read the kernel uses the faster device..and there it could be an advantage.i m thinking. And yes i think it could be an advantage, if the RAMed mirror is very fast, we have only to wait for the first initialization, all the ongoing reads go to the ramdisk, all writes goes to both devices. so we have a webserver (par example) at this mirror it has very good speed for the file-access (ok i know in allmost cases is not the disk the bottleneck, and if we could doing caching...) at the above examle it is not really important if the write process needs a second or two longer, but by millions of requests it could be interseting to read the data very fast.. in my idea it was only focused on reads not on writes, the drawbacks of Raid are well known if i have enough ram in the box, it is possible to say: Hi kernel use plase 8 Gigs of ram for buffering the directory abc on the disk directaccesABC ??? i think not. in the case of my idea it is clearly. but on the other side we need to have to say: Hi kernel, do never ever buffering on this rambased Diskdevice or we shoot us in our kneesas i think thank you michael 2008/9/29 Zaphod Beeblebrox <[EMAIL PROTECTED]> > > > On Fri, Sep 26, 2008 at 2:15 PM, Michael Schuh <[EMAIL PROTECTED]>wrote: > >> Hallo @list, >> >> Let us say i have a Machine with 8 CPUs and a lot of RAM. >> An i need a very high perfomance Storage for holding data. >> >> My idea was to setup a raid1(0) with virtual disk images. >> Created with mdconfig. >> >> My idea was to create minimum 2 md-diskimages, >> these are located >> fisrt one on the harddisk as type vnode >> second one as exact copy totally in the memory as type malloc >> >> For now the man-page mentoid me to not to do so, while large disks in RAM >> cause panics, and i know panics come surely >> >> Is the above scenario possible without panics? >> > > My first concern is not the panics (you can somewhat solve this by using > swap-backed MD), but the fact that you can't really gain an advantage this > way. > > If you have enough RAM, the regular process of filesystem buffering will do > the work for you. If you don't have enough RAM, the RAM starvation of > buffers and processes will be your problem and not the speed of your > filesystem. > > Regardless, if you were to construct a raid with an MD and a real disk (no > need to make it a vnode MD --- but that has the same drawbacks) the RAID > filesystem would be constrained by the speed of writes to the slower > filesystem. You may get a few percent out of teaching the gmirror node to > prefer reading from the memory disk, but would this be an advantage over the > natural buffering that already takes place? Probably not. > > -- === m i c h a e l - s c h u h . n e t === Michael Schuh Postfach 10 21 52 66021 Saarbrücken phone: 0681/8319664 mobil: 0177/9738644 @: m i c h a e l . s c h u h @ g m a i l . c o m === Ust-ID: DE251072318 === ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: experimantal question about md's
On Fri, Sep 26, 2008 at 2:15 PM, Michael Schuh <[EMAIL PROTECTED]>wrote: > Hallo @list, > > Let us say i have a Machine with 8 CPUs and a lot of RAM. > An i need a very high perfomance Storage for holding data. > > My idea was to setup a raid1(0) with virtual disk images. > Created with mdconfig. > > My idea was to create minimum 2 md-diskimages, > these are located > fisrt one on the harddisk as type vnode > second one as exact copy totally in the memory as type malloc > > For now the man-page mentoid me to not to do so, while large disks in RAM > cause panics, and i know panics come surely > > Is the above scenario possible without panics? My first concern is not the panics (you can somewhat solve this by using swap-backed MD), but the fact that you can't really gain an advantage this way. If you have enough RAM, the regular process of filesystem buffering will do the work for you. If you don't have enough RAM, the RAM starvation of buffers and processes will be your problem and not the speed of your filesystem. Regardless, if you were to construct a raid with an MD and a real disk (no need to make it a vnode MD --- but that has the same drawbacks) the RAID filesystem would be constrained by the speed of writes to the slower filesystem. You may get a few percent out of teaching the gmirror node to prefer reading from the memory disk, but would this be an advantage over the natural buffering that already takes place? Probably not. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: experimantal question about md's
On Fri, 26 Sep 2008 20:15:43 +0200 "Michael Schuh" <[EMAIL PROTECTED]> wrote: > Let us say i have a Machine with 8 CPUs and a lot of RAM. > An i need a very high perfomance Storage for holding data. > > My idea was to setup a raid1(0) with virtual disk images. > Created with mdconfig. > > My idea was to create minimum 2 md-diskimages, > these are located > fisrt one on the harddisk as type vnode > second one as exact copy totally in the memory as type malloc > > For now the man-page mentoid me to not to do so, while large disks in > RAM cause panics, and i know panics come surely > > Is the above scenario possible without panics? You could use swap-backed devices. They are very similar, in both cases you are writing into ram backed by swap. I doubt it will work, I think raid works at the speed of the slower device. You need to be careful how you benchmark it. Your raid array will have the unfair advantage of starting with preloaded data. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
experimantal question about md's
Hallo @list, first please answer me directly, i be not on the list. Let us say i have a Machine with 8 CPUs and a lot of RAM. An i need a very high perfomance Storage for holding data. My idea was to setup a raid1(0) with virtual disk images. Created with mdconfig. My idea was to create minimum 2 md-diskimages, these are located fisrt one on the harddisk as type vnode second one as exact copy totally in the memory as type malloc For now the man-page mentoid me to not to do so, while large disks in RAM cause panics, and i know panics come surely Is the above scenario possible without panics? thanks a lot. greetings from sunny Germany michael -- === m i c h a e l - s c h u h . n e t === Michael Schuh Postfach 10 21 52 66021 Saarbrücken phone: 0681/8319664 mobil: 0177/9738644 @: m i c h a e l . s c h u h @ g m a i l . c o m === Ust-ID: DE251072318 === ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"