Too Many open files

General discussion forum for the Zend Server
ylandsman
Posts: 37
Joined: Tue Dec 25, 2012 11:59 pm

Too Many open files

Post by ylandsman » Wed Jun 26, 2013 12:20 am

Help!!!! I upgraded to server 10.1 yesterday. Now whenever I try to debug any zf2 based application I get an error message failed to open stream: Too many open files.

I am running Mac OSX 10.8.2, and have tried plaing with the os settings for max files per process etc. but nothing seems to be helping.

User avatar
guysoft
Posts: 13
Joined: Sun Nov 11, 2012 4:32 pm

Re: Too Many open files

Post by guysoft » Wed Jun 26, 2013 8:23 am

Hey ylandsman,
Can you please tell us which version of Zend Server are you using?
Which version of ZF2 are you using?
What PHP version do you have installed?
Are you debugging with the the PHP CLI?
or are you using the debug URL button on studio (via the browser)?

Thanks,
Guy

ylandsman
Posts: 37
Joined: Tue Dec 25, 2012 11:59 pm

Re: Too Many open files

Post by ylandsman » Wed Jun 26, 2013 6:25 pm

I have Zend server 10.1, and ZF2 2.2.1. Php is 5.4.16, and I am debugging from both the browser and Zend Studio.

Hope this helps.

yonman
Posts: 486
Joined: Thu Dec 10, 2009 4:50 pm
Location: Here, There, Everywhere!
Contact:

Re: Too Many open files

Post by yonman » Thu Jun 27, 2013 8:32 am

Thanks,

Just to be sure we have this right: you have Zend Server 6.1 installed alongside Zend Studio 10.1? There's no version 10.1 for Zend Server.
"It's only hubris if I fail" - Gaius Julius Caesar

ylandsman
Posts: 37
Joined: Tue Dec 25, 2012 11:59 pm

Re: Too Many open files

Post by ylandsman » Thu Jun 27, 2013 7:24 pm

oops, yes, typo 6.1 is what i meant. BTW as a work around, what I have discovered works is to execute a ulimit -n 4096 prior to zendctl.sh, so maybe I'll add that to zendctl.sh

User avatar
guysoft
Posts: 13
Joined: Sun Nov 11, 2012 4:32 pm

Re: Too Many open files

Post by guysoft » Sun Jun 30, 2013 12:06 pm

ylandsman wrote:BTW as a work around, what I have discovered works is to execute a ulimit -n 4096 prior to zendctl.sh, so maybe I'll add that to zendctl.sh
Interesting, what does ulimit -n say before you run ulimit -n [number] ?
Because I see in Linux its set as a default of 1024, and on Mac its 256. That might explain why this happens.

Guy

ylandsman
Posts: 37
Joined: Tue Dec 25, 2012 11:59 pm

Re: Too Many open files

Post by ylandsman » Thu Jul 04, 2013 7:13 am

It is indeed at the default of 256

User avatar
guysoft
Posts: 13
Joined: Sun Nov 11, 2012 4:32 pm

Re: Too Many open files

Post by guysoft » Mon Jul 08, 2013 12:33 pm

Hey ylandsman,
We located an issue in debugger that caused the opening of more than 256 files.
Attached is a debugger.so file with the fix. It should solve the problem for you!

In order to install it in your current Zend Server 6.1 Installation do the following:

1. Extract the attached zip file to a given location on your filesystem.
2. Backup your existing file at /usr/local/zend/lib/debugger/php-5.4.x/ZendDebugger.so to /usr/local/zend/lib/debugger/php-5.4.x/ZendDebugger.so.bak
3. Stop Zend Server:

Code: Select all

/usr/local/zend/bin/zendctl.sh stop
4.
Replace the file with the one attached:

Code: Select all

cp /path/to/downloaded/ZendDebugger.so usr/local/zend/lib/debugger/php-5.4.x/ZendDebugger.so
5. Start Zend Server again:

Code: Select all

/usr/local/zend/bin/zendctl.sh start
You can also test how many files are open on the Apache fork using this one-liner:

Code: Select all

for i in  $(ps aux | grep \/httpd | grep daemon | awk '{print $2}' );  do  lsof -p $i ; done
Would be grateful if you report back to us if this indeed solves your problem (remember to remove the workaround).

Guy
ZendDebugger_fix.zip
Zend Debugger so 6.1, php 5.4 with "too many open files bug fixed"
(613.63 KiB) Downloaded 388 times

dani2376
Posts: 1
Joined: Sat Jul 20, 2013 3:15 pm

Re: Too Many open files

Post by dani2376 » Sat Jul 20, 2013 3:19 pm

Thanks for this post!

I now am experiencing the same problem after upgrading to 6.1/10.1 php 5.4 on the Windows 64 platform; Can this same solution be applied to Windows?

mike4152
Posts: 1
Joined: Tue Aug 06, 2013 3:51 pm

Re: Too Many open files

Post by mike4152 » Tue Aug 06, 2013 3:53 pm

I am having the same problem on Zend Server 6.1 (PHP 5.3) on 64-bit Win7. Do you have a similar fix that you can share?

Post Reply