PDA

View Full Version : Backend Design Suggestions (wanted)



FunkyRes
04 Jul 2009, 06:02 AM
Not a web design pro. I'm fairly fluent in Linux, it's the only operating system I currently use - and has been for a long time.

Server - linode xen host running x86 CentOS 5.3 - stock CentOS + EPEL with exception of PHP which are RPMs compiled by me, currently running PHP 5.2.10. Only packages not installed by RPM are php libraries installed by Pear.

The site - http://www.shastaherps.org/

It is done entirely via the DOMDocument class. Document is constructed and then sent to browser via $dom->saveXML().

Right now I'm in the process of trying to squeeze some better performance out of it via APC.

Issues:
Unfortunately APC had a co***ict with suhosin, every time I would log in or log out, I would get a blank page. I suspect suhosin did not like the way APC was doing something with session regeneration. Anyone experienced this kind of thing and know directive to suhosin (or APC) might help? Right now suhosin is disabled, not what I want. If it is sessions, sessions are handled by MySQL but I am not using APC to cache any session related queries.

APC (3.0.19) had a co***ict with pear::MDB2. It basically completely broke it unless I disabled the apc.cache_by_default setting. Caching SQL is mainly what I want it for, but caching includes is beneficial and I'd like to do it. I'm new to these caching concepts, is there a way to limit what files APC tries to cache so I can leave /usr/share/pear out of it?

With respect to caching - right now I'm going through and adding the code to use cached query if it exists, and cache the query if it doesn't. I have not yet started to write the code to delete cached entries upon a database insert. So I'm setting a short lifetime for things likely to change and right now once a night am completely dumping the cache.

My script that dumps the cache also then re-creates caches for most of the queries, as it only takes a few seconds yet greatly speeds up the site. I'm kind of thinking I'll go ahead and keep doing that once a night, as it will reduce impact of stale cached queries keep the cache unfragmented. Is there a reason why I shouldn't do this?

Right now I'm on the cheapest linode. The site is not very busy yet but I and a couple other people are working to increase interest in native herps in our area. A childrens section will be added with games/activities for them, I'm designing a blog where field herpers can blog about their outings (I looked at several existing ones and didn't really like any of them), etc.

Obviously if it gets too much traffic I'll have to spring for better plan, but other than caching queries, any suggestions on backend things to help keep performance up with limited resources?

Thanks for any suggestions.

Alan
08 Jul 2009, 12:40 AM
Your caching seems fine. Another thing you could do to help with resources is compress the data before it's sent. Will take up some processor time on the client side but I wouldn't worry about it. :)

Also, if theres alot of information on the page, use output buffering. It will help marginally.