My General Guidelines

When developing with Nexista, I try to be practical. I start out generalized, then as things start to shape up, I get more specific, and thus more efficient. For example, when I'm starting a new data structure in XML, I might reference its nodes with very "obtuse" xpath specifiers, like //my_node, rather than /root/specific/path/to/node. The path might change, and I'd rather save my time than the computer's at this stage in the game.

When the application is handling hundreds or thousands of requests per hour, then its a different story.

PHP Performance Optimization

xCache Opcode Cache

I use xCache to cache opcodes. I find that it works well and isn't too difficult to setup.

mod_fcgid

I use the Apache 2.2 worker mpm, so the php module isn't for me. Instead, I use mod_fcgid, a fastcgi compliant Apache module. I've had very positive experiences with it. With some tweaking, xCache works fine.

MySQL / Databases

This deserves a wiki unto itself, but in general, I use the MySQL cache, and try to write efficient queries that utilize table indexes. Again being practical, I usually start grabbing the entire table row, and then getting more specific over time to reduce the size of the flow xml document.

Output Caching

Apache mod_cache versus Cache_Lite

I prefer to use mod_cache when using mod_proxy, and leave application caching up to the application. Nexista can use the PEAR Cache_Lite package via the Nexista Cache Extension, which has worked well for me. By caching inside the application, it is easier to purge the cache when necessary.

Reverse Proxies / Caches

I've had positive experiences with [http://www.docunext.com/wiki/Varnish Varnish] and [http://www.docunext.com/wiki/NGINX NGINX]. (The links are to pages at Docunext which contain my notes on the applications.)

Client versus Server Cache

TODO

Related Pages