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 -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4 & mod_fcgid 2.3.9 performance isues Page 1, 2, 3  Next
Author
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Fri 12 Apr '19 10:02    Post subject: Apache 2.4 & mod_fcgid 2.3.9 performance isues Reply with quote

Hello,

i have some isues with a new server installation, i would like a little help please.

My new server is a:

1) Windows 2016 server
2) Intel Xeon 3.20 GHz (2 Processors)
3) 6 GB Ram
4) Apache 2.4
5) mod_fcgid 2.3.9 (because i want to have multiple php versions)

Can you please suggest me, the better configuration for mod_fcgid?

Because i see, that my websites are very slow.

I compare them, with my old server which is:

1) Windows 2003 Server
2) CPU Intel Core 2 QuadQ9550 2.83 GHz
3) 4 GB Ram
4) Apache 2.2
5) No mod_fcgid

And i have a significant difference in responses.

Any help is appreciated.

Thank you Very much.
Back to top
James Blond
Moderator


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

PostPosted: Wed 17 Apr '19 13:40    Post subject: Reply with quote

Please post your fcgid config
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Thu 18 Apr '19 9:45    Post subject: Reply with quote

Thank you for your reply.

My fcgid config now is this:

Code:
<IfModule fcgid_module>
   
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 10000
FcgidMaxRequestsPerProcess 10000
FcgidMaxProcessesPerClass 250
FcgidIOTimeout 120
FcgidIdleTimeout 300
FcgidMaxRequestLen 1048576000
FcgidMaxProcesses 50
FcgidOutputBufferSize 131072
FcgidConnectTimeout 10
FcgidProcessLifeTime 0
FcgidMinProcessesPerClass 0
FcgidFixPathinfo 0
FcgidProcessLifeTime 0
FcgidZombieScanInterval 20
FcgidTimeScore 3
FcgidPassHeader Authorization

</IfModule>



Thank you for your help.
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Tue 07 May '19 10:09    Post subject: Reply with quote

Hello,

any syggestion please?

Is the mod_fcgid 2.3.10 stable available?

Thank you again for your replies.

Best regards,
George
Back to top
Steffen
Moderator


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

PostPosted: Tue 07 May '19 10:36    Post subject: Reply with quote

You say: I compare them, with my old server which is:

Is old sever also with mod_fcgid ?


We have here:

Code:
FcgidInitialEnv PHPRC "PATH to your php.ini"

FcgidInitialEnv PATH "PATH to your PHP ;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"

FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"

FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidInitialEnv PHP_FCGI_CHILDREN 0
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 200
FcgidMaxRequestLen 8131072
FcgidIOTimeout  7200
FcgidConnectTimeout 180
FcgidBusyTimeout 7200


Maybe yu can try. I do not have FcgidPassHeader Authorization

2.3.10 is stable, only waiting for release.
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Tue 07 May '19 10:39    Post subject: Reply with quote

Hello and thank you for your reply.

It is old server, with no fcgi.

Fcgi is slower?

My configuration is looking good?

I'l give i try with your configuration too.

Thank you one more time.

Sorry for my edit, but in your configuration you have only these:

FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidInitialEnv PHP_FCGI_CHILDREN 0
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 200
FcgidMaxRequestLen 8131072
FcgidIOTimeout 7200
FcgidConnectTimeout 180
FcgidBusyTimeout 7200

So you suggest to try these, and remove the other configuration lines i have in my configuration?

Thank you.
Back to top
Steffen
Moderator


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

PostPosted: Tue 07 May '19 11:10    Post subject: Reply with quote

FCGID performance is on par with PHP as module.

I do not see the needed lines in your config:

FcgidInitialEnv PHPRC "PATH to your php.ini"
FcgidInitialEnv PATH "PATH to your PHP ;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"


Yes, use only what I have.
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Tue 07 May '19 13:30    Post subject: Reply with quote

The needed lines you are mentioning, are in another place, in vhost file, because i use fcgi to use different versions of php.

Best Regards,
George
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Tue 07 May '19 15:38    Post subject: Reply with quote

Hello,

i have updated the configuration for fcgi (as Steffen proposed), but again the tests at the old server is at minimum at half time faster than the new server with fcgi.

here you can see the ab test, with my primary configuration. At left is the same web site at the new server with apache 2.4 and fcgi, at the right is the same website at the old serve apache 2.2 without fcgi:

https://ibb.co/7k7XSf6

The same photo with the new fcgi configuration (As Steffen proposed):

https://ibb.co/9tgfvSR

Thank you again.

Regards,
George
Back to top
James Blond
Moderator


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

PostPosted: Tue 07 May '19 19:40    Post subject: Reply with quote

Did you enable op-cache in PHP on the new server?
Back to top
Steffen
Moderator


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

PostPosted: Wed 08 May '19 9:59    Post subject: Reply with quote

James answer triggers me:

Is mod_ fcgid using the same php.ini as the old ?

You can check with:

<?php

phpinfo();

?>
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Wed 08 May '19 12:20    Post subject: Reply with quote

Hello,

the only difference in the two php.ini file is that at the new server is disabled the "extension=php_zip.dll".

-----edit-----
Also i see now, that although in old server with apache 2.2, is enables the php_zip.dll in php.ini, in the php/ext folser there is no php_zip.dll file.

Maybe it didn't work at the old server too, but apache 2.2 still serves the website.
--------------


If i make this enabled at the new server with apache 2.4, then the site takes as a result a 500 error.

I dont find something about op-cache in either php.ini, on both servers.

Thank you again.

Best Regards,
George
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Thu 09 May '19 10:21    Post subject: Reply with quote

Hello,

any help pleas? Any idea?

Thank you again one more time for your time, knowledge and help.

Best regards,
George
Back to top
James Blond
Moderator


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

PostPosted: Fri 10 May '19 9:04    Post subject: Reply with quote

Hello,

you need to set the full path for the extensions.

e.g.
Code:

extension_dir = "C:\php73\ext"


To enable opcache ( load after all the other extensions (except xdebug))

Code:

zend_extension=php_opcache.dll


scroll down to almost the end of php.ini
Look for [opcache]

Code:

opcache.enable=1
opcache.enable_cli=1


for fcgid make sure you fix the path info

cgi.fix_pathinfo=1

see also https://www.apachelounge.com/viewtopic.php?p=10613
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Wed 15 May '19 12:15    Post subject: Reply with quote

Hello and thank you one more time.

1) the full path of extension has benn set e.g. extension_dir = "C:\PHP\5.4.11\ext"

2) At my php 5.4.11 ext folder, there is no php_opache.dll file. At the php 5.6.40 & php 7.3.3 ext folder i see the php_opache.dll file.

So is opache available for php 5.4?

Because my old server has php 5.4 so i would like to make tests for the speed with the same php version.

Also to mention that at my old server i don't have opache too.


3) For the "cgi.fix_pathinfo=1 " i'm reading in the php.ini that the default value is "1". So it has a difference if i uncomment this line?

Thank you again.

Best regards,
George
Back to top
James Blond
Moderator


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

PostPosted: Wed 15 May '19 12:42    Post subject: Reply with quote

Hi George,

geolits wrote:

So is opache available for php 5.4?

Nope, opcache is available from 5.5.5

geolits wrote:

So it has a difference if i uncomment this line?

Yes, by default is is disabled.
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Wed 15 May '19 13:27    Post subject: Reply with quote

Hi James,

sorry but in php.ini file, i see this:

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo

It says tha the default is 1.

So if i have this value =0 the fcgi will not be work?

Because at Apache Service Monitor and with "
cgi.fix_pathinfo=1 " in comments i see this:

https://ibb.co/bgk2SRQ

With which i think so that fcgi works.

Thank again.

Ragards,
George
Back to top
James Blond
Moderator


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

PostPosted: Wed 15 May '19 14:18    Post subject: Reply with quote

geolits wrote:

It says that the default is 1.


Then keep it as 1 or even commented out.

geolits wrote:

So if i have this value =0 the fcgi will not be work?


PHP will still work, only some variable in $_SERVER might not be correct.

geolits wrote:

With which i think so that fcgi works.


Awesome! Did you check the performance again?
Back to top
geolits



Joined: 12 Apr 2019
Posts: 27
Location: Greece

PostPosted: Fri 17 May '19 10:34    Post subject: Reply with quote

Hello,

the performance is about the same, with the cgi.fix_pathinfo=1 in comments or not.

There is significant difference with the old server, is about the double performance, with apache 2.2. and without fcgi.

Regards,
George
Back to top
James Blond
Moderator


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

PostPosted: Sat 18 May '19 8:04    Post subject: Reply with quote

Apache still can run PHP as module. Maybe you can try that instead of fcgid.

What are your mpm settings did you tweak them for apache 2.4?
Back to top


Reply to topic   Topic: Apache 2.4 & mod_fcgid 2.3.9 performance isues View previous topic :: View next topic
Post new topic   Forum Index -> Apache Page 1, 2, 3  Next