Assuming Magento is running on Linux, you have a lot of filesystems to choose from. Off the top of my head, there's ext2, ext3, ext4, reiserfs 3 and 4, and xfs. Searching the web for "Magento filesystem comparisons" all I was able to come up with is that you may want to consider tmpfs for the cache directories. But what about the other directories?

Is there any evidence to suggest that one filesystem is significantly better than another, particularly in the context of Magento?

  • While I'm partial to ext3 & ext4 due to the resize capabilities (I use VMs for 90% of my work) - I've pinged the venerable Kevin Schroeder to weigh in here as he's done some benchmarking in this arena with Zend and Magento alike. – philwinkle Aug 13 '13 at 14:51
  • Use ext4 if you can hands down. – SaveTheMage Aug 14 '13 at 1:08

In terms of the web server the file system is largely irrelevant. When it comes to source code you should be using an opcode cache (the open source Zend one now available in 5.5 is a great option). This should cause PHP to not touch the file system at all once the cache is warm. And even so, the disk block cache in the Linux kernel renders most read performance differences between file systems to be rendered relatively moot. Some have recommended using tmpfs for deployment but this gives you almost no benefit and may actually be a little slower.

One place where one might think that you could get a boost would be on writes to the file system, such as caching or sessions. However, I would contend that if you were running your web server so hot that you had high write IO wait time on your web server then you should not be on one server any more and start moving that stuff to Redis. You should only see a slowdown if there are many, many thousands of files stored in the /var/session or /var/cache directories where writes are required to scan the inode index to find a free disk block. But the likelihood of you reaching that level on one server is quite unlikely.

But while the webserver is largely unimportant, the database server can be immensely important. Basically, don't use ext3. XFS is preferred by most (if not all) MySQL admins, but if you are on ext4 I wouldn't tell you to move. The problem goes back to how ext3 allocates disk blocks via an indirect bitmap whereas ext4/XFS uses extents. I don't know exactly how extents work (I am a web developer, after all) but I understand that they are more along the lines of a true index rather than a simple indirect bit-mapping of disk blocks.

So, web server: meh. DB: XFS or ext4.


Based on your use case (considering Magento will do lots of small reads and writes) I'd recommend picking ext4 (although ext3 will probably be fine as well). XFS performs great on large files, but it doesn't come anywhere near the performance of ext4 on smaller files. Reiser4 might perform a little better on small files, but I haven't done any benchmarks myself as it's a bit underdeveloped, less stable and not part of the Linux kernel.

Also, if you're thinking about using tmpfs for the cache folders, you might want to consider moving to in-memory cache storage, like memcached.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.