Re: [PHP] problem about PHP-FPM in TCP socket and Unix socket
Something else that should be said: You won't need to muck around with firewall settings as well (that if your running a firewall on the same box On Sat, Mar 3, 2012 at 11:22 AM, Matijn Woudt wrote: > On Fri, Mar 2, 2012 at 5:56 PM, Yuchen Wang wrote: >> Hello all, >> >> I am trying to config some new server >> >> All of my servers are using TCP Socket(127.0.0.1:9000) between nginx and >> php-fpm before >> >> But, I run ab(ab -n 2 -c50 http://192.168.74.130:81/) to test the >> performance of Unix Socket and TCP Socket, >> the result is Unix is little better than TCP >> >> Usually we run php and web server in the same server, >> So, TCP socket and Unix socket >> Which method do you prefer ? >> >> Thank you >> >> -- >> *Yuchen Wang* > > Always go for Unix sockets. TCP has quite a bit overhead which > includes stuff you really don't need if two processes live on the same > server. Think about error detection, flow control, congestion control, > packet loss. None of these are needed if your system is functioning > correctly. > > - Matijn > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem about PHP-FPM in TCP socket and Unix socket
On Fri, Mar 2, 2012 at 5:56 PM, Yuchen Wang wrote: > Hello all, > > I am trying to config some new server > > All of my servers are using TCP Socket(127.0.0.1:9000) between nginx and > php-fpm before > > But, I run ab(ab -n 2 -c50 http://192.168.74.130:81/) to test the > performance of Unix Socket and TCP Socket, > the result is Unix is little better than TCP > > Usually we run php and web server in the same server, > So, TCP socket and Unix socket > Which method do you prefer ? > > Thank you > > -- > *Yuchen Wang* Always go for Unix sockets. TCP has quite a bit overhead which includes stuff you really don't need if two processes live on the same server. Think about error detection, flow control, congestion control, packet loss. None of these are needed if your system is functioning correctly. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem about PHP-FPM in TCP socket and Unix socket
This how I would look at it, if it on the same box use socket, and yes it is expected that socket is faster than TCP since (as far as I know) you don't need to deal with the overhead of TCP. Regards, Daniel Fenn On Sat, Mar 3, 2012 at 3:56 AM, Yuchen Wang wrote: > Hello all, > > I am trying to config some new server > > All of my servers are using TCP Socket(127.0.0.1:9000) between nginx and > php-fpm before > > But, I run ab(ab -n 2 -c50 http://192.168.74.130:81/) to test the > performance of Unix Socket and TCP Socket, > the result is Unix is little better than TCP > > Usually we run php and web server in the same server, > So, TCP socket and Unix socket > Which method do you prefer ? > > Thank you > > -- > *Yuchen Wang* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem about PHP
> -Original Message- > From: ChengWen_Yu [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 16, 2001 10:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Problem about PHP > > > I want to write a library for the PHP on Solaris. But I > don't know how to do and where I should put this library > than PHP could reach it. That's going to depend on what you mean by a "library": If you want to write some functions in PHP and make them available to other scripts, then it's just a matter of placing that file somewhere in your include_path and calling it into your other scripts with include(), require(), auto_prepend_file, etc. You can find some information in the manual on defining functions in PHP at http://php.net/manual/en/functions.php If you want to actually extend the capabilities of PHP by adding new functions to the language, you'll want to start by reading README.EXT_SKEL in the directory where PHP is installed. That should, I think, give you most of the information you need to get started. --- Mark Roedel ([EMAIL PROTECTED]) | "There cannot be a crisis next week. Systems Programmer / WebMaster | My schedule is already full." LeTourneau University | -- Henry Kissinger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]