On 25/05/2010, at 20:41, Juan J. MartÃnez wrote: > El mar, 25-05-2010 a las 11:31 -0700, kevin beckford escribió: >>> A simple change from unix-sockets to a tcp-based php interpreter fixed >>> the cherokee-worker cpu problem. >>> >>> This, of course, is just a workaround, but until it's fixed, just >>> switch to TCP for your php interpreter. >> >> Why is cherokee using unix-sockets at all? What's the advantage? I >> remember asking a while ago about django and Alvaro telling me that >> TCP sockets are more robust... ? > > I guess it depends. From my experience in OpenBSD with MySQL, using TCP > even for localhost it's a performance killer (yes, socket unix it's the > way to go). > > Perhaps Cherokee is better with TCP than with unix sockets, but seems > that unix socket can be faster (it doesn't have the extra overhead of > the TCP protocol handshakes, checking connection, etc). Just speculating > here :)
The main problem with Unix sockets is its live-time (and some sort of problem with async reads that I haven't managed to find yet). Basically, it's pretty tough to be sure about whether or not a socket has a listening application at the other end. Imagine that you wanted to spawn a new interpreter. The first thing that you'd do is to check for a unix socket in the same path. If found, there might be another process listening to it. Of course, you could not tell for sure. In that case, what would you do? Would you remove it and spawn the new interpreter? What would happen is a previous interpreter were initiating itself when you did that? (it's hang forever in a frozen but alive state). What would happen if by any circumstance two interpreters were spawned at the same time? (the slower/later one would keep the socket, the other would freeze), etc, etc. When I said that TCP sockets are more reliable I mean that they avoid all these problems. Besides, according to a couple of quick benchmarks they proved to be slightly faster that Unix sockets. (Yeah, it did not make sense to me either, but still..) -- Octality http://www.octality.com/ _______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
