Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Since fsck takes a lot of time to complete, we have disabled fsck which runs based on mount counts and duration between the mounts using tune2fs command as follows.
tune2fs -c 0 -i 0 <file_system>.
To ensure filesystem consistency even across unclean shutdowns, we are planning to enable journal to the file system using tune2fs -O has_journal option.
My question is, will enabling file journal has any performance issue. Since all the disk transaction has to be logged to journal will it not take more time?
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731
Rep:
Hi,
as an easy answer, yes, enabling journal will have an impact on performance. The question is, how much in your use case.
And is this performance issue lower than the risk of loosing data.
So we all don't know anything about your system and the usage, so we will be unable to provide you with kind of advice. If we are talking about a small webserver, so fsck time will be also small. If you are running a companies file server providing 25 TB of data the fsck time can take up to 2 or 3 days.
From my point, disabling fsck is bad idea. The checks are made to prevent from data loss, so better you enable it. Also in most cases journaling does not have a measurable impact on most systems.
To get a decision point calculate what does have higher priority for your business, Data loss or little smaller IO performance.
Since fsck takes a lot of time to complete, we have disabled fsck which runs based on mount counts and duration between the mounts using tune2fs command as follows.
tune2fs -c 0 -i 0 <file_system>.
To ensure filesystem consistency even across unclean shutdowns, we are planning to enable journal to the file system using tune2fs -O has_journal option.
I am not sure you have the right understanding about what you are about to do. What fs are you using that is not already using journal? All the main linux fs's do use journal by default, except ext2. Are you truly using ext2?
Second, journal IS NOT a substitute for disk checking. The journal is a way to shorten fsck, but it's not a substitute for it. In fact, it's fsck the one that will replay your journal after a hard reboot to restore the fs to a properly working state, and if further checking is needed, it will be done.
Quote:
My question is, will enabling file journal has any performance issue. Since all the disk transaction has to be logged to journal will it not take more time?
Each fs performs differently for different tasks. Journaling takes a bit of cpu and can make *some* operations slightly slower, but in the contrary it will radically shorten some others, like checking and repairing the fs. It will also help to maintain the integrity of your data.
If you are truly bothered by this, I'd try using another fsck policy, but completely getting rid of it can have consequences There are ways to run fsck at shutdown instead, maybe you prefer that. I know it's possible, but never bothered with that.
I am not sure you have the right understanding about what you are about to do. What fs are you using that is not already using journal? All the main linux fs's do use journal by default, except ext2. Are you truly using ext2?
We are using ext3. By default has_jounal is enabled. But what I am mean by enabling journal is, I am mounting the file system with journal_data enabled, in which case it add even data(not just meta data) to jornal.
With journaling enabled you're already double tapping the disk. So when you mount with journal=data and do a full double write expect your 'svctm' metric to rise, but since you're already journaling, the overall performance shouldn't ( I say this from a 1000 foot view) be impacted too much beyond what you have now.
Obviously you are more paranoid about data loss than disk service times.
UPDATE: If you want to NOT impact performance or improve the mount performance, convert the ext3 to an ext2 and then re-create the journal on another file systems of equal or greater speed. This way you'll be single hitting the disk and the journal and likely GREATLY improving the performance of your main data volume and preserving the data (not just the metadata) on the independent volume.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.