M
M
Maxim2013-03-01 14:12:45
linux
Maxim, 2013-03-01 14:12:45

What to listen PHP-FPM: socket vs port?

Run PHP-FPM on socket or port? Pros, cons, pitfalls?

Most of all, the question of speed is of interest, and, in particular, the overhead of communicating with the demon. Maybe someone did a benchmark?

If there is something specific to freebsd, it's also interesting.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
C
CrazySquirrel, 2013-03-01
@CrazySquirrel

Sockets work a little bit faster, but in reality, they quickly fall off, because. the allowed number of open handles has been exceeded.
We use the port, the speed is practically the same.

A
Alexey Akulovich, 2013-03-01
@AterCattus

From my own experience, I can only say that it works faster and more stable through sockets. Just freebsd (6-8).

B
betal, 2013-03-01
@betal

This is an inter-process communication issue, but sockets are considered to be faster than the network protocol.

S
Stepan, 2013-03-01
@L3n1n

But in my experience I say with confidence that it works better on ports.
Sysctl did not help in any way. I kept it on sockets for a week and switched to ports. After that, the number of dumps dropped to almost zero.
Do the tests yourself. The same ab utility will help with this.

P
Puma Thailand, 2013-03-01
@opium

Well, if everything is childish on one server, then the socket, if the fronts are on the other, then the port.

A
Alexey Sundukov, 2013-03-01
@alekciy

If the connection is local, then a Unix socket is generally preferred. It can work up to 30% faster. You can manage access rights at the FS level.
In general, I will support opium in the thesis if the backend is local, then the Unix socket.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question