graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #02343
Re: [Question #191807]: what about using mmap?
Question #191807 on Graphite changed:
https://answers.launchpad.net/graphite/+question/191807
Status: Open => Answered
Nicholas Leskiw proposed the following answer:
You'll have to stress test that before we'd accept it into graphite. I
have think nagging feeling that to address both the beginning and end of a
file you'll need to have enough memory to map the entire file, and
repeatedly mapping huge blocks of memory like that might not be a huge
speedup.
But if you can get some data to prove that it's considerably faster,
doesn't crash with out of memory issues, and it doesn't break my staging
environment we'll consider it...
-Nick
On Tue, Mar 27, 2012 at 1:20 AM, Amos Shapira <
question191807@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Question #191807 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/191807
>
> Description changed to:
> I read in one of the answers (comment #4 in
> https://answers.launchpad.net/graphite/+question/170794) that
> carbon-cache keeps writing to both the first and last blocks of each .wsp
> file.
> This means that it has to keep doing lseek+read+write system calls every
> time it updates the file.
> I'm not very familiar with Python but a quick search tells me that it
> supports mmap (http://docs.python.org/library/mmap.html).
> Using mmap(2) could give a huge advantage:
> 1. No system calls (which are expensive).
> 2. No copying of data between the process user-space and kernel buffers on
> each read/write
>
> What do you say?
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : graphite-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp
>
--
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.