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: FastCGI or PHP Module? What do you think?
Author
dke



Joined: 13 Jul 2007
Posts: 61
Location: sweden

PostPosted: Tue 02 Jun '15 0:20    Post subject: FastCGI or PHP Module? What do you think? Reply with quote

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

PostPosted: Tue 02 Jun '15 0:49    Post subject: Re: FastCGI or PHP Module? What do you think? Reply with quote

If FastCGI works then don't mess with it Smile

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

PostPosted: Tue 02 Jun '15 10:57    Post subject: Reply with quote

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

PostPosted: Tue 02 Jun '15 11:42    Post subject: Reply with quote

Quote:
I'm interested in this cache proxy, what exactly can it do for me?

It can make you rich and pretty beyond wildest dreams however you first need to french kiss a frog.
Here is an instructional video:
https://www.youtube.com/watch?v=nD_4lVgHpm8

Here is a good article about caching proxies.
https://fournines.wordpress.com/2011/12/02/improving-page-speed-cdn-vs-squid-varnish-nginx/

Here are few caching proxy examples:
Apache Traffic Server http://trafficserver.apache.org/
Varnish https://www.varnish-cache.org/
Nginx as caching proxy http://www.nginx.org/
Back to top
Steffen
Moderator


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

PostPosted: Tue 02 Jun '15 12:14    Post subject: Reply with quote

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

PostPosted: Tue 02 Jun '15 13:00    Post subject: Reply with quote

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

PostPosted: Tue 02 Jun '15 13:02    Post subject: Reply with quote

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


Reply to topic   Topic: FastCGI or PHP Module? What do you think? View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules