05/09/05

PPHLogger speed improvements

Permalink 09:55:14 am, Categories: Programming, 132 words  

I've noticed recently (especially on my girlfriend's Perfect Imagination site where the counter is at the top) that PPHLogger (the hitcounter I use that is installed on my server) was giving very bad performance. It wasn't due to the large tables, but because of the slowness of the PHP getHostByAddr() function that converts, for example, 172.0.0.1 into localhost (a reverse DNS lookup).

So what was the speed improvement? Stop it looking up the host every time and just store the IP (instead of host and IP). I've now got a separate process that I'll be putting into a Cron job to run regularly to keep my stats updated with the hosts. The only possible downside is that my country stats might not work, but then I never paid much attention to those anyway!

Comments, Trackbacks:

No Comments/Trackbacks for this post.

Navigation