Files descriptors number is growing

34 views
Skip to first unread message

Евгений Лебедев

unread,
Apr 15, 2016, 3:07:35 PM4/15/16
to AdWords API Forum
Hello.
I'm using the latest php library to work with Adwords API.
I have some background processes which can run for a long time. They use different services (Campaign, AdGroup, AdGroupAd, etc.).
Process unexpectedly die after some period of time with error 'too many open files'.
At first I increased the limit of open files in the system and users, but error wasn't fixed.
Then I watched with 'lsof' all opened files and found out that the number of file descriptors with TCP connection to Google servers always increasing without being closed.
Help me fix this problem please.

Nadine Sundquist (AdWords API Team)

unread,
Apr 18, 2016, 11:37:30 AM4/18/16
to AdWords API Forum
Hi Евгений,

I chatted with some of the PHP coders on my team, and it sounds like that is not a known common issue with that library. I'll need to ask a few questions to help you find a solution.
  • The only file I know that the library opens is the config file. Do you have a separate process running in the background for each thing that you're doing? That could potentially open the file multiple times.
    • Follow-up: If you're not doing multiple processes, are you doing multi-threading?
  • Are you retrieving a lot of reports in parallel? That could also max the number of files that you have open.
  • What is the maximum number of open files that you have set on your system?
Since this is directly related to the library rather than the API, I would recommend filing a GitHub issue. They may be able to help you faster, since they are the PHP experts.

Cheers,
Nadine, AdWords API Team

Евгений Лебедев

unread,
Apr 18, 2016, 4:12:46 PM4/18/16
to AdWords API Forum
Hello Nadine,
  •  I have different processes (workers) for different types of jobs. Amount of processes are limited (the number of processes was 4 while my investigation =)). Library is opening connections to Adwords servers by creating SoapClients, and it could be the reason of rising number of opened files.
    • I create multiple processes, not threads.
  • I noticed this problem when script without any report downloading was running. This script can run more than one hour and it creates campaigns, ad groups, texts, keywords.
  • The maximum number of files is 1 000 000 000 for system and 500 000 for user that runs this scripts.
Thank you for the advice, I'll create issue.

Best regards,
Eugene.
понедельник, 18 апреля 2016 г., 18:37:30 UTC+3 пользователь Nadine Sundquist (AdWords API Team) написал:

Nadine Sundquist (AdWords API Team)

unread,
Apr 18, 2016, 6:35:41 PM4/18/16
to AdWords API Forum
Hi Eugene,

Thanks for providing the additional information. The config file could potentially be opened every time you create a SOAP client, which might explain what's going on. I'm just not 100% sure. My PHP teammates on GitHub would probably be able to reproduce it in order to be sure of what's going on. Thanks for taking the time to file that GitHub issue. If you don't hear back from them soon, feel free to ping this thread, and I'll see what I can do.

Best,
Nadine, AdWords API Team
Reply all
Reply to author
Forward
0 new messages