The access record for the session data must be atomic or protected by a lock per session, otherwise it will be damaged. For file-based sessions, it was decided by locking the file, I donโt know how memcached works with it. Using a separate ext4 partition is not as bad as you think - VFS will cache your I / O files in RAM , so you may not need anything else. You can fine tune ext4 (per partition) to cache your records, so you can get performance and RAM resistance for both large and RAM sizes. For example, you get a write-back cache and a 60 second window (with a hold delay) with this:
mount /dev/sda4 -t ext4 -o rw,data=writeback,nobh,commit=60
It will work quickly and will not work outside of RAM; it will use all available RAM since the file system cache is dynamic. Try this, if you say a 4MB file several times over the second file (overwriting it), you will get a very fast write.
source share