Virtual Cash: 92890
Joined: 22 May 2005
rated by 281 members
|Posted: Thu Jun 18, 2009 10:36 am Post subject: Solution looking for problem
|Just got a badly dated copy of O'Reilly Apache Modules with Perl/C, which is all the gubbins on how to get web code running a lot lower down the server food chain that the forums do.
Many server tasks are run at a pretty criminally inefficient level, forums are not too bad as with cached php pcode, the overhead of the php interpreter is not much compared to the database accesses.
But you get examples that are really appalling, for instance the flags you see on this forum are done from an "ip to country" database and I have seen example php code that loads this database each time a request is made and in all fairness in straight php there is little choice but to do that We avoid this issue by running a little server written in 'c' that has the database efficiently preloaded and a simple sockets call from php is all it takes to grab a Country code. For this issue we are probably doing things the best way.
However in another thing we do, the gallery system, the accesses to files in the gallery go through to some quite simple php code, but the mere fact it is php code is inefficient. If we could embed a module directly into the server we could drastically reduce the load involved in gallery calls. Not too important on our system where the gallery is only a small % of the load, but very important if we were simply running a gallery system, and anyhow every little helps.
Family Friendly Shareware | | Web Design/Services | Free Forums