FAQ
I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too many
files open within a few hours from my indexing process. Our indexing Java
process adds about 2000 documents/minute.
The IndexWriter (iw) has the following settings:

iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum terms.
iw.setMergeFactor(10);
iw.setMaxMergeDocs(100000);
iw.setMaxBufferedDocs(1000);
iw.setRAMBufferSizeMB(128);
iw.setUseCompoundFile(true);



The 'lsof' result shows rapidly growing number of open files in 'deleted'
state. Counting the number of these:

[server-1]#date
Sun Oct 18 11:02:37 EDT 2009
[server-1]# lsof -p 19606 |grep deleted |wc -l
3187
[server-1]# date
Sun Oct 18 11:07:29 EDT 2009
[server-1]# lsof -p 19606 |grep deleted |wc -l
3912

Here is a sample of those open files left behind in 'deleted' state:

java 19606 root 1861r REG 8,17 273561 368673054
/archive/index/_5fq.cfs (deleted)
java 19606 root 1862r REG 8,17 9428 368673053
/archive/index/_5fp.cfs (deleted)
java 19606 root 1863r REG 8,17 363690 368673052
/archive/index/_5fo.cfs (deleted)
java 19606 root 1864r REG 8,17 47732 368673051
/archive/index/_5fn.cfs (deleted)
java 19606 root 1865r REG 8,17 417453 368673050
/archive/index/_5fm.cfs (deleted)
java 19606 root 1866r REG 8,17 1518126 368673049
/archive/index/_5fl.cfs (deleted)
java 19606 root 1871r REG 8,17 1236023 368673057
/archive/index/_5ft.cfs (deleted)
java 19606 root 1872r REG 8,17 29743 368673055
/archive/index/_5fr.cfs (deleted)
java 19606 root 1873r REG 8,17 273561 368673054
/archive/index/_5fq.cfs (deleted)
java 19606 root 1874r REG 8,17 9428 368673053
/archive/index/_5fp.cfs (deleted)
java 19606 root 1875r REG 8,17 363690 368673052
/archive/index/_5fo.cfs (deleted)
java 19606 root 1876r REG 8,17 47732 368673051
/archive/index/_5fn.cfs (deleted)
java 19606 root 1877r REG 8,17 417453 368673050
/archive/index/_5fm.cfs (deleted)
java 19606 root 1878r REG 8,17 1518126 368673049
/archive/index/_5fl.cfs (deleted)
java 19606 root 1883r REG 8,17 1389856 368673056
/archive/index/_5fs.cfs (deleted)
java 19606 root 1884r REG 8,17 29743 368673055
/archive/index/_5fr.cfs (deleted)
java 19606 root 1885r REG 8,17 273561 368673054
/archive/index/_5fq.cfs (deleted)
java 19606 root 1886r REG 8,17 9428 368673053
/archive/index/_5fp.cfs (deleted)
java 19606 root 1887r REG 8,17 363690 368673052
/archive/index/_5fo.cfs (deleted)
java 19606 root 1888r REG 8,17 47732 368673051
/archive/index/_5fn.cfs (deleted)
java 19606 root 1889r REG 8,17 417453 368673050
/archive/index/_5fm.cfs (deleted)
java 19606 root 1890r REG 8,17 1518126 368673049
/archive/index/_5fl.cfs (deleted)
java 19606 root 1895r REG 8,17 1389856 368673056
/archive/index/_5fs.cfs (deleted)
java 19606 root 1896r REG 8,17 29743 368673055
/archive/index/_5fr.cfs (deleted)
java 19606 root 1897r REG 8,17 273561 368673054
/archive/index/_5fq.cfs (deleted)
java 19606 root 1898r REG 8,17 9428 368673053
/archive/index/_5fp.cfs (deleted)
java 19606 root 1899r REG 8,17 363690 368673052
/archive/index/_5fo.cfs (deleted)
java 19606 root 1900r REG 8,17 47732 368673051
/archive/index/_5fn.cfs (deleted)
java 19606 root 1901r REG 8,17 417453 368673050
/archive/index/_5fm.cfs (deleted)
java 19606 root 1902r REG 8,17 1518126 368673049
/archive/index/_5fl.cfs (deleted)
java 19606 root 1910r REG 8,17 403610 368673058
/archive/index/_5fu.cfs (deleted)
java 19606 root 1911r REG 8,17 1236023 368673057
/archive/index/_5ft.cfs (deleted)
java 19606 root 1912r REG 8,17 1389856 368673056
/archive/index/_5fs.cfs (deleted)
java 19606 root 1913r REG 8,17 29743 368673055
/archive/index/_5fr.cfs (deleted)
java 19606 root 1914r REG 8,17 273561 368673054
/archive/index/_5fq.cfs (deleted)
java 19606 root 1915r REG 8,17 9428 368673053
/archive/index/_5fp.cfs (deleted)
java 19606 root 1916r REG 8,17 363690 368673052
/archive/index/_5fo.cfs (deleted)
java 19606 root 1917r REG 8,17 47732 368673051
/archive/index/_5fn.cfs (deleted)
java 19606 root 1918r REG 8,17 417453 368673050
/archive/index/_5fm.cfs (deleted)
java 19606 root 1919r REG 8,17 1518126 368673049
/archive/index/_5fl.cfs (deleted)


--
View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

Search Discussions

  • Aaron McCurry at Oct 18, 2009 at 3:27 pm
    I also have seen this problem recently. I had to make a patch to our
    production system to at least relief the system of the deleted files
    handles. I did it by capturing all of the Descriptors that the
    FileInputIndex object creates and monitoring if the file it references
    still exists or not. If it doesn't I then try and close the
    Descriptors. I know that this is a hack, but it was needed ASAP, and
    I couldn't find in my code anywhere where I wasn't closing the opened
    indexreaders or indexwriters.

    Aaron

    On Oct 18, 2009, at 11:14 AM, GlenAbbeyDrive wrote:


    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too
    many
    files open within a few hours from my indexing process. Our
    indexing Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum
    terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in
    'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java 19606 root 1861r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1862r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1863r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1864r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1865r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1866r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1871r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1872r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1873r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1874r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1875r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1876r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1877r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1878r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1883r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1884r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1885r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1886r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1887r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1888r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1889r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1890r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1895r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1896r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1897r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1898r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1899r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1900r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1901r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1902r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1910r REG 8,17 403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java 19606 root 1911r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1912r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1913r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1914r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1915r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1916r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1917r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1918r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1919r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • GlenAbbeyDrive at Oct 18, 2009 at 5:49 pm
    Are you using 2.9.0 or 2.4?



    Aaron McCurry wrote:
    I also have seen this problem recently. I had to make a patch to our
    production system to at least relief the system of the deleted files
    handles. I did it by capturing all of the Descriptors that the
    FileInputIndex object creates and monitoring if the file it references
    still exists or not. If it doesn't I then try and close the
    Descriptors. I know that this is a hack, but it was needed ASAP, and
    I couldn't find in my code anywhere where I wasn't closing the opened
    indexreaders or indexwriters.

    Aaron

    On Oct 18, 2009, at 11:14 AM, GlenAbbeyDrive wrote:


    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too
    many
    files open within a few hours from my indexing process. Our
    indexing Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum
    terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in
    'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java 19606 root 1861r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1862r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1863r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1864r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1865r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1866r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1871r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1872r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1873r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1874r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1875r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1876r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1877r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1878r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1883r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1884r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1885r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1886r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1887r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1888r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1889r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1890r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1895r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1896r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1897r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1898r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1899r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1900r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1901r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1902r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1910r REG 8,17 403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java 19606 root 1911r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1912r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1913r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1914r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1915r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1916r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1917r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1918r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1919r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

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

    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25948828.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Aaron McCurry at Oct 18, 2009 at 6:12 pm
    I actually have seen the problem in both, with our app. Not sure if
    it's how we are using lucene or if the problem is internal. We
    actually only saw the problem recently because we starting using a new
    linux machine that had it's open file handle settings too low. And
    with our volume it only took about 10 hours for the machine to start
    having problems. Hence the need for the hack patch.

    Aaron
    On Oct 18, 2009, at 1:49 PM, GlenAbbeyDrive wrote:


    Are you using 2.9.0 or 2.4?



    Aaron McCurry wrote:
    I also have seen this problem recently. I had to make a patch to our
    production system to at least relief the system of the deleted files
    handles. I did it by capturing all of the Descriptors that the
    FileInputIndex object creates and monitoring if the file it
    references
    still exists or not. If it doesn't I then try and close the
    Descriptors. I know that this is a hack, but it was needed ASAP, and
    I couldn't find in my code anywhere where I wasn't closing the opened
    indexreaders or indexwriters.

    Aaron

    On Oct 18, 2009, at 11:14 AM, GlenAbbeyDrive wrote:


    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too
    many
    files open within a few hours from my indexing process. Our
    indexing Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum
    terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in
    'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java 19606 root 1861r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1862r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1863r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1864r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1865r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1866r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1871r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1872r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1873r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1874r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1875r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1876r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1877r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1878r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1883r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1884r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1885r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1886r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1887r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1888r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1889r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1890r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1895r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1896r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1897r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1898r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1899r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1900r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1901r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1902r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1910r REG 8,17 403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java 19606 root 1911r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1912r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1913r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1914r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1915r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1916r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1917r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1918r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1919r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at
    Nabble.com.


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

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

    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25948828.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Michael McCandless at Oct 18, 2009 at 5:05 pm
    Hmm, not good. Can you share more details about how your app is using Lucene?

    Do you also have an IndexReader that's open on this directory? Do you
    reopen it after indexing documents? If so, using IndexReader.reopen
    or by closing and opening a new IndexReader? Or, by getting a near
    real-time reader?

    Are you closing the IndexWriter after each batch, or calling commit?

    Mike
    On Sun, Oct 18, 2009 at 11:14 AM, GlenAbbeyDrive wrote:

    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too many
    files open within a few hours from my indexing process.  Our indexing Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in 'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java    19606 root 1861r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1862r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1863r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1864r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1865r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1866r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1871r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1872r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1873r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1874r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1875r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1876r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1877r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1878r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1883r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1884r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1885r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1886r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1887r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1888r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1889r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1890r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1895r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1896r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1897r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1898r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1899r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1900r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1901r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1902r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1910r   REG       8,17    403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java    19606 root 1911r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1912r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1913r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1914r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1915r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1916r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1917r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1918r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1919r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • GlenAbbeyDrive at Oct 18, 2009 at 5:47 pm
    I commit the IndexWriter every 200 documents in a batch as follows and you
    can see that I reopened the reader after the commit.

    private void commit(IndexWriter writer) throws CorruptIndexException,
    IOException, SQLException {
    writer.commit();
    if(indexReader!=null)
    indexReader.reopen();
    }

    What do you mean by real-time reader?

    Thanks.


    Michael McCandless-2 wrote:
    Hmm, not good. Can you share more details about how your app is using
    Lucene?

    Do you also have an IndexReader that's open on this directory? Do you
    reopen it after indexing documents? If so, using IndexReader.reopen
    or by closing and opening a new IndexReader? Or, by getting a near
    real-time reader?

    Are you closing the IndexWriter after each batch, or calling commit?

    Mike
    On Sun, Oct 18, 2009 at 11:14 AM, GlenAbbeyDrive wrote:

    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too many
    files open within a few hours from my indexing process.  Our indexing
    Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in 'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java    19606 root 1861r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1862r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1863r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1864r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1865r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1866r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1871r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1872r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1873r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1874r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1875r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1876r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1877r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1878r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1883r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1884r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1885r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1886r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1887r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1888r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1889r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1890r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1895r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1896r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1897r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1898r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1899r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1900r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1901r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1902r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1910r   REG       8,17    403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java    19606 root 1911r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1912r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1913r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1914r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1915r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1916r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1917r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1918r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1919r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25948812.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • John Wang at Oct 18, 2009 at 6:23 pm
    Hi Glen:
    I think it is in your application code:

    The indexReader returned is not closed if the underlying index has changed.
    If your update rate is high, you will run into this issue because GC may not
    have caught up with the FH leak.

    THe code should instead be:

    if (indexReader!=null){
    IndexReader newReader = indexReader.reopen();
    if (newReader!=indexReader){
    indexReader.close(); // close the old reader
    }
    }

    However, with Lucene 2.9, you can also use:

    IndexReader r = writer.getReader();, which is a much simpler API. You still
    need to close the reader when you are done with them however.

    -John
    On Sun, Oct 18, 2009 at 10:47 AM, GlenAbbeyDrive wrote:


    I commit the IndexWriter every 200 documents in a batch as follows and you
    can see that I reopened the reader after the commit.

    private void commit(IndexWriter writer) throws CorruptIndexException,
    IOException, SQLException {
    writer.commit();
    if(indexReader!=null)
    indexReader.reopen();
    }

    What do you mean by real-time reader?

    Thanks.


    Michael McCandless-2 wrote:
    Hmm, not good. Can you share more details about how your app is using
    Lucene?

    Do you also have an IndexReader that's open on this directory? Do you
    reopen it after indexing documents? If so, using IndexReader.reopen
    or by closing and opening a new IndexReader? Or, by getting a near
    real-time reader?

    Are you closing the IndexWriter after each batch, or calling commit?

    Mike

    On Sun, Oct 18, 2009 at 11:14 AM, GlenAbbeyDrive <wende.long@gmail.com>
    wrote:
    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too
    many
    files open within a few hours from my indexing process. Our indexing
    Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in
    'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java 19606 root 1861r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1862r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1863r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1864r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1865r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1866r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1871r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1872r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1873r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1874r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1875r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1876r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1877r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1878r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1883r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1884r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1885r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1886r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1887r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1888r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1889r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1890r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1895r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1896r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1897r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1898r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1899r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1900r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1901r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1902r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java 19606 root 1910r REG 8,17 403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java 19606 root 1911r REG 8,17 1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java 19606 root 1912r REG 8,17 1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java 19606 root 1913r REG 8,17 29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java 19606 root 1914r REG 8,17 273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java 19606 root 1915r REG 8,17 9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java 19606 root 1916r REG 8,17 363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java 19606 root 1917r REG 8,17 47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java 19606 root 1918r REG 8,17 417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java 19606 root 1919r REG 8,17 1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25948812.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Grant Ingersoll at Oct 19, 2009 at 1:39 pm

    On Oct 18, 2009, at 1:47 PM, GlenAbbeyDrive wrote:
    I commit the IndexWriter every 200 documents in a batch as follows
    and you
    can see that I reopened the reader after the commit.

    private void commit(IndexWriter writer) throws CorruptIndexException {
    writer.commit();
    if(indexReader!=null)
    indexReader.reopen();
    }
    You should be checking if the reader returned by reopen() is different
    than the one you have and then if it is, you need to close the old one
    at the appropriate time.

    -Grant


    --------------------------
    Grant Ingersoll
    http://www.lucidimagination.com/

    Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
    using Solr/Lucene:
    http://www.lucidimagination.com/search


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • GlenAbbeyDrive at Oct 18, 2009 at 6:31 pm
    Using a 'realtime' reader off the IndexWriter (writer.getReader()) instead of
    indexReader.reopen() seems fixed this problem.


    Michael McCandless-2 wrote:
    Hmm, not good. Can you share more details about how your app is using
    Lucene?

    Do you also have an IndexReader that's open on this directory? Do you
    reopen it after indexing documents? If so, using IndexReader.reopen
    or by closing and opening a new IndexReader? Or, by getting a near
    real-time reader?

    Are you closing the IndexWriter after each batch, or calling commit?

    Mike
    On Sun, Oct 18, 2009 at 11:14 AM, GlenAbbeyDrive wrote:

    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too many
    files open within a few hours from my indexing process.  Our indexing
    Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in 'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java    19606 root 1861r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1862r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1863r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1864r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1865r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1866r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1871r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1872r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1873r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1874r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1875r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1876r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1877r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1878r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1883r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1884r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1885r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1886r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1887r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1888r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1889r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1890r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1895r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1896r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1897r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1898r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1899r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1900r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1901r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1902r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1910r   REG       8,17    403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java    19606 root 1911r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1912r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1913r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1914r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1915r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1916r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1917r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1918r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1919r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25949130.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Michael McCandless at Oct 18, 2009 at 8:35 pm
    Super! Thanks for bringing closure.

    Mike
    On Sun, Oct 18, 2009 at 2:31 PM, GlenAbbeyDrive wrote:

    Using a 'realtime' reader off the IndexWriter (writer.getReader()) instead of
    indexReader.reopen() seems fixed this problem.


    Michael McCandless-2 wrote:
    Hmm, not good.  Can you share more details about how your app is using
    Lucene?

    Do you also have an IndexReader that's open on this directory?  Do you
    reopen it after indexing documents?  If so, using IndexReader.reopen
    or by closing and opening a new IndexReader?  Or, by getting a near
    real-time reader?

    Are you closing the IndexWriter after each batch, or calling commit?

    Mike

    On Sun, Oct 18, 2009 at 11:14 AM, GlenAbbeyDrive <wende.long@gmail.com>
    wrote:
    I switched from Lucene 2.4.0 to the latest 2.9.0 version and got too many
    files open within a few hours from my indexing process.  Our indexing
    Java
    process adds about 2000 documents/minute.
    The IndexWriter (iw) has the following settings:

    iw.setMaxFieldLength(1024*1024*1024); // 1G as maximum terms.
    iw.setMergeFactor(10);
    iw.setMaxMergeDocs(100000);
    iw.setMaxBufferedDocs(1000);
    iw.setRAMBufferSizeMB(128);
    iw.setUseCompoundFile(true);



    The 'lsof' result shows rapidly growing number of open files in 'deleted'
    state. Counting the number of these:

    [server-1]#date
    Sun Oct 18 11:02:37 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3187
    [server-1]# date
    Sun Oct 18 11:07:29 EDT 2009
    [server-1]# lsof -p 19606 |grep deleted  |wc -l
    3912

    Here is a sample of those open files left behind in 'deleted' state:

    java    19606 root 1861r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1862r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1863r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1864r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1865r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1866r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1871r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1872r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1873r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1874r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1875r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1876r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1877r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1878r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1883r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1884r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1885r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1886r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1887r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1888r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1889r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1890r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1895r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1896r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1897r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1898r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1899r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1900r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1901r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1902r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)
    java    19606 root 1910r   REG       8,17    403610 368673058
    /archive/index/_5fu.cfs (deleted)
    java    19606 root 1911r   REG       8,17   1236023 368673057
    /archive/index/_5ft.cfs (deleted)
    java    19606 root 1912r   REG       8,17   1389856 368673056
    /archive/index/_5fs.cfs (deleted)
    java    19606 root 1913r   REG       8,17     29743 368673055
    /archive/index/_5fr.cfs (deleted)
    java    19606 root 1914r   REG       8,17    273561 368673054
    /archive/index/_5fq.cfs (deleted)
    java    19606 root 1915r   REG       8,17      9428 368673053
    /archive/index/_5fp.cfs (deleted)
    java    19606 root 1916r   REG       8,17    363690 368673052
    /archive/index/_5fo.cfs (deleted)
    java    19606 root 1917r   REG       8,17     47732 368673051
    /archive/index/_5fn.cfs (deleted)
    java    19606 root 1918r   REG       8,17    417453 368673050
    /archive/index/_5fm.cfs (deleted)
    java    19606 root 1919r   REG       8,17   1518126 368673049
    /archive/index/_5fl.cfs (deleted)


    --
    View this message in context:
    http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25947462.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

    --
    View this message in context: http://www.nabble.com/Lucene-2.9.0-leaves-too-many-.cfs-files-open%2C-causing-too-many-files-open-java-error.-tp25947462p25949130.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedOct 18, '09 at 3:14p
activeOct 19, '09 at 1:39p
posts10
users5
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase