New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the timeout when querying Elasticsearch #15592

Merged
merged 1 commit into from Jul 2, 2018

Conversation

@mpchadwick
Contributor

mpchadwick commented May 30, 2018

Description

Sets a timeout when querying Elasticsearch. Without a timeout the following can happen...

  • For whatever reason Elasticsearch becomes REALLY slow to respond to a bunch of queries (on one site I've seen it taking like 900 seconds in New Relic)
  • Lots of PHP processes wait A LONG TIME for these responses to come back from Elasticsearch.
  • Build up of PHP processes cause entire site to go down due to high load average, php-fpm max children, etc, etc

If the timeout is exceeded the user will get a 503, but at least it won't bring the site down. Anyway, if it's waiting more than the timeout (default 15 seconds) it's a pretty awful user experience already at that point...

Fixed Issues (if relevant)

N/A

Manual testing scenarios

Here's how I tested...

  1. Create a dummy php server that sleeps for 60 seconds and returns nothing[1]
  2. Run that on port 9201 [2]
  3. Update the Magento Elasticseach settings to point to php instance running on port 9201
  4. Visit any category page

[1]

Assuming Magento is querying index magento2-3-develop_product_1

$ tree
.
└── magento2-3-develop_product_1
    └── document
        └── _search
            └── index.php

3 directories, 1 file
$ cat magento2-3-develop_product_1/document/_search/index.php
<?php

sleep(60);

[2]

$ php -S localhost:9201

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento magento deleted a comment from magento-engcom-team Jun 15, 2018

@mpchadwick

This comment has been minimized.

Contributor

mpchadwick commented Jun 15, 2018

@magento-engcom-team give me test instance

@magento-engcom-team

This comment has been minimized.

Contributor

magento-engcom-team commented Jun 15, 2018

Hi @mpchadwick. Thank you for your request.\nUnfortunately, I can only deploy instances for 2.2-develop and 2.3-develop base branches

@mpchadwick

This comment has been minimized.

Contributor

mpchadwick commented Jun 15, 2018

@magento-engcom-team give me new test instance

@magento-engcom-team

This comment has been minimized.

Contributor

magento-engcom-team commented Jun 15, 2018

Hi @mpchadwick. Thank you for your request.\nUnfortunately, I can only deploy instances for 2.2-develop and 2.3-develop base branches

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.0 milestone Jun 26, 2018

@magento-engcom-team magento-engcom-team moved this from TODO to Testing In Progress in Community Pull Requests Jun 26, 2018

@magento-engcom-team magento-engcom-team merged commit a65e241 into magento:2.3-develop Jul 2, 2018

2 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
licence/cla Contributor License Agreement is signed.
Details

Community Pull Requests automation moved this from Testing In Progress to Done Jul 2, 2018

magento-engcom-team pushed a commit that referenced this pull request Jul 2, 2018

@magento-engcom-team

This comment has been minimized.

Contributor

magento-engcom-team commented Jul 2, 2018

Hi @mpchadwick. Thank you for your contribution.
We will aim to release these changes as part of 2.3.0.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment