1

I'm looking for free/low cost ways to make PHP running on our Unix Solaris servers (under Apache) more scalable and reliable. Do you recommend the free version of the Zend Server? Are there other solutions?

This is for a site that on occasion receives over 2 million hits per day with 10GB of data transfer in the same period. Thanks.

Alex
  • 271
  • 3
  • 14
  • You should quantify "reliable," and you need to figure out why it's not reliable before you start looking for something that will address that problem. – jgoldschrafe Nov 04 '10 at 14:45

3 Answers3

2

That depends on your current bottleneck and the current behaviour of the PHP.

  • If your PHP scripts are fairly small, respond fast and do not have any external dependencies (such as SQL queries, in which case the database server could easily be the real bottleneck), you generally don't need any fancy techniques. Properly tuning process limits in httpd.conf and perhaps throwing in an op-code cache such as XCache might be a good idea.

  • If your web site is heavily using database, then proper caching and memcached can be your friends. Do not just blindly install memcached, though -- it becames necessary only under huge load or if your SQL queries are taking a long time, in which case memcached can help a lot. If you have only small databases and SQL queries are always fast, memcached won't help you much, if at all. 2 million hits a day is a nice amount, but for a decent server not huge by any means, unless your site is heavy (or The Daily WTF material :-)) on the resource/code side.

  • Is the content at your site cacheable? Does it provide things like news which changes only occasionally, or is it VERY dynamic, like Facebook? If it is cacheable, consider using a front-end proxy, such as Squid, or if you can afford and your business truly needs it, some hardware solution.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
1

If you are not already using an opcode caching system such as Zend, then that would potentially be one big win, but you need to perform some profiling to figure out where the bottleneck is for your platform, in order to choose an appropriate solution.

How much IO is being performed? How busy are the CPUs? What is your memory usage like? Is the site backed by a database? If so, is that DB on the same host? What is the DB host's utilisation like? What bandwidth is there between the web server and DB server? etc.

jmtd
  • 575
  • 2
  • 6
1

You can consider give APC a try. We recently installed it on a server in our company. The server serves highly loaded website and the result was very good - almost 40% improvement in the load.

About using different solutions: NGINX + PHP-FPM is considered as a good Apache alternative (We are actually using it too in our company and it works very good but I cannot make a full comparison with Apache at this time)

XViD
  • 46
  • 2
  • 1
    It goes for "Alternative PHP Cache" Basically, it optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory. Some useful links that can help you understand APC: http://techportal.ibuildings.com/2010/10/07/understanding-apc/ ##### http://phpro.org/manual/ref.apc.html ##### – XViD Nov 04 '10 at 14:53