News for hackers. Stuff that matters.
Re:In-Memory caching: Why we can't just trust the database t... by tocomment on Tuesday November 11, 2008 @09:19PM (#361274)
So if you're running a server with 32GB of RAM and your entire database is 4GB, why can't the whole database just be kept in memory and be done with it?

I don't see an obvious way to do this in MySQL at least and it certainly doesn't do it automatically.

Re:In-Memory caching: Why we can't just trust the database t... by acro on Wednesday November 12, 2008 @04:11AM (#361631)
If your application is only reading data then it is fairly easy to scale well. Most real world applications also update data, and when updating data it must be written to permanent storage. I would argue the real scalability problems are created by the writes, not the reads.
Re:In-Memory caching: Why we can't just trust the database t... by wayne on Tuesday November 11, 2008 @09:53PM (#361314)
It essentially will be after everything's paged in. If you want to be sure though, create a RAM disk and stick your data files on there, though then you need to deal with system crashes on your own.
Re:In-Memory caching: Why we can't just trust the database t... by thwarted on Wednesday November 12, 2008 @02:20AM (#361558)
I wonder how creating a raid1 device composed of a real block device and a ram disk would serve in this regard. Has anyone tested this?
Re:In-Memory caching: Why we can't just trust the database t... by ars on Wednesday November 12, 2008 @03:37AM (#361609)
It would be pointless. Just let linux cache the data and don't worry about it.

If you must, cat all your database tables to null (i.e. read all the data in them) a few times, then you'll be sure they are in memory.

If you used a ramdisk you'll be paying double: once for the data, and again for the cache.

Re:In-Memory caching: Why we can't just trust the database t... by thwarted on Sunday November 16, 2008 @02:35PM (#366212)
Raid1 idea was a suggestion of how to deal with system crashes, not to populate the buffer cache.
Re:In-Memory caching: Why we can't just trust the database t... by ars on Wednesday November 12, 2008 @03:39AM (#361613)
It is in memory, only it's linux that does it and not mysql.

You can also create a memory table in mysql if you don't need the data stored permanently.