Community

Drupal speed-up for development environment

Why?

The first idea that came to my mind when I first ran cache clear that lasted a minute or so, was "I want it run quicker!". If you are those unhappy guys who don't have an SSD, but do have a bit of RAM - you may find this discussion interesting and useful.

How?

PHP code caching (opcode caching)

The first thing to do is to install APC (or equivalent) extension for PHP. I will not describe the procedure since you can find a plenty of tutorials on that. The idea behind this is to cache the PHP code after it is parsed and then just call this compiled (executable) version instead of perpetual parsing. Speed-up is noticeable, especially with heavy PHP apps like Drupal.

RAM backed MySQL

And this is what this discussion is about. The idea is to move all (or certain relevant) databases (i.e. data files that represent the data, structure, indexes etc.) completely to a RAM partition - a piece of memory that acts like a virtual disk.
Performance gain you may get varies (based on personal practice) from 2 up to 5 times quicker lasting operations like cache clear, feature revert, migration etc.
And here is the solution:
http://github.com/lex0r/ramysql
This is a small BASH script, that runs well under Ubuntu with LAMP installed from official repos. It moves the database(s) you want to RAM and back to disk when you shutdown, reboot or manually call flush/restore operation. It also requires some special configuration for MySQL. PLEASE, do you sensitive data backups before you use this script!

So what?

It's up to you to decide, if these tools can save your time and improve your productivity when working with Drupal. A good SSD can probably perform in the same way, I didn't check. But, RAM is faster, much faster...
And yes, Cap says you can't use this solution in production (did you really thought about it?)

nobody click here