[systemd-devel] Slow startup of systemd-journal on BTRFS

Goffredo Baroncelli kreijack at libero.it
Sat Jun 14 14:04:24 PDT 2014


On 06/14/2014 10:13 PM, Kai Krakow wrote:
> Goffredo Baroncelli <kreijack at libero.it> schrieb:
> 
>> I am looking at the source, and yes, it does. To be honest it seems to
>> defragment only on btrfs.
> 
> Oh that seems true... Then defragmenting and relocating is probably a todo 
> item. I'm sure I've read about it somewhere.
> 
>>> If it
>>> does, the question is: where to relocate in a multi devices file system?
>>
>> Systemd uses the defrag capability of btrfs.
> 
> man:systemd-readahead says it relocates and defrags if supported. Scanning 
> through the source, it only defrags.
> 
>>> That means, you have to enable systemd-readahead-collect, tho.
>> I have to admit that I disabled it. I will make some test also with
>> readhead enabled.
> 
> Take care to enable all needed services to enable defrag... If your services 
> make use of journal file loading these files should also become part of the 
> process. You can check with "/usr/lib/systemd/systemd-readahead analyze". 
> The state is stored in /.readahead.
> 
I have enabled all the services (collect, replay, done), but I was unable to see any gain. 

I don't know why but system.journal is not considered by readahead:

# /usr/lib/systemd/systemd-readahead analyze | grep journal


   100% ( 1)          770: /etc/systemd/journald.conf
    50% ( 1)      4194304: /var/log/journal/36f10f5379ec4a1398ac303a0ce20fd0/user-997.journal
    50% ( 1)      4194304: /var/log/journal/36f10f5379ec4a1398ac303a0ce20fd0/user-1000.journal


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5


More information about the systemd-devel mailing list