logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fastcgi better than mod_fcgid !?! Page Previous  1, 2, 3, 4, 5  Next
Author
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Wed 19 Feb '14 16:55    Post subject: Reply with quote

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

PostPosted: Wed 19 Feb '14 17:53    Post subject: Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Wed 19 Feb '14 18:25    Post subject: Reply with quote

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

PostPosted: Wed 19 Feb '14 22:18    Post subject: Reply with quote

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

PostPosted: Sat 22 Feb '14 20:43    Post subject: Reply with quote

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

PostPosted: Sun 23 Feb '14 11:40    Post subject: Reply with quote

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

PostPosted: Sun 23 Feb '14 17:34    Post subject: Reply with quote

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

PostPosted: Sun 23 Feb '14 18:17    Post subject: Reply with quote

I wounder why microsoft.com use IIS as a high traffic soloution

http://web-sniffer.net/?url=http%3A%2F%2Fwww.microsoft.com%2F&gzip=yes&http=1.1

Also do you have any links or downloads to setup nginx and php with centos id like to test it myself but i am not a linux guru Sad

Im doing allot of looking into it and it turns out allot of people do use php-fpm on windows but they use cygwin.

http://www.cygwin.com/
Back to top
jimski



Joined: 18 Jan 2014
Posts: 196
Location: USSA

PostPosted: Sun 23 Feb '14 21:32    Post subject: Reply with quote

C0nw0nk wrote:
I wounder why microsoft.com use IIS as a high traffic soloution

Many people say that IIS will outperform apache on windows. Windows is not open source and Apache developers don't have access to all windows internals like microsoft developers do. I have seen open letters written to microsoft asking MS to assist Apache with software development.
http://www.google.com/#q=Jagielski+says+that+Apache+will+be+asking+Microsoft+for+%E2%80%9Chelp+and+support%2C%E2%80%9D+

C0nw0nk wrote:
.. it turns out allot of people do use php-fpm on windows but they use cygwin.

Cygwin = Linux emulation layer
An emulation that will translate linux into slow windows using another layer of signaling and complexity. No way in hell this will improve performance of php. You will be better of running Apache with mod_php.

C0nw0nk wrote:

Also do you have any links or downloads to setup nginx and php with centos id like to test it myself but i am not a linux guru Sad

It may be easier to use Apache on Linux. Many distributions come with Apache preinstalled.

And if you want Nginx it may be easier to use Ubuntu if this is your first linux setup.
http://www.sitepoint.com/setting-up-php-behind-nginx-with-fastcgi/
https://help.ubuntu.com/community/Nginx
http://www.youtube.com/results?search_query=setting%20up%20nginx&sm=3


Last edited by jimski on Mon 24 Feb '14 0:17; edited 2 times in total
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3057
Location: Hilversum, NL, EU

PostPosted: Sun 23 Feb '14 23:20    Post subject: Reply with quote

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

PostPosted: Sun 23 Feb '14 23:55    Post subject: Reply with quote

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

PostPosted: Mon 24 Feb '14 10:00    Post subject: Reply with quote

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

PostPosted: Mon 24 Feb '14 16:07    Post subject: Reply with quote

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 Mr. Green

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

PostPosted: Mon 24 Feb '14 16:15    Post subject: Reply with quote

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 Mr. Green


That result is with a php cache ?
Back to top
jimski



Joined: 18 Jan 2014
Posts: 196
Location: USSA

PostPosted: Mon 24 Feb '14 16:27    Post subject: Reply with quote

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

PostPosted: Mon 24 Feb '14 16:31    Post subject: Reply with quote

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

PostPosted: Sun 16 Mar '14 14:44    Post subject: Reply with quote

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: 55

PostPosted: Sun 16 Mar '14 16:03    Post subject: Reply with quote

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

PostPosted: Sun 16 Mar '14 16:24    Post subject: Reply with quote

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

PostPosted: Wed 19 Mar '14 10:31    Post subject: Reply with quote

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


Reply to topic   Topic: mod_fastcgi better than mod_fcgid !?! View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules Page Previous  1, 2, 3, 4, 5  Next