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

Question about performance (big datasets) #952

Open
AlexRyabikov opened this issue Sep 22, 2023 · 7 comments
Open

Question about performance (big datasets) #952

AlexRyabikov opened this issue Sep 22, 2023 · 7 comments
Assignees
Labels
question Further information is requested triage Need triage

Comments

@AlexRyabikov
Copy link

Hi!
Team from Google ADS API forum send me here :)

I have a question about optimization: Our project is an advertising agency, and we use an API, which has been working fine for us. However, we now have a task to retrieve large sets of data (keywords, budgets) for building reports in BI. Unfortunately, the functions in the Google Ads PHP library that we are using are showing very low performance (1 request takes 1-2 seconds. With volumes in the tens of thousands of clients, this is a very resource-intensive operation).
Could you please suggest alternatives for solving this issue?

@AlexRyabikov AlexRyabikov added question Further information is requested triage Need triage labels Sep 22, 2023
@fiboknacky
Copy link
Member

Generally, what's in the Optimization guide all apply in the client library as well. You might probably get suggested by the forum agents already. Make sure you check this out too.

1 request takes 1-2 seconds

How large is the result of your request?

@fiboknacky fiboknacky self-assigned this Sep 22, 2023
@AlexRyabikov
Copy link
Author

Hi! Request of keywords is around 30k - 45k requests to API (because of big amount accounts of our little clients), so that's a headache with php scripts :)

Thanks for links, I'll check it out

@fiboknacky
Copy link
Member

I mean how many rows (in case of searching) or how many campaigns do you mutate per request--the one that you mentioned it takes 1-2 seconds?

@AlexRyabikov
Copy link
Author

Well, unfortunately, its difficult to say about how request in case of keywords, but for getting budgets case - its ~1 second per 1 account.
But its because out function looks like this:
private function QueryGetData($customerId){ //here is the query etc } - 1 account per request

So, idk, is it possible to rewrite it to make possible to take data from several accounts per 1 request? How do you think?

@hakimio
Copy link

hakimio commented Oct 25, 2023

@AlexRyabikov you could use non-blocking searchAsync() method which returns PromiseInterface and call wait() on the promise after making multiple requests. You can find basic searchAsync() implementation in my feature request.

@AlexRyabikov
Copy link
Author

@hakimio hi! Thanks, sounds good for me. I'll check it out :)

@hakimio
Copy link

hakimio commented Jun 5, 2024

This can be closed now, since searchAsync was added to the client library in v21.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested triage Need triage
Projects
None yet
Development

No branches or pull requests

3 participants