Skip to content

Useless lseek() and stat() calls -> bad performance on NFS shares #54

Open
@micoq

Description

@micoq

Hi,

Currently, the files are opened in "append+read" mode ("a+"). However, this mode generate many lseek() calls (one call after each write/flush).
This can decrease a lot the writing speed when the files you are writing are on a NFS (v4) share (in my case, on a NetApp storage controller with "slow" SATA disks).

Is the "append+read" mode necessary contrary to the "append only" mode ("a") ? In "append only", the lseek() calls disappear and I have a much better writing speed (700 event/s -> 1600 events/s).

I tested the gzip compression as well without any problem. As far I know, the gzip format does never need to re-read the file being compressed.

However, this problem doesn't appear on all NFS share/storage controllers (probably because of better disks, more cache memory...)

https://github.com/logstash-plugins/logstash-output-file/blob/master/lib/logstash/outputs/file.rb#L278

Operating system : RHEL 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions