'504 - Gateway Timeout' when Indexing the items

Vote:
 

When Indexing the items, it fails sometimes and it gives,

The remote server returned an error: (504) Gateway Timeout. [The remote server returned an error: (504) Gateway Timeout.]

The Indexing logic is here as below, 

    var client = EPiServer.Find.Framework.SearchClient.Instance;
    List<ItemModel> items = getItems(); // Get more than 1000 items
    List<ItemModel> tempItems = new List<ItemModel>();

    //Index 50 items at a time
    foreach(var item in items)
    {
        tempItems.Add(item);
        if (tempItems.Count == 50)
        {
            client.Index(tempItems);
            tempItems.Clear();
        }
    }


What causes this to happen ?

Is this a known issue ?

Additional info:

EPiServer.Find.Framework version 13.0.1
EPiServer.CMS.Core version 11.9.2

#199520
Edited, Nov 30, 2018 12:09
Vote:
 

Hi Senura,

Obvious response I know: but have you tried reducing the batch size?

Normally, I'd expect 50 to be fine, but then I don't know the size of your objects. You should also keep the request below 50MB.

/Jake

#199570
Nov 30, 2018 20:04
Vote:
 

Hi Jake :),

"but have you tried reducing the batch size?"
Yes. It was 200 items before. And then reduced to 50 items. Still the issue is there. And it will not exceed 50MB per request in any manner (One object is below 0.5MBs).

Actually this issue happens only sometimes. Most of the time, we index the same objects. So if indexing 50 items per request works sometimes, how we get an error later by running the same job !

#199585
Dec 03, 2018 6:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.