[ 
https://issues.apache.org/jira/browse/MAPREDUCE-4755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486251#comment-13486251
 ] 

Gopal V commented on MAPREDUCE-4755:
------------------------------------

This is rather rough at the moment. Since I'm spilling via mmap(), I can't 
compress the spill till I am done sorting it.

As far as memory bounding goes, the real advantage is that we have a split 
between java GC space and the sort mb space, something which didn't exist 
before. Unfortunately, NIO doesn't provide me a portable unmap() operation, 
which makes a bit of this stuff fairly painful to unload from memory (perhaps 
an fadvise/madvise to unload pages).

Considering my experiment was to only sort the kvmeta here and not the 
kvbuffer, compression would cause significant trouble because I assume I can 
seek & read fast within the MappedByteBuffer.

I did look at sorting L2 sized chunks - which raises an interesting question, 
the comparator is responsible for blowing off the cache, the actual data (in 
say, a terasort) is actually not staying in cache during the loops. I might get 
a better bang for buck fixing the number of comparator calls over messing with 
the size of the sort block - perhaps hybridizing with something like a 
smoothsort after checking a few random positions for being sorted.
                
> Rewrite MapOutputBuffer to use direct buffers & allow parallel sort+collect
> ---------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4755
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4755
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>         Environment: Ubuntu 12.10 x86_64 (Bulldozer 8-core)
>            Reporter: Gopal V
>            Assignee: Gopal V
>              Labels: optimization, sort
>
> The MapOutputBuffer has been written with a very severe constraint on the 
> amount of memory it can consume. This results in code that has to page-in & 
> page-out (i.e spill) data as it passes through the map buffers.
> With the advent of the java.nio package, there is a fast and portable MMap 
> alternative to handling your own buffers. This exists outside the GC space of 
> Java and yet provides decently fast memory access to all the data.
> The suggestion is that using mmap() direct buffers can be faster when a spill 
> is involved and simpler than the current spill logic when given enough 
> address space & uses the buffer caches to deliver best effort I/O.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to