Author |
|
dke
Joined: 13 Jul 2007 Posts: 61 Location: sweden
|
Posted: Tue 02 Jun '15 0:20 Post subject: FastCGI or PHP Module? What do you think? |
|
|
I have a website that serves a lot of small requests (thumbnails etc), it's a dedicated server so there's lots of ram and cpu to go, what would you recommend since it's a windows machine. I use apache and FCGI right now but i've heard that php module may be faster but consumes more memory?
What is your opinion?
Thanks! |
|
Back to top |
|
jimski
Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Tue 02 Jun '15 0:49 Post subject: Re: FastCGI or PHP Module? What do you think? |
|
|
If FastCGI works then don't mess with it
We discussed this in some other thread and the opinions were split. If you are serving php then mod php will be faster because on windows fastcgi is limited to only one connection per process, but mod_php is also less stable with high concurrency. However if you are serving a lot of static content then a caching proxy will be much more useful than changing your webserver's php config.
However, when you say "a lot" what does it exactly mean. How many requests per second and what is the request size in MB that you are serving. Also how fast is your LAN and your Internet service because this may be your bottleneck and not the webserver. |
|
Back to top |
|
dke
Joined: 13 Jul 2007 Posts: 61 Location: sweden
|
Posted: Tue 02 Jun '15 10:57 Post subject: |
|
|
Caching proxy? Is that something that pre caches php requests? I have opcache enabled and i though that was what it was doing, caching previously used php code?
FCGI works but i just want to get the max out of this, i tried the php_mod and the opcache seems to not work with it, my php temp folder was empty, while on fcgi there's a lot of files like this: sess_5434hj6b43f324h32hh4gg43226 which means it's working i guess?
I'm interested in this cache proxy, what exactly can it do for me? |
|
Back to top |
|
jimski
Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Tue 02 Jun '15 12:14 Post subject: |
|
|
FCGI(mod_fcgid) memory usage of Apache is less en the Speed is on par when running as module. There are advantages to running PHP with FCGI. Separating the PHP code from the web server removes 'bloat' from the main server, and improves the performance of non-PHP requests. Secondly, having one permanent PHP process as opposed to one per apache process means that shared resources like persistent MySQL connections are used more efficiently. And maybe even more important is stability, since I run FCGI my server never crashed primarily caused by php (extension) errors and out of memory errors. |
|
Back to top |
|
dke
Joined: 13 Jul 2007 Posts: 61 Location: sweden
|
Posted: Tue 02 Jun '15 13:00 Post subject: |
|
|
Thanks steffen, i'll stick to FCGI.
I just find it weird when website stats show 30 concurrent users i only have around 10 fcgi proceesses, if 1 process means 1 user how does that turn out if 30 are sharing 10?
Or is this working as intended? FCGI proceesses will be spawned as needed? |
|
Back to top |
|
dke
Joined: 13 Jul 2007 Posts: 61 Location: sweden
|
Posted: Tue 02 Jun '15 13:02 Post subject: |
|
|
Steffen wrote: | FCGI(mod_fcgid) memory usage of Apache is less en the Speed is on par when running as module. There are advantages to running PHP with FCGI. Separating the PHP code from the web server removes 'bloat' from the main server, and improves the performance of non-PHP requests. Secondly, having one permanent PHP process as opposed to one per apache process means that shared resources like persistent MySQL connections are used more efficiently. And maybe even more important is stability, since I run FCGI my server never crashed primarily caused by php (extension) errors and out of memory errors. |
thank you so much, ill study this! |
|
Back to top |
|