Skip to content
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

EZP-32184: Added warning about possible memory leaks for reindex command #138

Merged
merged 5 commits into from
Dec 10, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace eZ\Bundle\EzPublishCoreBundle\Command;

use Symfony\Component\Console\Style\SymfonyStyle;
use function count;
use const DIRECTORY_SEPARATOR;
use Doctrine\DBAL\Connection;
Expand Down Expand Up @@ -209,6 +210,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int
);
$this->searchIndexer->createSearchIndex($output, (int) $iterationCount, !$commit);
} else {
$io = new SymfonyStyle($input, $output);
$io->warning(<<<EOT
For optimal performance, before running this command, make sure that:
- the xdebug extension is disabled,
- you're running the command in "prod" environment,
- memory limit for big databases is set to "-1" or an adequately high value,
- --iteration-count is low enough (default: 50),
- number of processes for parallel batch operations is high enough (default: 'auto' is a good choice).
EOT);

if (!$io->confirm('Continue?', true)) {
return 0;
adamwojs marked this conversation as resolved.
Show resolved Hide resolved
}

$output->writeln('Re-indexing started for search engine: ' . $this->searchIndexer->getName());
$output->writeln('');

Expand Down