You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2010/12/20 12:59:01 UTC

[jira] Created: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

FSDirectory.open should return MMap on 64-bit Solaris
-----------------------------------------------------

                 Key: LUCENE-2825
                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Store
            Reporter: Robert Muir
             Fix For: 3.1, 4.0


MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir resolved LUCENE-2825.
---------------------------------

    Resolution: Fixed

Committed revision 1052980, 1052981 (3x)

> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975180#action_12975180 ] 

Robert Muir commented on LUCENE-2825:
-------------------------------------

bq. CPU cache / TLB effects? Using more address space isn't completely free.

In the case of Solaris I think there is much less of a chance of TLB effects? 
For example on Solaris java automatically uses large pages (unlike Linux, Windows etc).

http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973212#action_12973212 ] 

Robert Muir commented on LUCENE-2825:
-------------------------------------

bq. Doesn't MMap automatically consume a lot more memory?

No.


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973264#action_12973264 ] 

Robert Muir commented on LUCENE-2825:
-------------------------------------

bq. There could be a number of things that could make this very OS dependent:

I agree, we should test any OS before changing any defaults.

In the Solaris case its clear that mmap is better for our purposes though (as to exactly why, no idea)


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973181#action_12973181 ] 

Uwe Schindler commented on LUCENE-2825:
---------------------------------------

Is it slower on Linux-64 because you only enable for windows-64 and solaris-64?

In general I expected that it is faster on all all 64 bit systems.

> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973260#action_12973260 ] 

Yonik Seeley commented on LUCENE-2825:
--------------------------------------

There could be a number of things that could make this very OS dependent:
 - kernel read-ahead can differ between mmap and traditional IO, and differ between operating systems
   (think about reading 10 bytes from position 4094... if mmap doesn't read-ahead at least one page then you will suffer a double page fault).
 - CPU cache / TLB effects?  Using more address space isn't completely free.
 - Java mmap overhead - you don't get access to a raw byte[]
 - userspace-kernel transition times (i.e. for a read system call) differ between operating systems.  Linux is very good here, probably leading to less of a penalty for read vs mmap.


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973213#action_12973213 ] 

Uwe Schindler commented on LUCENE-2825:
---------------------------------------

bq. Doesn't MMap automatically consume a lot more memory?

No, it consumes *address space*, this is why it only works on 64 bit. The index files are mapped into address space, so handled like a SWAP file. They only consume as much memory from cache space as the operating system decides. Especially it does not consume memory from java heap!


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973183#action_12973183 ] 

Robert Muir commented on LUCENE-2825:
-------------------------------------

In the case of Linux-64 and Mac OS X, Mike was testing these, but it looked
like some queries were actually faster with NIOFS on these platforms.

(This makes no sense to me, but i figured we could set it for Solaris where its obviously faster always)


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Issue Comment Edited: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973213#action_12973213 ] 

Uwe Schindler edited comment on LUCENE-2825 at 12/20/10 9:41 AM:
-----------------------------------------------------------------

bq. Doesn't MMap automatically consume a lot more memory?

No, it consumes *address space*, this is why it only works without problems on 64 bit. The index files are mapped into address space, so handled like a SWAP file, that's the trick. They only consume as much memory from cache space as the operating system decides. Especially it does not consume memory from java heap!


      was (Author: thetaphi):
    bq. Doesn't MMap automatically consume a lot more memory?

No, it consumes *address space*, this is why it only works on 64 bit. The index files are mapped into address space, so handled like a SWAP file. They only consume as much memory from cache space as the operating system decides. Especially it does not consume memory from java heap!

  
> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Earwin Burrfoot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975212#action_12975212 ] 

Earwin Burrfoot commented on LUCENE-2825:
-----------------------------------------

{quote}
bq. CPU cache / TLB effects? Using more address space isn't completely free.
In the case of Solaris I think there is much less of a chance of TLB effects?
For example on Solaris java automatically uses large pages (unlike Linux, Windows etc).
{quote}

For, like, 13Gb of memory-mapped index, I've seen no noticeable difference between having large pages on and off under Linux. That's some anecdotal evidence, as I'ven't done any extensive research, but still.

> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-2825:
--------------------------------

    Attachment: LUCENE-2825.patch

Here's the patch, and luceneutil 10M doc results:

(solaris 9, ultra60 2GB ram, 1.6u23 jre with -d64)

||Query||QPS trunk||QPS patch||Pct diff||||
|spanFirst(unit, 5)|0.68|0.71|{color:green}3.7%{color}|
|spanNear([unit, state], 10, true)|0.14|0.15|{color:green}7.3%{color}|
|"unit state"|0.34|0.37|{color:green}9.1%{color}|
|unit state|0.37|0.45|{color:green}21.7%{color}|
|unit*|1.12|1.40|{color:green}25.4%{color}|
|uni*|0.61|0.79|{color:green}30.2%{color}|
|+unit +state|0.52|0.69|{color:green}33.1%{color}|
|unit~1.0|0.28|0.38|{color:green}34.9%{color}|
|unit~2.0|0.27|0.37|{color:green}36.2%{color}|
|state|1.10|1.52|{color:green}38.0%{color}|
|united~1.0|0.42|0.60|{color:green}42.7%{color}|
|united~2.0|0.10|0.15|{color:green}46.8%{color}|
|un*d|1.97|3.09|{color:green}56.5%{color}|
|u*d|0.52|0.85|{color:green}61.3%{color}|
|+nebraska +state|3.51|6.73|{color:green}91.6%{color}|


> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2825) FSDirectory.open should return MMap on 64-bit Solaris

Posted by "Jason Rutherglen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973210#action_12973210 ] 

Jason Rutherglen commented on LUCENE-2825:
------------------------------------------

bq. some queries were actually faster with NIOFS on these platforms

I think that's to be expected.  MMap should be faster than NIOFS in all cases, if it's not then the JVM could be to blame (on 64-bit).  There's notes at: LUCENE-753

Doesn't MMap automatically consume a lot more memory?

> FSDirectory.open should return MMap on 64-bit Solaris
> -----------------------------------------------------
>
>                 Key: LUCENE-2825
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2825
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2825.patch
>
>
> MMap is ~ 30% faster than NIOFS on this platform.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org