<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Alfresco 7.2 container solr time-outs in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146093#M38693</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm running a custom scheduled job that's processing documents in the repository in batches of 9,000 documents. The repository has many million documents but it's not a problem for me because Alfresco could be used in the meantime. This question is related to my other post&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/java-heap-space-with-java-class-custom-action/td-p/314093" target="_blank" rel="noopener nofollow noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-forum/java-heap-space-with-java-class-custom-action/td-p/314093&lt;/A&gt; . I can process about 36,000 docments per hour because the job is started every 15 minutes. Processing the batch takes between 6 and 11 minutes so Alfresco has some time to "settle down". The job does an AFTS query on Solr like this:&lt;/P&gt;&lt;P&gt;+TYPE:"cm:content" AND -cm:creator:"System" AND -TYPE:"cm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;erson" AND -TYPE:"lnk:link" AND -TYPE:"fm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ost" AND -TYPE:"dl.issue" AND -TYPE:"dl.event" AND -TYPE:"dl.todolist" AND -TYPE:"cm.post" AND +cm:created:["1900-01-01" TO "2022-10-21T01:53:00.356281"]&lt;/P&gt;&lt;P&gt;During development and testing with the SDK I noticed that sometimes there were Solr time out problems and so I handled them in the code. The code tries to execute the query 10 times, waiting 45 seconds between tries. If it can't get a reply after that the entire batch is retried.&amp;nbsp; Obviously this is a major drag on overall performance. When a job starts it's very unlikey, though it happens sometimes, for a time out to appear but as more batches are processed the time out problem gets worse and worse. Sometimes the time out happens when the search parameters are set&amp;nbsp; (searchService.query(sp):smileywink: and sometimes when a new set of 900 documents has to come (rs.getNodeRefs():smileywink:. Although Alfresco could be used during processing right now it's not used so the only load is the job.&lt;/P&gt;&lt;P&gt;After about 12 hours of processing it's so bad that entire batches are redone a few times before they can finish.&amp;nbsp; We then restart Alfresco and the job picks up where it stopped. In the testing envivronmet this is ok but I could not do this in production.&lt;/P&gt;&lt;P&gt;The processing logic reads a query offset (skipCount for the query) and does 10 queries of 900 documents. After the batch is processed, the offset is updated (in a Postgres table) and the job waits to be run again.&lt;/P&gt;&lt;P&gt;This is the part in docker-compose,yml relevant to solr.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;solr6:
        restart: always
        build:
          context: ./search
          args:
            SEARCH_TAG: ${SEARCH_CE_TAG}
            SOLR_HOSTNAME: solr6
            ALFRESCO_HOSTNAME: alfresco
            ALFRESCO_COMMS: secret 
            CROSS_LOCALE: "true"
        mem_limit: 24576m
        environment:
            #Solr needs to know how to register itself with Alfresco
            SOLR_ALFRESCO_HOST: "alfresco"
            SOLR_ALFRESCO_PORT:  "8080" 
            #Alfresco needs to know how to call solr
            SOLR_SOLR_HOST: "solr6"
            SOLR_SOLR_PORT: "8983"
            #Create the default alfresco and archive cores
            SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
            SOLR_JAVA_MEM: "-Xms10240m -Xmx16384m" 
            SOLR_OPTS: "
                -XX:NewSize=5120m
                -XX:MaxNewSize=5120m
                -Dalfresco.secureComms.secret=xamw94vet9o 
            "
        volumes: 
            - ./data/solr-data:/opt/alfresco-search-services/data   &lt;/PRE&gt;&lt;P&gt;(See SOLR_JAVA_MEM: "-Xms10240m -Xmx16384m" )&lt;/P&gt;&lt;P&gt;I increased the Solr container size but it did not help.&lt;/P&gt;&lt;P&gt;I also noticed this drop in performance when trying an external shell script (/bin/bash) using the REST API&amp;nbsp; with curl a few weeks ago but back then I wasn't sure what caused this problem and switchd to Java running in Alfresco. This makes me think it's not a Java problem. Solr appears to be too busy or stuck on something.&lt;/P&gt;&lt;P&gt;My question is what causes Solr to time out more and more often and how can thihs be tuned?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2022 02:23:46 GMT</pubDate>
    <dc:creator>konsultex</dc:creator>
    <dc:date>2022-10-21T02:23:46Z</dc:date>
    <item>
      <title>Alfresco 7.2 container solr time-outs</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146093#M38693</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm running a custom scheduled job that's processing documents in the repository in batches of 9,000 documents. The repository has many million documents but it's not a problem for me because Alfresco could be used in the meantime. This question is related to my other post&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/java-heap-space-with-java-class-custom-action/td-p/314093" target="_blank" rel="noopener nofollow noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-forum/java-heap-space-with-java-class-custom-action/td-p/314093&lt;/A&gt; . I can process about 36,000 docments per hour because the job is started every 15 minutes. Processing the batch takes between 6 and 11 minutes so Alfresco has some time to "settle down". The job does an AFTS query on Solr like this:&lt;/P&gt;&lt;P&gt;+TYPE:"cm:content" AND -cm:creator:"System" AND -TYPE:"cm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;erson" AND -TYPE:"lnk:link" AND -TYPE:"fm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ost" AND -TYPE:"dl.issue" AND -TYPE:"dl.event" AND -TYPE:"dl.todolist" AND -TYPE:"cm.post" AND +cm:created:["1900-01-01" TO "2022-10-21T01:53:00.356281"]&lt;/P&gt;&lt;P&gt;During development and testing with the SDK I noticed that sometimes there were Solr time out problems and so I handled them in the code. The code tries to execute the query 10 times, waiting 45 seconds between tries. If it can't get a reply after that the entire batch is retried.&amp;nbsp; Obviously this is a major drag on overall performance. When a job starts it's very unlikey, though it happens sometimes, for a time out to appear but as more batches are processed the time out problem gets worse and worse. Sometimes the time out happens when the search parameters are set&amp;nbsp; (searchService.query(sp):smileywink: and sometimes when a new set of 900 documents has to come (rs.getNodeRefs():smileywink:. Although Alfresco could be used during processing right now it's not used so the only load is the job.&lt;/P&gt;&lt;P&gt;After about 12 hours of processing it's so bad that entire batches are redone a few times before they can finish.&amp;nbsp; We then restart Alfresco and the job picks up where it stopped. In the testing envivronmet this is ok but I could not do this in production.&lt;/P&gt;&lt;P&gt;The processing logic reads a query offset (skipCount for the query) and does 10 queries of 900 documents. After the batch is processed, the offset is updated (in a Postgres table) and the job waits to be run again.&lt;/P&gt;&lt;P&gt;This is the part in docker-compose,yml relevant to solr.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;solr6:
        restart: always
        build:
          context: ./search
          args:
            SEARCH_TAG: ${SEARCH_CE_TAG}
            SOLR_HOSTNAME: solr6
            ALFRESCO_HOSTNAME: alfresco
            ALFRESCO_COMMS: secret 
            CROSS_LOCALE: "true"
        mem_limit: 24576m
        environment:
            #Solr needs to know how to register itself with Alfresco
            SOLR_ALFRESCO_HOST: "alfresco"
            SOLR_ALFRESCO_PORT:  "8080" 
            #Alfresco needs to know how to call solr
            SOLR_SOLR_HOST: "solr6"
            SOLR_SOLR_PORT: "8983"
            #Create the default alfresco and archive cores
            SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
            SOLR_JAVA_MEM: "-Xms10240m -Xmx16384m" 
            SOLR_OPTS: "
                -XX:NewSize=5120m
                -XX:MaxNewSize=5120m
                -Dalfresco.secureComms.secret=xamw94vet9o 
            "
        volumes: 
            - ./data/solr-data:/opt/alfresco-search-services/data   &lt;/PRE&gt;&lt;P&gt;(See SOLR_JAVA_MEM: "-Xms10240m -Xmx16384m" )&lt;/P&gt;&lt;P&gt;I increased the Solr container size but it did not help.&lt;/P&gt;&lt;P&gt;I also noticed this drop in performance when trying an external shell script (/bin/bash) using the REST API&amp;nbsp; with curl a few weeks ago but back then I wasn't sure what caused this problem and switchd to Java running in Alfresco. This makes me think it's not a Java problem. Solr appears to be too busy or stuck on something.&lt;/P&gt;&lt;P&gt;My question is what causes Solr to time out more and more often and how can thihs be tuned?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 02:23:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146093#M38693</guid>
      <dc:creator>konsultex</dc:creator>
      <dc:date>2022-10-21T02:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 7.2 container solr time-outs</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146094#M38694</link>
      <description>&lt;P&gt;I guess that the problem may come from this offset / skipCount approach. SOLR performance is affected when skipping a large amount of results.&lt;/P&gt;
&lt;P&gt;I'd try to add a setting in processed nodes to exclude them from future processing in schedule job, so you can get a set of nodes without using the "skipCount" setting.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 07:44:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146094#M38694</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2022-10-21T07:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 7.2 container solr time-outs</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146095#M38695</link>
      <description>&lt;P&gt;Hi Angel,&lt;/P&gt;&lt;P&gt;Thanks for the explanartion of the limitation of skipCount. Before the skipCount approach I&amp;nbsp; used to set a tag on the documents but the Java Heap problem didn't help me when using an action &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; I'll now go back to that and mark the nodes with a tag.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 18:18:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-7-2-container-solr-time-outs/m-p/146095#M38695</guid>
      <dc:creator>konsultex</dc:creator>
      <dc:date>2022-10-23T18:18:07Z</dc:date>
    </item>
  </channel>
</rss>

