Author |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7404 Location: EU, Germany, Next to Hamburg
|
Posted: Wed 19 Feb '14 16:55 Post subject: |
|
|
Jan-E wrote: | What it really showed is that the nts version of PHP 5.3 is faster than the ts version.
A fair comparison between the module and mod_fcgid would be to load the ts version in both. |
Yes that is correct. To be fair on the one hand there should be a TS test. But on the other hand f(ast)fcgi(d) is able to use the NTS version. Thread safety always is expensive. |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Wed 19 Feb '14 17:53 Post subject: |
|
|
To complete the picture I decided to instal nginx with fastcgi fpm, on the same server that all the other tests were performed. This will give us an interesting point of reference between fastcgi on windows and on linux. And although nginx is a different webserver than apache, the fastcgi is a separate process and it will be somehow comparable to fastcgi on windows.
I will post the results later on this week.
I have a question. Does anyone have PHP vc9 or vc10 binaries with precompiled PostgresQL support and all standard php extensions?. Any version will do. |
|
Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7404 Location: EU, Germany, Next to Hamburg
|
Posted: Wed 19 Feb '14 18:25 Post subject: |
|
|
if you use linux please try the new event mpm!
if you can because of the distro, I can post the build script that I use. |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Wed 19 Feb '14 22:18 Post subject: |
|
|
James Blond wrote: | I can post the build script that I use. |
OK James, please post the script. |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Sat 22 Feb '14 20:43 Post subject: |
|
|
Here are Nginx test results on CentOS 6.5
The same machine as in previous tests. No caching.
Test file phpinfo.php
Test using FastCGI php-fpm Nginx 1.4.5 php 5.3.3 nts
16 processes (1 process per core)
Time taken for tests: 1.21 sec.
Completed requests: 10000
Failed requests: 0
Requests per second: 8244
Those results are very good. I haven't tuned CentOS yet and I haven't optimize Nginx settings. Roughly 270% better performance than my fastest configuration of Apache on Windows.
With this level of performance I know that I don't have to worry about the webserver anymore because now my database access will be the slowest link.
I think I'm finally cured from using Windows.
James, if you posts your build script I will test Apache event on Centos.
Last edited by jimski on Sun 23 Feb '14 23:59; edited 1 time in total |
|
Back to top |
|
C0nw0nk
Joined: 07 Oct 2013 Posts: 241 Location: United Kingdom, London
|
Posted: Sun 23 Feb '14 11:40 Post subject: |
|
|
jimski wrote: | Here are Nginx test results on CentOS 6.5
The same machine as in previous tests. No caching.
Test file phpinfo.php
Test using FastCGI php-fpm Nginx 1.4.5 php 5.3.3 nts
16 processes (1 process per core)
Time taken for tests: 1.21 sec.
Completed requests: 10000
Failed requests: 0
Requests per second: 8244
Those results are very good. I haven't tuned CentOS yet and I haven't optimize Nginx settings. Roughly 270% better performance than my fastest configuration of Apache on Windows.
With this level of performance I know that I don't have to worry about the webserver anymore because now my database access will be the slowest link.
I think I'm finally cured from Windows plague
Code: | Webster plague:
a : a disastrous evil or affliction : calamity
b : a destructively numerous influx <a plague of locusts>
c : an epidemic disease causing a high rate of mortality : |
Windows Webserving = http://photosofwar.net/samurai-commiting-seppuku/#
James, if you posts your build script I will test Apache event on Centos. |
I wounder how windows with the same php and nginx version does. |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Sun 23 Feb '14 17:34 Post subject: |
|
|
C0nw0nk wrote: |
I wounder how windows with the same php and nginx version does. |
Doubtful that Nginx with fastcgi on windows executing php can perform any better than Apache because windows does not support php-fpm.
I don't think I will be testing windows again. After dozens of hours of tcpip stack tuning, memory and paging tuning, process optimizing and other voodoo magic, I got to 3000 requests per second on phpinfo.php
Last edited by jimski on Sun 23 Feb '14 23:57; edited 1 time in total |
|
Back to top |
|
C0nw0nk
Joined: 07 Oct 2013 Posts: 241 Location: United Kingdom, London
|
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3118 Location: Hilversum, NL, EU
|
Posted: Sun 23 Feb '14 23:20 Post subject: |
|
|
Becoming a bit out of topic.
Microsoft is willing to help, not general in public. On the dev list there is somewhere a post related to a request of Jim where Microsoft is allocating ppl to assist.
Personal I have contacts within Microsoft and they always willing to help and (official) support me.
I did run for a while IIS in front of Apache. IIS has better Network/Connection implementation (is in Kernel). |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Sun 23 Feb '14 23:55 Post subject: |
|
|
Sorry Steffen, I will edit my posts. Don't want to make your work with MS difficult. We all appreciate what you do.
As far as IIS is concerned it can perform well running ASP because ASP was designed to take advantage of MS architecture. A dating website called plentyoffish.com handles 32000 concurrent connections on IIS with ASP.
http://plentyoffish.wordpress.com/2006/06/10/microsoft-aspnet-20-performance/
But I have never seen this level of performance with IIS running php. On top of that plentyoffish has some issues with thread timers when running more than 100 requests per second.
Can anyone of you guys hit Apache running mod_fcgid or mod_fastcgi on windows with more than 1200 concurrent requests while maintaining good network saturation and without significant slow down in performance.
During my test running Apache 2.4 on windows, I couldn't hit the server with more than 1200 conurrent requests using mod_php and while I was able to get higher concurrency with mod_fcgid there was a side effect that when concurrent requests exceeded 2000 Apache slowed down substantially and the network saturation would drop like a rock to 30Mb/s and at times even lower.
I'm talking about testing webserver over the network using another machine running apache bench.
Last edited by jimski on Fri 05 Jul '19 7:39; edited 1 time in total |
|
Back to top |
|
C0nw0nk
Joined: 07 Oct 2013 Posts: 241 Location: United Kingdom, London
|
Posted: Mon 24 Feb '14 10:00 Post subject: |
|
|
Well everything that is updated and changed is to better performance so hopefully it becomes better for php based applications.
I did use IIS for a while the only reason i stopped was because php had some issues (mostly crashes) And the IIS webserver did not realize it had crashed or closed so everything just timed out web traffic wise. |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Mon 24 Feb '14 16:07 Post subject: |
|
|
After optimizing linux and tuning nginx here are new results. BTW I didn't tune it. A friend of mine with better knowledge did an amazing tuneup job.
Test file phpinfo.php
Test using FastCGI php-fpm Nginx 1.4.5 php 5.3.3 nts
Time taken for tests: 0.511 sec.
Completed requests: 10000
Failed requests: 1
Requests per second: 19584
I do get occasional 1 or 2 failed requests out of roughly 20,000. Well I can live with that
Now I have a high benchmark to test against Apache with mod_FastCGI which is next on my agenda.
Last edited by jimski on Mon 24 Feb '14 16:52; edited 5 times in total |
|
Back to top |
|
C0nw0nk
Joined: 07 Oct 2013 Posts: 241 Location: United Kingdom, London
|
Posted: Mon 24 Feb '14 16:15 Post subject: |
|
|
jimski wrote: | After optimizing linux and tuning nginx here are new results. BTW I didn't tune it. A friend of mine with better knowledge did an amazing tuneup job.
Test file phpinfo.php
Test using FastCGI php-fpm Nginx 1.4.5 php 5.3.3 nts
Time taken for tests: 0.511 sec.
Completed requests: 10000
Failed requests: 1
Requests per second: 19584
I do get occasional 1 or 2 failed requests out of roughly 20,000. Well I can live with that  |
That result is with a php cache ? |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Mon 24 Feb '14 16:27 Post subject: |
|
|
No cache in the nginx.conf. However I'm still trying to comprehend what was done to my server to turn it into a Russian Rocket. |
|
Back to top |
|
C0nw0nk
Joined: 07 Oct 2013 Posts: 241 Location: United Kingdom, London
|
Posted: Mon 24 Feb '14 16:31 Post subject: |
|
|
jimski wrote: | No cache in the nginx.conf. However I'm still trying to comprehend what was done to my server to turn it into a Russian Rocket. |
PHP cache in the php.ini config under extensions apc cache maybe ? |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Sun 16 Mar '14 14:44 Post subject: |
|
|
There is no php cache and no apc or other accelerators.
Here are the latest updates of Apache performance on linux. The same machine as above.
All tests used phpinfo.php as test file
Test using mod_fcgid Apache 2.2 event mpm, php 5.3.3
10 processes running
Concurrency 100
Time taken for tests: 1.23 sec.
Completed requests: 10000
Failed requests: 0
Requests per second: 9,701
Test using mod_php Apache 2.2 prefork mpm, php 5.3.3
Concurrency 100
Time taken for tests: 0.5 sec.
Completed requests: 10000
Failed requests: 0
Requests per second: 19987
Test using mod_php Apache 2.2 prefork mpm, php 5.3.3
Concurrency 1000
Time taken for tests: 1.341 sec.
Completed requests: 10000
Failed requests: 0
Requests per second: 7455
Test using FastCGI php-fpm Nginx 1.4.5 php 5.3.3
Concurrency 100
Time taken for tests: 0.511 sec.
Completed requests: 10000
Failed requests: 1
Requests per second: 19584
Test using FastCGI php-fpm Nginx 1.4.5 php 5.3.3
Concurrency 1000
Time taken for tests: 0.523 sec.
Completed requests: 10000
Failed requests: 3
Requests per second: 19104
Apache with mod_php was faster than Nginx at concurrency of 100, however Apache's performance degraded substantially with higher concurrency. In the same time Nginx was pretty even in performance all the way up to concurrency of 1000 although there were occasional 1 to 3 failed requests which i think are related to my network card and not to Nginx.
As far as poor performance of event mpm is concerned this is the first time I have used it so I'm not sure if it was properly configured.
I haven't tested mod_fastcgi with prefork because of lack of time but I suspect it will perform as well as Nginx.
I used Apache 2.2 because the rpms have been well tested and are easy to find. Apache 2.4 may perform better.
And final note. After testing different versions of php, the php 5.3.3 was a little slower but more stable and error free then newer versions.
Last edited by jimski on Sun 16 Mar '14 16:41; edited 4 times in total |
|
Back to top |
|
covener
Joined: 23 Nov 2008 Posts: 60
|
Posted: Sun 16 Mar '14 16:03 Post subject: |
|
|
In this testcase the MPM is not doing much, most of your differences will be as a result of your pool of fcgi servers and how efficiently the fcgi module can dispatch to them.
To normalize for process management you'd want to use php-fpm across the board. In 2.4, I think mod_proxy_fcgi is preferred but presumably mod_fastcgi works just fine for that. |
|
Back to top |
|
jimski

Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Sun 16 Mar '14 16:24 Post subject: |
|
|
Bottom Line: For serving php content from a dedicated server with plenty of RAM and CPU it probably doesn't matter which webserver is being used because the database will be the bottleneck of performance anyway.
However serving static content is a whole different story.
I will probably go with Nginx because for my application it offers better choice of modules. Particularly mod upload, mod RTMP, and mod SysGuard are very appealing to me and I can't find similar modules for Apache. |
|
Back to top |
|
C0nw0nk
Joined: 07 Oct 2013 Posts: 241 Location: United Kingdom, London
|
Posted: Wed 19 Mar '14 10:31 Post subject: |
|
|
I do video streaming with mine i use apache as a backend for serving dynamic content (.php) and nginx outputs mp4, flv etc, pseudo streaming.
Also the MySQL server i use runs on a different machine but i dont have any issues with load speeds from it. I got it from http://www.zpanelcp.com/download/ |
|
Back to top |
|