Skip to content

slow write/append to files on ramfs #884

@justinc1

Description

@justinc1

While running nginx and testing achievable requests/s for its internal server_status page (e.g. no file access should be required for that), I noticed that req/s drops with elapsed time. Problem is that nginx was writing to access.log (so obvious). Problematic part in OSv code is https://github.com/cloudius-systems/osv/blob/master/fs/ramfs/ramfs_vnops.cc#L393:

			void *new_buf = malloc(new_size);
			...
			if (np->rn_size != 0) {
				memcpy(new_buf, np->rn_buf, vp->v_size);
				free(np->rn_buf);
			}

In my case is 90 B long line written per HTTP request, and in short time this requires malloc/memcpy/free of about 50 MB.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions