Comments (4)
This has been possible for 3 years #4583. See --chunks option.
from drush.
Hi @weitzman,
The --chunk
option doesn't actually mitigate this specific issue.
In that issue, the results of the $result = $query->execute();
call returns an array of the 1,000+ IDs, it just doesn't load or process them into full entities yet. However, if there are more IDs in the database than can be feasibly loaded in memory (e.g. millions), then the command simply doesn't work - which is why handling it within a batch context is the more robust way of handling it.
And in terms of implementation, I was thinking something along the lines of this (but we can't use n.nid > :nid
type logic since the entity might not be numeric), this or this.
from drush.
Thanks for clarifying. Can you really run out of memory just from a few million integers? That doesnt seem like a lot of memory consumption. What is your CLI memory_limit? Can it be bumped?
from drush.
Hmm, thought about it a bit more after reviewing how many entities I had to delete (720,000), and you were right, and that seems like a feasible amount of entities IDs to be loaded in PHP. I had a memory limit of 256M on the CLI.
$ php -i | grep mem
memory_limit => 256M => 256M
And was able to resolve the issue by temporarily increasing the memory limit in my settings.php
with the following:
if (PHP_SAPI === 'cli') {
# 512M still wasn't enough.
ini_set('memory_limit', '-1');
}
But I guess it'd just be nice to have the code optimized to not require as much memory if possible.
from drush.
Related Issues (20)
- Allow using rsync from Docker container on the server HOT 1
- bash completion hangs/breaks on drush generate HOT 1
- Drush commands throw TypeError: ucfirst() when $databases array is empty HOT 2
- How drush database update works? HOT 2
- Drush commands for workspaces HOT 2
- Queue items don't have "item_id" if the queue is stored in Redis HOT 2
- PHP Fatal error: Trait "Drush\Commands\AutowireTrait" not found in DevelCommands.php HOT 4
- Add option to update site UUID on config import HOT 4
- drush queue:run referencing not existing hooks
- Add a command to generate batch service HOT 1
- Add support for symfony 7 in 13.x and minimum version of PHP 8.3
- Database update step for `drush deploy` behaves differently than `drush updb --no-cache-clear` HOT 2
- 'Generate generator' command is missing in Drush 12.5+ (present in 13)
- Stop supporting and testing the Windows OS
- Environment variables ignored if the value provided in the configuration file HOT 2
- DrupalFinder drush replacement PR did not fully replaced it in Preflight HOT 3
- Fatal error on cron command help HOT 2
- Twig compile - provide searchpaths argument
- Lexer.php/ParserAbstract.php errors when calling namespaced class in php-cli
- Severe error when `ddev start`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drush.