Skip to main content

PHP-FPM switch from socket to tcp

Comments

6 comments

  • cPanelLauren
    Hi @katmai That would require a lot of customization and not something that would be supported with our implementation of php-fpm. You can read about the modifications which are supported in our documentation here: PHP-FPM - Version 78 Documentation - cPanel Documentation Thanks!
    0
  • katmai
    mhm i think that if a little bit of time would be taken to think about it, it wouldn't be that hard to implement imo. i mean think about it. you're replacing a unix socket with a local port and that's about it. all would need to happen is for the php-fpm interface to have a field where you can enter the ports range: 2000:4000 and then once a switch is changed from socket to tcp - just assign one of those ports and update httpd.conf for all those domains. it's kinda reusing the same code you're using now for the socket, just duplicating it and pasting in the tcp connection. it effectively comes from xxx.socket into 127.0.0.1:port
    0
  • sparek-3
    I suppose the bigger question might be, why? What's the advantage of using tcp/ip over sockets for this?
    0
  • katmai
    it's about use case, not a general consideration. i had projects where i used sockets just fine, others more high traffic where i had to switch to tcp. it's just a pretty big fpm functionality to leave aside and lock in the socket only.
    0
  • cPanelLauren
    Hi @katmai I think a feature request for this would be the best bet, if you'd like to open one you can do so using the link in my signature, once open please post the link here so others can join the discussion as well as vote on it. Thanks!
    0
  • Pablo1981
    There is a powerful reason to switch from sockets to tcp. If you query the pool when using sockets the listen queue is always zero. After running some tests i concluded that there is no listen queue when using sockets (at least i could not find how to make the queue work). This is important because the listen queue allows a request to be queued once the fpm max children is reached. Instead, the FPM implementation of CPanel completely denies the request. That is obviously a big disadvantage for unix socket versus tcp implementation where the second allows you to configure a listen queue lenght and with that the websites will not be reported as down just because all childrens are busy.
    0

Please sign in to leave a comment.