<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: Disk v. Mem --> <!--X-From-R13: Qlaor eh Fnera <plaorNynhery.npgyno.hgrknf.rqh> --> <!--X-Date: from ren.globecomm.net [207.51.48.3] by mx5.ibm.net id 863578114.21186-1 Wed May 14 02:48:34 1997 --> <!--X-Message-Id: 199705140209.VAA28207#laurel,actlab.utexas.edu --> <!--X-Content-Type: text/plain --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, Re: Disk v. Mem</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:cynbe#laurel,actlab.utexas.edu"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00447.html">Previous</a> | <a href="msg00449.html">Next</a> ] Thread: [ <a href="msg00486.html">Previous</a> | <a href="msg00475.html">Next</a> ] Index: [ <A HREF="author.html#00448">Author</A> | <A HREF="#00448">Date</A> | <A HREF="thread.html#00448">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>Re: Disk v. Mem</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI> <LI><em>Subject</em>: Re: Disk v. Mem</LI> <LI><em>From</em>: Cynbe ru Taren <<A HREF="mailto:cynbe#laurel,actlab.utexas.edu">cynbe#laurel,actlab.utexas.edu</A>></LI> <LI><em>Date</em>: Tue, 13 May 1997 21:09:23 -0500</LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> ashen#pixi,com: | erh, at the risk of getting bounced out of | here for asking a fourth-grade question... ;) | | what are the advantages of swapping out objects | to disk as opposed to keeping them in memory? Excellent question -- and the follow-on excellent question is "Ok, so why not just let the host virtual memory hardware do it for you?" :) | do you really need to save that much memory? | do you need it for something else? At today's ram prices, depending on your budget, you may well not need to. A large mud can run 100Meg + of ram, though, much of it infrequently used in many cases, and you might not want to devote ~$500 worth of ram to the db if you can avoid it with a simple software fix... | are objects so large that 40,000 of them fill mem quickly? On some servers, at least, objects take a minimum of 100 bytes each, and the sky is the limit after that as properties are added: There may be hundreds of thousands of strings of about sixteen bytes each average size. | does too full a mem size inhibit the driver speed? Not for most practical purposes, as long as it all fits in physical memory. If it gets big enough to start paging out to disk via the host virtual memory system, performance can drop off -dramatically-. (I speek as someone who has on occasion worked with hundreds of megabytes of volume MRI datasets on machines with only dozens of megabytes of physical ram *wrygrin*...) | isn't it more costly in speed to write to disk? Absolutely -- a factor of a million or so. (Milliseconds to access disk vs nanoseconds to access ram.) Meaning that if your server suddenly starts running at disk speeds instead of ram speeds, it may suddenly look a million times lower. Humans are amazingly sensitive to a slowdown of just a constant factor of a million. :) | what kind of savings do you get versus this extra cost? Depending on your situation, you may buy nothing at all, you may be able to support a bigger db than you could otherwise afford, you may be able to do a better job of virtual memory than the host OS/hardware would otherwise do, thus reducing the time spent waiting for disk, or you may be able to save money on hardware by not having to buy an extra gigabyte of ram. If you really need to access all of your db every second or so, then diskbasing just aint gonna work for you. This may be true of some combat-style muds with simulation going on in every room on every cycle, say. If much of your db goes untouched for minutes, hours or days at a time, you may be able to save lots of ram by keeping the unused parts on disk, and only the frequently touched stuff in ram. (Which still isn't free, no? Else I'd have a lot more of it floating around the house than I do. :) "Why not just let the host OS page the unused stuff out to disk?" The basic problem is that modern hardware swaps out units of 4K, whereas objects in muds tend to be 16-32 bytes long (given a reasonable server design - 100 bytes or so if its spendthrift). So if a 4K page contains only one 40-byte object in use, it still has to stay in ram, even though 99% of it is not in use. If you're willing to buy 100x more ram than is logically needed, this isn't a problem: Otherwise, a software solution that swaps out smaller units of ram can be a big win. A viable alternative is to have your server move all the objects in frequent use into one spot in ram: This leaves lots of pages which are 100% unused instead of 99% unused, which the host OS/hardware can then swap to disk for you. This is a very viable approach which for some reason I don't seem to see anyone using... Cynbe </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="00475" HREF="msg00475.html">Re: [MUD-Dev] Re: Disk v. Mem</A></strong> <ul compact><li><em>From:</em> Nathan Yospe <yospe#hawaii,edu></li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00447.html">Re: [MUD-Dev] RP thesis...</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00449.html">Re: [MUD-Dev] Re: Administrative notes</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00486.html">Re: [MUD-Dev] Disk v. Mem</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00475.html">Re: [MUD-Dev] Re: Disk v. Mem</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00448"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00448"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><strong><A NAME="00422" HREF="msg00422.html">Disk v. Mem</A></strong>, ashen <a href="mailto:ashen#pixi,com">ashen#pixi,com</a>, Tue 13 May 1997, 12:10 GMT <UL> <LI><strong><A NAME="00435" HREF="msg00435.html">Re: [MUD-Dev] Disk v. Mem</A></strong>, Dan Root <a href="mailto:dar#thekeep,org">dar#thekeep,org</a>, Wed 14 May 1997, 01:10 GMT </LI> <LI><strong><A NAME="00460" HREF="msg00460.html">Re: [MUD-Dev] Disk v. Mem</A></strong>, Miroslav Silovic <a href="mailto:silovic#srce,hr">silovic#srce,hr</a>, Wed 14 May 1997, 14:58 GMT </LI> <LI><strong><A NAME="00486" HREF="msg00486.html">Re: [MUD-Dev] Disk v. Mem</A></strong>, clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Fri 16 May 1997, 01:12 GMT </LI> </UL> <UL> <li><Possible follow-up(s)><br> <LI><strong><A NAME="00448" HREF="msg00448.html">Re: Disk v. Mem</A></strong>, Cynbe ru Taren <a href="mailto:cynbe#laurel,actlab.utexas.edu">cynbe#laurel,actlab.utexas.edu</a>, Wed 14 May 1997, 09:48 GMT <UL> <LI><strong><A NAME="00475" HREF="msg00475.html">Re: [MUD-Dev] Re: Disk v. Mem</A></strong>, Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Thu 15 May 1997, 05:50 GMT </LI> </UL> </LI> </UL> </LI> <LI><strong><A NAME="00417" HREF="msg00417.html">Abnother RP paradigm</A></strong>, Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Tue 13 May 1997, 10:19 GMT <LI><strong><A NAME="00409" HREF="msg00409.html">Roll-playing</A></strong>, Khanone <a href="mailto:Khanone#aol,com">Khanone#aol,com</a>, Tue 13 May 1997, 01:58 GMT <UL> <LI><strong><A NAME="00442" HREF="msg00442.html">[MUD-Dev] re: Role-playing</A></strong>, Marian Griffith <a href="mailto:gryphon#iaehv,nl">gryphon#iaehv,nl</a>, Wed 14 May 1997, 04:58 GMT </LI> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>