Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EAA22200C5B for ; Thu, 13 Apr 2017 04:36:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E952F160BA8; Thu, 13 Apr 2017 02:36:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D0A3160B95 for ; Thu, 13 Apr 2017 04:36:45 +0200 (CEST) Received: (qmail 82859 invoked by uid 500); 13 Apr 2017 02:36:43 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 82834 invoked by uid 99); 13 Apr 2017 02:36:41 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2017 02:36:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 11A15181059 for ; Thu, 13 Apr 2017 02:36:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.103 X-Spam-Level: X-Spam-Status: No, score=-0.103 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=elyograg.org Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xOjIXjCjN4RV for ; Thu, 13 Apr 2017 02:36:37 +0000 (UTC) Received: from frodo.elyograg.org (frodo.elyograg.org [166.70.79.219]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 4D2855FB5C for ; Thu, 13 Apr 2017 02:36:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by frodo.elyograg.org (Postfix) with ESMTP id A47611E5C for ; Wed, 12 Apr 2017 20:36:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=elyograg.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject:received:received; s=mail; t= 1492050985; bh=fc1+auOz8ggW7qd8BOGhPwC61Vn3LFlcKIc0BpNlbVY=; b=A tkjX/BUSbgxm3XmRM6+pEjiVTNQ8DH4NYkdmBQWm4OSsEkcas1KS2o3mAAhVwUUl 2vRwHqdVJJbanlE0E8zPFzsuV8lEs7KycoD+PpvsO0HnrKpi1vMMwp4+9K4KaJUK TuOjW5U/1a3ttSz7b/ODXGW/uvzkMeha0cIjsdJb3Y= X-Virus-Scanned: Debian amavisd-new at frodo.elyograg.org Received: from frodo.elyograg.org ([127.0.0.1]) by localhost (frodo.elyograg.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 25fVs1KjTAem for ; Wed, 12 Apr 2017 20:36:25 -0600 (MDT) Received: from [192.168.1.111] (111.int.elyograg.org [192.168.1.111]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: elyograg@elyograg.org) by frodo.elyograg.org (Postfix) with ESMTPSA id 641071E58 for ; Wed, 12 Apr 2017 20:36:25 -0600 (MDT) Subject: Re: Long GC pauses while reading Solr docs using Cursor approach To: solr-user@lucene.apache.org References: <0e04d6c8-a3cc-3824-542d-e45024d7876a@elyograg.org> From: Shawn Heisey Message-ID: Date: Wed, 12 Apr 2017 20:36:25 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit archived-at: Thu, 13 Apr 2017 02:36:46 -0000 On 4/12/2017 5:19 PM, Chetas Joshi wrote: > I am getting back 100K results per page. > The fields have docValues enabled and I am getting sorted results based on "id" and 2 more fields (String: 32 Bytes and Long: 8 Bytes). > > I have a solr Cloud of 80 nodes. There will be one shard that will get top 100K docs from each shard and apply merge sort. So, the max memory usage of any shard could be 40 bytes * 100K * 80 = 320 MB. Why would heap memory usage shoot up from 8 GB to 17 GB? From what I understand, Java overhead for a String object is 56 bytes above the actual byte size of the string itself. And each character in the string will be two bytes -- Java uses UTF-16 for character representation internally. If I'm right about these numbers, it means that each of those id values will take 120 bytes -- and that doesn't include the size the actual response (xml, json, etc). I don't know what the overhead for a long is, but you can be sure that it's going to take more than eight bytes total memory usage for each one. Then there is overhead for all the Lucene memory structures required to execute the query and gather results, plus Solr memory structures to keep track of everything. I have absolutely no idea how much memory Lucene and Solr use to accomplish a query, but it's not going to be small when you have 200 million documents per shard. Speaking of Solr memory requirements, under normal query circumstances the aggregating node is going to receive at least 100K results from *every* shard in the collection, which it will condense down to the final result with 100K entries. The behavior during a cursor-based request may be more memory-efficient than what I have described, but I am unsure whether that is the case. If the cursor behavior is not more efficient, then each entry in those results will contain the uniqueKey value and the score. That's going to be many megabytes for every shard. If there are 80 shards, it would probably be over a gigabyte for one request. Thanks, Shawn