Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Queuing got me as far as indexing 120k links now for that sitemap. Next: drush xmlsitemap-regenerate dies at following memory_limits: 512M, 1024M, 2048M, 4096M
(some) error messages:
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 9201 bytes) in /docroot/core/lib/Drupal/Core/Database/Statement.php on line 59
Warning: Unknown: Drupal\Core\StreamWrapper\PublicStream::stream_write is not implemented! in Unknown on line 0
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 8208 bytes) in /docroot/core/lib/Drupal/Core/Routing/CompiledRoute.php on line 146
Segmentation fault
Apart from taking more than half an hour it still doesn't finish. Anyways, at 4GB I gave up.
I'm having similar results to Andre-B in #14. Trying to create a sitemap of ~120k nodes. I've increased the RAM of my VM to 4GB and set the PHP max_execution_time to unlimited. Both the UI and Drush sitemap builds give either 'memory exhausted' or 'timeout' errors. This is both with and without the patch in #15.
I'm seeing xmlsitemap:regenerate finish fine at the 8.x-1.2-alpha2 tag, but fail with memory errors at the latest 8.x-1.x. We have ~450,000 rows in xmlsitemap table.
Refactoring of the patch mostly is about moving the additions from xmlsitemap.drush.inc to src/Commands/XmlSitemapCommands.php
But I didn't get it to work.
After that I tested the normal `drush xmlsitemap:rebuild` command which worked well for our scenario.
Number of records in xmlsitemap: 3400
Memory Limit setting: 256M
So the patch seems obsolete for our case.
I also did a test with the #21 patch on the 1.3.0 version of xmlsitemap in combination with drupal core 9.4.8. Expecting that it worked but in my case it didn't. The drush command `drush xmlsitemap-queue-rebuild` wasn't recognized.
Additionally the patch seems not to take entity types without bundles into account. Therefore the patch fails in that case on: $entity_type->getKey('bundle'). I partly fixed that with an $entity_type->hasKey('bundle') check.
Since the patch seemed already broken or at least not working for our scenario with the 1.3.0. version and a recent drupal core version. And since the already available `xmlsitemap-rebuild` command works fine in our scenario. I decided to not further investigate and/or refactor the patch for 1.4.0. With the WIP for 1.4.0 the drush command works, but in my case it didn't fill the queue table.
But maybe for future use or for someone else the WIP is usefull, so therefore it's added with this comment.
As said it isn't ready for (production) usage yet. To apply it as a patch you'd probably have to change the extension from .txt to .patch.
Comments
Comment #1
Dave ReidComment #2
Dave ReidRevised version.
Comment #3
Dave ReidAnd last revision.
Comment #4
Dave ReidCommitted #3 to 7.x-2.x.
Comment #7
Dave ReidComment #9
Dave ReidComment #10
Dave ReidFYI some additional commits were also added to select specific link types in the rebuild process, that should also be ported with the above commits:
http://drupalcode.org/project/xmlsitemap.git/commit/dbcf508
http://drupalcode.org/project/xmlsitemap.git/commit/2f8da5e
Comment #11
marvin_B8 CreditAttribution: marvin_B8 as a volunteer and at comm-press commentedPatch for Drupal 8 but without #10 implementations.
Comment #12
Andre-BThis entityQuery might already run out of memory before even having the chance to process the chunks in batches.
Comment #13
Andre-BComment #14
Andre-BQueuing got me as far as indexing 120k links now for that sitemap. Next: drush xmlsitemap-regenerate dies at following memory_limits: 512M, 1024M, 2048M, 4096M
(some) error messages:
Apart from taking more than half an hour it still doesn't finish. Anyways, at 4GB I gave up.
Comment #15
stBorchertRe-roll against latest development version.
Comment #16
moshe weitzman CreditAttribution: moshe weitzman commentedI'm a little surprised to see Drush command in this patch. I would think that the Drush core queue-run command would process the queue just fine.
Comment #17
oo0shiny CreditAttribution: oo0shiny at Pegasystems commentedI'm having similar results to Andre-B in #14. Trying to create a sitemap of ~120k nodes. I've increased the RAM of my VM to 4GB and set the PHP max_execution_time to unlimited. Both the UI and Drush sitemap builds give either 'memory exhausted' or 'timeout' errors. This is both with and without the patch in #15.
Comment #18
m4oliveiI'm seeing xmlsitemap:regenerate finish fine at the 8.x-1.2-alpha2 tag, but fail with memory errors at the latest 8.x-1.x. We have ~450,000 rows in xmlsitemap table.
Comment #19
m4oliveiI realize that this issue is wrt to rebuild, not regenerate, so that should probably be a separate issue, although perhaps related.
Comment #20
Dave Reid@moshe The Drush command is to populate the queue, not to run it, hence the necessity still.
Comment #21
michaellenahan CreditAttribution: michaellenahan at Hubert Burda Media commentedReroll against current dev
Comment #22
mfv CreditAttribution: mfv as a volunteer commentedStill having this issue on Drupal 9.3
Comment #23
brooke_heaton CreditAttribution: brooke_heaton commentedPatch #21 is no longer applying.
Comment #24
brooke_heaton CreditAttribution: brooke_heaton commentedComment #25
Floris Vedder CreditAttribution: Floris Vedder at Atom commentedI did an attempt to refactor the patch.
Refactoring of the patch mostly is about moving the additions from xmlsitemap.drush.inc to src/Commands/XmlSitemapCommands.php
But I didn't get it to work.
After that I tested the normal `drush xmlsitemap:rebuild` command which worked well for our scenario.
Number of records in xmlsitemap: 3400
Memory Limit setting: 256M
So the patch seems obsolete for our case.
I also did a test with the #21 patch on the 1.3.0 version of xmlsitemap in combination with drupal core 9.4.8. Expecting that it worked but in my case it didn't. The drush command `drush xmlsitemap-queue-rebuild` wasn't recognized.
Additionally the patch seems not to take entity types without bundles into account. Therefore the patch fails in that case on: $entity_type->getKey('bundle'). I partly fixed that with an $entity_type->hasKey('bundle') check.
Since the patch seemed already broken or at least not working for our scenario with the 1.3.0. version and a recent drupal core version. And since the already available `xmlsitemap-rebuild` command works fine in our scenario. I decided to not further investigate and/or refactor the patch for 1.4.0. With the WIP for 1.4.0 the drush command works, but in my case it didn't fill the queue table.
But maybe for future use or for someone else the WIP is usefull, so therefore it's added with this comment.
As said it isn't ready for (production) usage yet. To apply it as a patch you'd probably have to change the extension from .txt to .patch.
Comment #26
mfv CreditAttribution: mfv as a volunteer commentedI still have an interest in this feature/patch. Hoping someone can pick this back up.