Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

PHP-FPM switch from socket to tcp

Discussion in 'EasyApache' started by katmai, Feb 25, 2019.

  1. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    556
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Brno, Czech Republic
    hey guys, so right now php-fpm works with sockets.

    I would like to switch it to tcp, but i am not sure how to do it so that i can have the httpd.conf also updated automatically just like it's done with the sockets.

    any chance you can provide some pointers?

    Thanks in advance.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,226
    Likes Received:
    478
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    556
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Brno, Czech Republic
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,920
    Likes Received:
    167
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    I suppose the bigger question might be, why?

    What's the advantage of using tcp/ip over sockets for this?
     
  5. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    556
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Brno, Czech Republic
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,226
    Likes Received:
    478
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice