Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top