drupal_execute() consumes memory when creating many users during import
budda - October 1, 2008 - 22:46
| Project: | Usernode |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
Creating a large amount of user accounts, in my case 25,000 in a single CSV import fails because the user_save() call in turn calls the usernode_user() and this is generating the usernode using drupal_execute().
The FormsAPI has icky static variables all over and during a large import is causing memory to be consumed quickly, resulting in my PHP script from exhausting available memory (100M!)
Is drupal_execute() really necessary over good old node_save() ?

#1
hm, indeed, I'm not so a fan anymore of drupal_execute() too - but changing this would require a lot of new tests to ensure the stability of the module in any case, a lot of work - so it's not gonna happen.. ;)
#2
I got around the problem by making a separate menu callback in drupal which could process a chunk of CSV data then finish.
I then called the menu callback from the main import routine in a loop using drupal_http_request()
Worked perfectly.