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

Improve Customer Export Performance #1177

Closed
pippinsplugins opened this issue May 14, 2013 · 13 comments
Closed

Improve Customer Export Performance #1177

pippinsplugins opened this issue May 14, 2013 · 13 comments

Comments

@pippinsplugins
Copy link
Contributor

When there are a lot of customers, the Customer > CSV export tends to time out. We need to look at making this able to handle 5k+ users.

@pippinsplugins
Copy link
Contributor Author

It can now successfully export at least 1500 customers, whereas 1500 would timeout.

For some reason though, the purchase count and spent totals aren't working at all on WP Engine.

Anyone able to test this on a live or staging server?

pippinsplugins added a commit that referenced this issue May 16, 2013
@pippinsplugins
Copy link
Contributor Author

It's still not good enough and does actually still (on some servers) have a limit of about 1500. I'd like to get it up to 20-30k for the limit.

@chriscct7
Copy link
Member

WPEngine issue fixed.

@chriscct7
Copy link
Member

With joining of multiple tables, a 20k to 30k record amount simply will not happen. You'll hit perfomance limits of memory limits or timeout limits or most likely both.
There's only so much you can optomize.

There is one way, however, it would require us to make our own table.
Basically, we'd need a purchase table, with all the data we'd normally get from joining.

If you're willing to do it, I'll make it work.

@pippinsplugins
Copy link
Contributor Author

No custom tables, for several reasons:

  1. I really don't want to
  2. That would require we migrate all of the data. If it was one or the other, I'd go with not being able to export all at once than migrating the data.

There is definitely a way to do this, we'll just have to get more creative.

Right now we're trying to do it in a single call, which simply won't work. We need to implement a "stepping" system where it does the export in batches of 1000 users at a time. With each batch, a new PHP process is started, thus getting rid of the time out problem.

@pippinsplugins
Copy link
Contributor Author

I think it will need to all happen via ajax.

@chriscct7
Copy link
Member

That still causes problems. Lets say you get around the execution time limit, then you'll hit CPU limitations, or your host will axe the process. Guaranteed.

If you move to custom table, I'll be happy to write a import/export for purchases to handle numbers way larger than your goal.

@pippinsplugins
Copy link
Contributor Author

With batches like I"m envisioning, you'd have to be exporting probably 100k plus customers before it'd run into any limits, if even then.

@pippinsplugins
Copy link
Contributor Author

Let's add a radio button to set whether purchase counts and amount spent should be included. Without those two data points, we should be able to export 10k+ pretty easily as it's just a single SQL DISTINCT call.

@pippinsplugins
Copy link
Contributor Author

Maybe even an option to just export email addresses.

@pippinsplugins
Copy link
Contributor Author

Providing an option to do just the emails allows a 1500+ customer site to generate all emails in about 2 seconds, as opposed to timing out.

@pippinsplugins
Copy link
Contributor Author

Names and emails is about 5 seconds.

pippinsplugins added a commit that referenced this issue May 16, 2013
@pippinsplugins
Copy link
Contributor Author

With the emails-only option now, I suspect 10-20k users isn't out of the question.

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

No branches or pull requests

2 participants