Question

Well, to be specific, I'm running my own content management system running on Linux Apache2 MySQL PHP server. The system is comparable to Linux kernel w/ modules.

--(request start)--

The system launches his "init" script that takes care of dependency-based module loading (only minimum modules are loaded, in proper order, so it "just works", but nothing else (disabled/unused modules are not loaded)).

Once the system is ready, request processing comes in - all the data gets loaded, parsed, processed, buffered, chewed and so on, until we have a complete (x)HTML page.

--(request end)--

Once the request is processed, the data are passed to browser and the system is killed. All this happens in a very short time, but the most cpu-intensive is the beginning part (preparating system for use).


I have a few options:

  1. Let system be in a way it's now (and risk performance issues after it's deployed for REAL usage (approx. 100-500 requests/s per system))
  2. Do some kind of preloading (preparing the system manually and not let anything magic happen then)
  3. Find a way to keep the system in ready-for-use state (all modules loaded, classes initialized, ready MySQL link, etc.)

Question is:

  • Is there a way to accomplish point 3? (point 2 is what I want the least)
  • If it's possible, how?

Thanks for any advices that'll point me right way!

Was it helpful?

Solution

Probably what you need is PHP APC, eAccelerator or some other extension that parses your code and keeps it as byte-code in the memory, which for CPU hungry situations can help your performance a LOT. It seems that you have the knowledge to setup such extension, I would recommend you the "APC" being the most used and tested one out there:

http://en.wikipedia.org/wiki/List_of_PHP_accelerators

Edit: For MySQL I would go with using "persistent connection" which might help as well.

OTHER TIPS

You may Want to compile your Php into a c++ Or Java and gain performance by sacrifice a little Bit go check the wikipedia for more info's HipHop

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top