Results 1 to 22 of 22
  1. #1
    Join Date
    Jul 2005
    Posts
    30

    Thumbs up Best configuration for dynamic php requests

    Hi

    Which configuration is better for serving many concurrent php request (forum)?

    I was read many about:

    1)Apache + Fastcgi
    2)Nginx + Php-fpm
    3)Nginx reverse proxy for apache...


    Or anything else?

    Thank you.

  2. #2
    Join Date
    Oct 2006
    Posts
    97
    The most stable choice will be Apcache + mod_php, but for performance you should really consider Nginx + Php-fpm, it's good for small and medium sites.

  3. #3
    get suphp for dynamic php requests it uses a little bit more ram and cpu but it does the job

  4. #4
    I'd recommend Nginx + Php-fpm with APC enabled.

  5. #5
    Join Date
    Jul 2010
    Location
    Singapore
    Posts
    775
    i use nginx as reverse proxy + apache (nginxcp.com)

  6. #6
    Nginx + Php-fpm
    Nginx is a small, lightweight web server and reverse proxy and is well-suited to a high traffic site. Compared to Apache, means an Nginx server can run in a much smaller memory footprint.
    PHP-FPM is a daemon that spawns processes to manage your online applications. So, rather than have your web server running plugins to display and process your PHP code, your PHP code is now run natively, by PHP-FPM.

  7. #7
    Join Date
    Jul 2009
    Location
    Tangerang, ID
    Posts
    123
    Nginx + php-fpm is good, you know WHT is using Nginx

  8. #8
    Join Date
    Oct 2009
    Location
    San Leandro, California
    Posts
    245

  9. #9
    Apache + mod_php is definitelly not the best choice in your case:

    You need to fork each new Apache process with each PHP request as the mod_php supports only prefork Apache compilation. You cannot use Apache MPM Worker which is a way faster than prefork.

    I would take Lighttpd + PHP-FastCGI: Lighttpd is threaded and PHP CGI is always up for serving HTTP requests if you need the maximim speed and minimum resources footprint.

    However using Apache + mod_php is safest and easier way if you are not comfortable with tweaking things, like performance and security tuning.
    CloudVPS
    Affordable VPS Servers - Middle East
    High performance | Green technologies

  10. #10
    Join Date
    Oct 2009
    Location
    San Leandro, California
    Posts
    245
    Quote Originally Posted by cloudvps View Post
    Apache + mod_php is definitelly not the best choice in your case:

    You need to fork each new Apache process with each PHP request as the mod_php supports only prefork Apache compilation. You cannot use Apache MPM Worker which is a way faster than prefork.

    I would take Lighttpd + PHP-FastCGI: Lighttpd is threaded and PHP CGI is always up for serving HTTP requests if you need the maximim speed and minimum resources footprint.

    However using Apache + mod_php is safest and easier way if you are not comfortable with tweaking things, like performance and security tuning.
    "You need to fork each new Apache process with each PHP request"

    This is a false statement.

  11. #11
    Well, you right.
    I will rephrase:

    You need to fork a new Apache process once Apache MaxClients is up.
    You probably know how much each fork will cost, especially if you have a large PHP memory_limit ...
    CloudVPS
    Affordable VPS Servers - Middle East
    High performance | Green technologies

  12. #12
    Join Date
    Oct 2008
    Posts
    533
    For high concurrency you have a few options, in order of my preference.

    1) Nginx + PHP-FPM + APC. Easiest to setup if your script doesn't need mod_rewrite. However, I noticed that PHP-FPM sometimes fails to start when the process is restarted. Rarely, but it happens.

    2) Apache mpm-worker/event + mod_fastcgi externalserver to PHP-FPM + APC.

    3) Nginx for static files, and proxy back to Apache + mod_php + APC.

    4) Apache mpm-worker/event + mod_fastcgi (not mod_fcgid) to PHP-CGI. Run a single fastcgi process and put APC on. For some reason however, I can't get Debian packaged mod_fastcgi to work for this setup. I think the module is no longer maintained so its "buggy" with Apache 2.x


    I would stay far far away from Apache + mod_php. It may be the fastest to serve content but its also the fastest way to OOM wreck your server.
    Last edited by Scientist; 03-21-2011 at 11:16 AM.


    Tuxlite.com Complete LAMP and LNMP script for Debian and Ubuntu.

  13. #13
    Join Date
    Jul 2008
    Posts
    466
    Nginx is for static content acceleration only is it not?
    Clook: Fully Managed UK Based Hosting CloudFlare Optimised Partner!
    Established 12 Years - 24/7/365 Support (<10m Avg. Response Time)
    Shared, Reseller, vServer, Dedicated and Beyond
    0845 867 2550 Sales - Visit our Website

  14. #14
    Join Date
    Oct 2006
    Location
    canada
    Posts
    527
    Quote Originally Posted by jerrychenme View Post
    You guys stop speaking BS.

    Apache+mod_php is the fastest combination.

    http://buytaert.net/drupal-performance?page=1
    What exactly on that page leads you to believe this?
    What did you expect was going to happen?
    6sync is where I've made my home ): // @tenkay

  15. #15
    Join Date
    Jul 2005
    Posts
    30
    Quote Originally Posted by lxspcby View Post
    Nginx + php-fpm is good, you know WHT is using Nginx
    WHT use nginx reverse proxy for apache backend?
    I use linone 1024 ,run drupal 7 and ab benmark:30req/s.what about that score?

  16. #16
    Join Date
    Jul 2005
    Posts
    30
    what about use nginx reverse proxy for apache backend?campare with nginx-php-fpm?

  17. #17
    Join Date
    Jan 2004
    Posts
    593
    Im satisfied with Apache mpm-event with FastCGI and eaccellerator.

    From default prefork and suphp setup in cPanel its over a 50% speed improvement.

  18. #18
    Join Date
    Jul 2005
    Posts
    30
    Thanks.
    And hơw about litespeed ?license version,

  19. #19
    Join Date
    Jul 2010
    Location
    Singapore
    Posts
    775
    im satisfied using varnish + apache

  20. #20
    Join Date
    Jul 2005
    Posts
    30
    Quote Originally Posted by Benny Kusman View Post
    im satisfied using varnish + apache
    This use ram alots?

  21. #21
    Join Date
    Jul 2010
    Location
    Singapore
    Posts
    775
    Quote Originally Posted by ghostape View Post
    This use ram alots?
    you can configure the ram size..
    Looking for shared or reseller or VPS Hosting ?
    Try our service at https://www.sosys.net!
    Singapore - Indonesia - Malaysia

  22. #22
    Join Date
    Jul 2005
    Posts
    30
    Quote Originally Posted by Benny Kusman View Post
    im satisfied using varnish + apache
    How about ngĩnx with varnish....

Similar Threads

  1. Best configuration for dynamic php requests
    By hostyourdream in forum Hosting Software and Control Panels
    Replies: 1
    Last Post: 03-20-2011, 03:02 AM
  2. Dynamic PDFs using PHP
    By chrisblack in forum Employment / Job Offers
    Replies: 4
    Last Post: 10-05-2007, 11:50 AM
  3. Dynamic PHP Help
    By 2kau in forum Programming Discussion
    Replies: 2
    Last Post: 10-27-2005, 10:53 PM
  4. Dynamic way to secure PHP
    By Cyberdeeder in forum Hosting Security and Technology
    Replies: 7
    Last Post: 09-19-2004, 10:03 AM
  5. PHP Dynamic Images
    By jjmac78 in forum Programming Discussion
    Replies: 10
    Last Post: 10-29-2003, 08:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •