Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having issues with modx [cms system] and php performance. and I was wondering if it could have anything to do with the way php is compiled. Is there a performance benefit to compiling php with specific modules as opposed to loaded at runtime. i.e. the performance issues appear to be during database operations using pdo, the slow system has -disable-pdo, could I expect a significant performance bump if I recompiled it --with-pdo [incidentally, what does the --with-pdo=shared m

share|improve this question
I personally doubt it would give much of a difference. In my previous experience, database connections not being set to persistent would lead to bottlenecks since it would have to open a new database connection for each query. – becomingwisest May 4 '12 at 2:00
Interesting comment that I had not considered, I have run the page in question through xdebug and can see that the getRsources & wayfinder extras can run hundreds of queries on one page request... more than my total available connections. Somehing to look at... – Sean Kimball May 4 '12 at 2:39

It won't really make a difference. I'm assuming you're not running PHP as CGI (FastCGI is something else). The difference in load time for statically or dynamically linked modules would only affect the initial load time, and there are performance tradeoffs for both.

It's almost impossible for the difference to add up to anything if PHP is started once and then services more than one request from your frontend server (Apache, nginx, etc). More likely, the code itself is poorly optimized, does many needless database queries, uses lookups on unindexed DB columns, does needless looping, writes and rewrites strings over and over again, and so on and so forth. The list really does just go on and on.

Profile and benchmark the code, and try and find things you can easily optimize with the least effort. Added DB indexes is a freebie and will often times make many orders of magnitude of difference in load times. Install an opcode cache (XCache is great, APC and memcache are also good). Use an object cache (memcache is best here because it shares its cache amongst all processes, but XCache or APC will work well too). Use an HTML cache. etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.