Increasing ulimit (open file limit) in PHP without recompiling

649 views
Skip to first unread message

Muhammad Usman

unread,
Jun 16, 2015, 4:51:18 AM6/16/15
to ratch...@googlegroups.com
I have followed this https://rtcamp.com/tutorials/linux/increase-open-files-limit/ to increase open file limit in my Ubuntu. ulimit -Sn and ulimit -Hn now correctly shows 500000. But PHP doesn't respect this, when I reach 1024 concurrent WebSocket connections, it shows:

You MUST recompile PHP with a larger value of FD_SETSIZE. It is set to but you have descriptors numbered at least as high as 1024. --enable-fd-setsize=2048 is recommended, but you may want to set it to equal the maximum number of open files supported by your system.

I read many discussions in this forum and elsewhere, where people having "Too many open files" error and solved by just increasing ulimit without recompiling PHP. The Ratchet doc also doesn't mention about recompiling PHP. I don't want to take hassle of recompiling. 

Am I missing anything or I must have to recompile?

attozk

unread,
Jun 26, 2015, 5:21:23 PM6/26/15
to ratch...@googlegroups.com
Curious to know if you get this error with php-fpm as well?

Muhammad Usman

unread,
Jul 3, 2015, 4:10:53 AM7/3/15
to ratch...@googlegroups.com, attozk
Not sure how would I test with php-fpm.

But the problem disappeared after installing libevent and libevent PHP extension.

-- 
Usman
--

---
You received this message because you are subscribed to a topic in the Google Groups "Ratchet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ratchet-php/cG_EahngdQg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ratchet-php...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages